From 63754c72f2a93ca05bf3114ac1d50fc6bd1479e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Tue, 16 Jan 2024 17:06:39 +0000 Subject: [PATCH] fix: Change first-child to nth-child(1) --- editor.planx.uk/src/@planx/components/Content/Public.tsx | 2 +- editor.planx.uk/src/pages/FlowEditor/floweditor.scss | 6 +++--- editor.planx.uk/src/ui/editor/RichTextInput.tsx | 2 +- editor.planx.uk/src/ui/shared/InputRow.tsx | 2 +- editor.planx.uk/src/ui/shared/InputRowLabel.tsx | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/editor.planx.uk/src/@planx/components/Content/Public.tsx b/editor.planx.uk/src/@planx/components/Content/Public.tsx index a000dd16b9..57755d5707 100644 --- a/editor.planx.uk/src/@planx/components/Content/Public.tsx +++ b/editor.planx.uk/src/@planx/components/Content/Public.tsx @@ -22,7 +22,7 @@ const Content = styled(Box, { "& a": { color: getContrastTextColor(color || "#fff", theme.palette.primary.main), }, - "& *:first-child": { + "& *:nth-child(1)": { marginTop: 0, }, })); diff --git a/editor.planx.uk/src/pages/FlowEditor/floweditor.scss b/editor.planx.uk/src/pages/FlowEditor/floweditor.scss index c04cd21333..d893e43c00 100644 --- a/editor.planx.uk/src/pages/FlowEditor/floweditor.scss +++ b/editor.planx.uk/src/pages/FlowEditor/floweditor.scss @@ -171,7 +171,7 @@ $pixel: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAA opacity: 0.3; } - > span:not(:first-child) { + > span:not(:nth-child(1)) { margin-left: 6px; } } @@ -352,7 +352,7 @@ $pixel: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAA $lineWidth; background-repeat: no-repeat, repeat-x, repeat-x; - &:first-child { + &:nth-child(1) { background-position: top center, top right, @@ -392,7 +392,7 @@ $pixel: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAA $lineWidth 100%, 1px 100%; - &:first-child { + &:nth-child(1) { background-position: left center, left bottom, diff --git a/editor.planx.uk/src/ui/editor/RichTextInput.tsx b/editor.planx.uk/src/ui/editor/RichTextInput.tsx index 42b9bf9cf9..3fdce698e9 100644 --- a/editor.planx.uk/src/ui/editor/RichTextInput.tsx +++ b/editor.planx.uk/src/ui/editor/RichTextInput.tsx @@ -97,7 +97,7 @@ export const RichContentContainer = styled(Box)(({ theme }) => ({ }, }, // Styles for placeholder text, to match ui/Input.tsx - "& p.is-editor-empty:first-child::before": { + "& p.is-editor-empty:nth-child(1)::before": { color: theme.palette.text.secondary, opacity: "0.5", content: `attr(data-placeholder)`, diff --git a/editor.planx.uk/src/ui/shared/InputRow.tsx b/editor.planx.uk/src/ui/shared/InputRow.tsx index 9f4c515dff..eb16ddafad 100644 --- a/editor.planx.uk/src/ui/shared/InputRow.tsx +++ b/editor.planx.uk/src/ui/shared/InputRow.tsx @@ -14,7 +14,7 @@ const Root = styled(Box, { flexGrow: 1, marginLeft: 1, marginRight: 5, - "&:first-child": { + "&:nth-child(1)": { marginLeft: 0, }, "&:last-child": { diff --git a/editor.planx.uk/src/ui/shared/InputRowLabel.tsx b/editor.planx.uk/src/ui/shared/InputRowLabel.tsx index 12b41d3679..f8799618ba 100644 --- a/editor.planx.uk/src/ui/shared/InputRowLabel.tsx +++ b/editor.planx.uk/src/ui/shared/InputRowLabel.tsx @@ -7,7 +7,7 @@ const Label = styled(Typography)(({ theme }) => ({ flexGrow: 0, paddingRight: theme.spacing(2), alignSelf: "center", - "&:not(:first-child)": { + "&:not(:nth-child(1))": { paddingLeft: theme.spacing(2), }, })) as typeof Typography;