Skip to content

Commit

Permalink
Revert "chore: Fix React :nth-child warnings (#3768)"
Browse files Browse the repository at this point in the history
This reverts commit 3262ef8.
  • Loading branch information
DafyddLlyr authored Oct 8, 2024
1 parent 854de63 commit f4e0146
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/Content/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const Content = styled(Box, {
"& a": {
color: getContrastTextColor(color || "#fff", theme.palette.link.main),
},
"& *:nth-of-type(1)": {
"& *:nth-child(1)": {
marginTop: 0,
},
}));
Expand Down
6 changes: 3 additions & 3 deletions editor.planx.uk/src/pages/FlowEditor/floweditor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ $fontMonospace: "Source Code Pro", monospace;
opacity: 0.6;
}

> span:not(:first-child) {
> span:not(:nth-child(1)) {
margin-left: 6px;
}
}
Expand Down Expand Up @@ -477,7 +477,7 @@ $fontMonospace: "Source Code Pro", monospace;
$lineWidth;
background-repeat: no-repeat, repeat-x, repeat-x;

&:nth-of-type(1) {
&:nth-child(1) {
background-position:
top center,
top right,
Expand Down Expand Up @@ -517,7 +517,7 @@ $fontMonospace: "Source Code Pro", monospace;
$lineWidth 100%,
2px 100%;

&:nth-of-type(1) {
&:nth-child(1) {
background-position:
left center,
left bottom,
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/ui/editor/RichTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.placeholder,
opacity: 1,
content: `attr(data-placeholder)`,
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/ui/shared/InputRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Root = styled(Box, {
"& > *": {
flexGrow: 1,
marginRight: 5,
"&:first:child": {
"&:nth-child(1)": {
marginLeft: 0,
},
"&:last-child": {
Expand Down
3 changes: 3 additions & 0 deletions editor.planx.uk/src/ui/shared/InputRowLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const Label = styled(Typography)(({ theme }) => ({
flexGrow: 0,
paddingRight: theme.spacing(2),
alignSelf: "center",
"&:not(:nth-child(1))": {
paddingLeft: theme.spacing(2),
},
})) as typeof Typography;

export default function InputRowLabel({ children }: { children: ReactNode }) {
Expand Down

0 comments on commit f4e0146

Please sign in to comment.