Skip to content

Commit c81e699

Browse files
averyjohnstonsean-perkins
authored andcommitted
fix(CodeColor, LayeredColorsSelect): fix invalid DOM nesting (#2963)
1 parent d0cf7e1 commit c81e699

File tree

2 files changed

+27
-23
lines changed

2 files changed

+27
-23
lines changed

src/components/page/theming/CodeColor/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import styles from './index.module.scss';
55

66
function CodeColor({ color, ...props }): JSX.Element {
77
return (
8-
<div className={clsx(styles.codeColor, props.className, 'code-color')}>
8+
<span className={clsx(styles.codeColor, props.className, 'code-color')}>
99
<span
1010
className={styles.codeColorBlock}
1111
style={{
@@ -14,7 +14,7 @@ function CodeColor({ color, ...props }): JSX.Element {
1414
}}
1515
/>
1616
{props.children && <code className={styles.codeColorValue}>{props.children}</code>}
17-
</div>
17+
</span>
1818
);
1919
}
2020

src/components/page/theming/LayeredColorsSelect/index.tsx

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -83,28 +83,32 @@ export default function LayeredColorsSelect({ ...props }) {
8383
</InputWrapper>
8484
</div>
8585
<table>
86-
<tr>
87-
<th>Name</th>
88-
<th>Property</th>
89-
<th>Default Value</th>
90-
<th>Description</th>
91-
</tr>
92-
{variations.map((variation) => {
93-
const codeColor = variation.rgb ? `rgb(${variation.value})` : `${variation.value}`;
86+
<thead>
87+
<tr>
88+
<th>Name</th>
89+
<th>Property</th>
90+
<th>Default Value</th>
91+
<th>Description</th>
92+
</tr>
93+
</thead>
94+
<tbody>
95+
{variations.map((variation) => {
96+
const codeColor = variation.rgb ? `rgb(${variation.value})` : `${variation.value}`;
9497

95-
return (
96-
<tr key={variation.name}>
97-
<td className={styles.colorName}>{variation.name}</td>
98-
<td className={styles.colorProperty}>
99-
<code>{variation.property}</code>
100-
</td>
101-
<td className={styles.colorValue}>
102-
<CodeColor color={codeColor}>{variation.value}</CodeColor>
103-
</td>
104-
<td className={styles.colorDescription}>{variation.description}</td>
105-
</tr>
106-
);
107-
})}
98+
return (
99+
<tr key={variation.name}>
100+
<td className={styles.colorName}>{variation.name}</td>
101+
<td className={styles.colorProperty}>
102+
<code>{variation.property}</code>
103+
</td>
104+
<td className={styles.colorValue}>
105+
<CodeColor color={codeColor}>{variation.value}</CodeColor>
106+
</td>
107+
<td className={styles.colorDescription}>{variation.description}</td>
108+
</tr>
109+
);
110+
})}
111+
</tbody>
108112
</table>
109113
</div>
110114
);

0 commit comments

Comments
 (0)