Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "chore: Fix React :nth-child warnings" #3779

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading