Skip to content

Commit 16cc089

Browse files
authored
fix: warning of nth-child (apache#23638)
1 parent deef3b0 commit 16cc089

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/ReactParallelCoordinates.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default styled(ParallelCoordinates)`
106106
height: 18px;
107107
margin: 0px;
108108
}
109-
.parcoords .row:nth-child(odd) {
109+
.parcoords .row:nth-of-type(odd) {
110110
background: ${addAlpha(theme.colors.grayscale.dark2, 0.05)};
111111
}
112112
.parcoords .header {

superset-frontend/plugins/legacy-preset-chart-nvd3/src/ReactNVD3.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export default styled(NVD3)`
152152
white-space: nowrap;
153153
font-weight: ${({ theme }) => theme.typography.weights.bold};
154154
}
155-
tbody tr:not(.tooltip-header) td:nth-child(2) {
155+
tbody tr:not(.tooltip-header) td:nth-of-type(2) {
156156
word-break: break-word;
157157
}
158158
}

superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const SaveDatasetActionButton = ({
4444
font-weight: ${theme.gridUnit * 150};
4545
background-color: ${theme.colors.primary.light4};
4646
color: ${theme.colors.primary.dark1};
47-
&:nth-child(2) {
47+
&:nth-of-type(2) {
4848
&:before,
4949
&:hover:before {
5050
border-left: 2px solid ${theme.colors.primary.dark2};

superset-frontend/src/components/ButtonGroup/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ export default function ButtonGroup(props: ButtonGroupProps) {
3030
role="group"
3131
className={className}
3232
css={{
33-
'& :nth-child(1):not(:nth-last-child(1))': {
33+
'& :nth-of-type(1):not(:nth-last-of-type(1))': {
3434
borderTopRightRadius: 0,
3535
borderBottomRightRadius: 0,
3636
borderRight: 0,
3737
marginLeft: 0,
3838
},
39-
'& :not(:nth-child(1)):not(:nth-last-child(1))': {
39+
'& :not(:nth-of-type(1)):not(:nth-last-of-type(1))': {
4040
borderRadius: 0,
4141
borderRight: 0,
4242
marginLeft: 0,
4343
},
44-
'& :nth-last-child(1):not(:nth-child(1))': {
44+
'& :nth-last-of-type(1):not(:nth-of-type(1))': {
4545
borderTopLeftRadius: 0,
4646
borderBottomLeftRadius: 0,
4747
marginLeft: 0,

superset-frontend/src/components/DropdownButton/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const StyledDropdownButton = styled.div`
4242
background-color: ${({ theme }) => theme.colors.grayscale.light2};
4343
color: ${({ theme }) => theme.colors.grayscale.base};
4444
}
45-
&:nth-child(2) {
45+
&:nth-of-type(2) {
4646
margin: 0;
4747
border-radius: ${({ theme }) =>
4848
`0 ${theme.gridUnit}px ${theme.gridUnit}px 0`};

superset-frontend/src/components/DropdownSelectableIcon/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const StyledDropdownButton = styled(
4646
button.ant-btn:first-of-type {
4747
display: none;
4848
}
49-
> button.ant-btn:nth-child(2) {
49+
> button.ant-btn:nth-of-type(2) {
5050
display: inline-flex;
5151
background-color: transparent !important;
5252
height: unset;

0 commit comments

Comments
 (0)