Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- `ToggleGroupControl`: Streamline focus ring color styles ([#81242](https://github.com/WordPress/gutenberg/pull/81242)).
- `ControlWithError`: Remove the internal implementation in favor of the `ControlWithError` component from `@wordpress/ui` ([#81230](https://github.com/WordPress/gutenberg/issues/81230)) ([#81574](https://github.com/WordPress/gutenberg/pull/81574)).
- Remove the unused `components-validated-control__indicator*` styles; the indicator is now rendered and styled by `ValidityIndicator` from `@wordpress/ui` ([#81230](https://github.com/WordPress/gutenberg/issues/81230)) ([#81574](https://github.com/WordPress/gutenberg/pull/81574)).
- `GradientPicker`, `ColorPalette`: Migrate styles from Emotion to an SCSS Module ([#80473](https://github.com/WordPress/gutenberg/pull/80473)).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a breaking change entry in the latest unreleased section, after rebasing


## 39.0.0 (2026-08-12)

Expand Down
11 changes: 8 additions & 3 deletions packages/components/src/color-palette/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import CircularOptionPicker, {
} from '../circular-option-picker';
import { VStack } from '../v-stack';
import { Truncate } from '../truncate';
import { ColorHeading } from './styles';
import { Heading } from '../heading';
import DropdownContentWrapper from '../dropdown/dropdown-content-wrapper';
import styles from './style.module.scss';
import type {
ColorObject,
ColorPaletteProps,
Expand Down Expand Up @@ -116,9 +117,13 @@ function MultiplePalettes( {
const id = `${ instanceId }-${ index }`;
return (
<VStack spacing={ 2 } key={ index }>
<ColorHeading id={ id } level={ headingLevel }>
<Heading
className={ styles[ 'color-heading' ] }
id={ id }
level={ headingLevel }
>
{ name }
</ColorHeading>
</Heading>
<SinglePalette
clearColor={ clearColor }
colors={ colorPalette }
Expand Down
12 changes: 12 additions & 0 deletions packages/components/src/color-palette/style.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.color-heading {
text-transform: uppercase;

// Triple specificity to override the base Heading styles, matching the
// pre-migration Emotion `&&&` behavior. Dart Sass disallows `&&&`, so the
// selector is repeated via interpolation to produce the same specificity.
&#{&}#{&} {
font-size: 11px;
line-height: 24px;
margin-bottom: 0;
}
}
13 changes: 0 additions & 13 deletions packages/components/src/color-palette/styles.ts

This file was deleted.

11 changes: 8 additions & 3 deletions packages/components/src/gradient-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import CircularOptionPicker, {
} from '../circular-option-picker';
import CustomGradientPicker from '../custom-gradient-picker';
import { VStack } from '../v-stack';
import { ColorHeading } from '../color-palette/styles';
import { Heading } from '../heading';
import colorPaletteStyles from '../color-palette/style.module.scss';
import type {
GradientPickerComponentProps,
PickerProps,
Expand Down Expand Up @@ -102,9 +103,13 @@ function MultipleOrigin( {
const id = `color-palette-${ instanceId }-${ index }`;
return (
<VStack spacing={ 2 } key={ index }>
<ColorHeading level={ headingLevel } id={ id }>
<Heading
className={ colorPaletteStyles[ 'color-heading' ] }
level={ headingLevel }
id={ id }
>
{ name }
</ColorHeading>
</Heading>
<SingleOrigin
clearGradient={ clearGradient }
gradients={ gradientSet }
Expand Down
5 changes: 0 additions & 5 deletions tools/eslint/suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,11 +718,6 @@
"count": 1
}
},
"packages/components/src/color-palette/styles.ts": {
"no-restricted-imports": {
"count": 1
}
},
"packages/components/src/color-picker/styles.ts": {
"no-restricted-imports": {
"count": 1
Expand Down
Loading