Skip to content

Commit 07ef968

Browse files
jsnajdrmirkaaduth
authored
AlignmentMatrixControl: fixup style names and nesting (#73757)
* AlignmentMatrixControl: fixup style names and nesting * Remove unneeded comments * Changelog entry Co-authored-by: jsnajdr <[email protected]> Co-authored-by: mirka <[email protected]> Co-authored-by: aduth <[email protected]>
1 parent cd4fae7 commit 07ef968

File tree

3 files changed

+22
-25
lines changed

3 files changed

+22
-25
lines changed

packages/components/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
### Internal
1515

16-
- `AlignmentMatrixControl`: Migrate styles from Emotion to a CSS module ([#73714](https://github.com/WordPress/gutenberg/pull/73714)).
16+
- `AlignmentMatrixControl`: Migrate styles from Emotion to a CSS module ([#73714](https://github.com/WordPress/gutenberg/pull/73714) and [#73757](https://github.com/WordPress/gutenberg/pull/73757)).
1717

1818
## 30.9.0 (2025-11-26)
1919

packages/components/src/alignment-matrix-control/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function UnforwardedAlignmentMatrixControl( {
5151

5252
const classes = clsx(
5353
'component-alignment-matrix-control',
54-
styles.gridContainer,
54+
styles[ 'grid-container' ],
5555
className
5656
);
5757

@@ -74,7 +74,9 @@ function UnforwardedAlignmentMatrixControl( {
7474
>
7575
{ GRID.map( ( cells, index ) => (
7676
<Composite.Row
77-
render={ <div className={ styles.gridRow } role="row" /> }
77+
render={
78+
<div className={ styles[ 'grid-row' ] } role="row" />
79+
}
7880
key={ index }
7981
>
8082
{ cells.map( ( cell ) => (

packages/components/src/alignment-matrix-control/style.module.scss

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
@use "@wordpress/base-styles/variables" as *;
22
@use "../utils/theme-variables" as *;
33

4-
/* Grid structure */
5-
.gridContainer {
4+
.grid-container {
65
direction: ltr;
76

87
display: grid;
@@ -19,15 +18,14 @@
1918
cursor: pointer;
2019
}
2120

22-
.gridRow {
21+
.grid-row {
2322
grid-column: 1 / -1;
2423

2524
box-sizing: border-box;
2625
display: grid;
2726
grid-template-columns: repeat(3, 1fr);
2827
}
2928

30-
/* Cell */
3129
.cell {
3230
position: relative;
3331

@@ -44,7 +42,6 @@
4442
outline: none;
4543
}
4644

47-
/* Point */
4845
.point {
4946
display: block;
5047
contain: strict;
@@ -60,27 +57,25 @@
6057
/* Use border instead of background color so that the point shows
6158
in Windows High Contrast Mode */
6259
border: 3px solid currentColor;
63-
}
6460

65-
/* Highlight active item */
66-
.cell[data-active-item] .point {
67-
color: $components-color-foreground;
68-
transform: scale(calc(5 / 3));
69-
}
61+
/* Highlight active item */
62+
.cell[data-active-item] & {
63+
color: $components-color-foreground;
64+
transform: scale(calc(5 / 3));
65+
}
7066

71-
/* Hover styles for non-active items */
72-
.cell:not([data-active-item]):hover .point {
73-
color: $components-color-accent;
74-
}
67+
/* Hover styles for non-active items */
68+
.cell:not([data-active-item]):hover & {
69+
color: $components-color-accent;
70+
}
7571

76-
/* Show an outline only when interacting with keyboard */
77-
.cell[data-focus-visible] .point {
78-
outline: 1px solid $components-color-accent;
79-
outline-offset: 1px;
80-
}
72+
/* Show an outline only when interacting with keyboard */
73+
.cell[data-focus-visible] & {
74+
outline: 1px solid $components-color-accent;
75+
outline-offset: 1px;
76+
}
8177

82-
@media not (prefers-reduced-motion) {
83-
.point {
78+
@media not (prefers-reduced-motion) {
8479
transition-property: color, transform;
8580
transition-duration: 120ms;
8681
transition-timing-function: linear;

0 commit comments

Comments
 (0)