Skip to content

Commit 4e26f85

Browse files
cdransfcastastrophe
authored andcommitted
feat(thumbnail-opacity-checkboard): S2 migration (#3394)
* feat(thumbnail-opacity-checkboard): s2 migration * feat(thumbnail-opacity-checkboard): fix token rule * feat(thumbnail-opacity-checkboard): fix typo, update changeset, move rule * feat(thumbnail-opacity-checkboard): drop unnecessary styles * feat(thumbnail-opacity-checkboard): update token * feat(thumbnail-opacity-checkboard): update changeset
1 parent 3788545 commit 4e26f85

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

.changeset/twenty-tables-know.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@spectrum-css/opacitycheckerboard": major
3+
"@spectrum-css/thumbnail": minor
4+
---
5+
6+
# thumbnail-opacity-checkerboard S2 migration
7+
8+
Adds thumbnail specific `thumbnail-opacity-checkerboard-square-size` token aliased to `--spectrum-opacity-checkerboard-size`. This impacts the display of the `opacity-checkerboard` when used within the `thumbnail` component.
9+
10+
This also corrects an issue with a token name in the `thumbnail` component by renaming `--spectrum-thumbnail-border-color-opacity` to `--spectrum-thumbnail-border-opacity`.

components/opacitycheckerboard/index.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@
2424
}
2525

2626
.spectrum-OpacityCheckerboard {
27-
background:
28-
repeating-conic-gradient(var(--spectrum-opacity-checkerboard-light) 0% 25%, var(--spectrum-opacity-checkerboard-dark) 0% 50%)
29-
var(--spectrum-opacity-checkerboard-position) /
30-
calc(var(--spectrum-opacity-checkerboard-size) * 2)
31-
calc(var(--spectrum-opacity-checkerboard-size) * 2);
27+
background: repeating-conic-gradient(var(--spectrum-opacity-checkerboard-light) 0% 25%, var(--spectrum-opacity-checkerboard-dark) 0% 50%) var(--spectrum-opacity-checkerboard-position) / calc(var(--spectrum-opacity-checkerboard-size) * 2) calc(var(--spectrum-opacity-checkerboard-size) * 2);
3228
}
3329

3430
@media (forced-colors: active) {

components/thumbnail/dist/metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"--spectrum-thumbnail-layer-border-color-outer",
6161
"--spectrum-thumbnail-layer-border-width-inner",
6262
"--spectrum-thumbnail-layer-border-width-outer",
63+
"--spectrum-thumbnail-opacity-checkerboard-square-size",
6364
"--spectrum-thumbnail-opacity-disabled",
6465
"--spectrum-thumbnail-size",
6566
"--spectrum-thumbnail-size-100",
@@ -88,7 +89,7 @@
8889
"--spectrum-white"
8990
],
9091
"system-theme": [],
91-
"passthroughs": [],
92+
"passthroughs": ["--mod-opacity-checkerboard-size"],
9293
"high-contrast": [
9394
"--highcontrast-thumbnail-border-color",
9495
"--highcontrast-thumbnail-border-color-selected",

components/thumbnail/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
--spectrum-thumbnail-focus-indicator-color: var(--spectrum-focus-indicator-color);
3333

3434
--spectrum-thumbnail-color-opacity-disabled: var(--spectrum-thumbnail-opacity-disabled);
35+
36+
/* @passthrough -- custom sizing for opacity checkerboard */
37+
--mod-opacity-checkerboard-size: var(--spectrum-thumbnail-opacity-checkerboard-square-size);
3538
}
3639

3740
.spectrum-Thumbnail--size50 {

components/thumbnail/stories/template.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ export const Template = ({
121121
${OpacityCheckerboard({
122122
rootClass: backgroundColor ? `${rootClass}-image-wrapper` : undefined,
123123
customClasses: isLayer ? [`${rootClass}-layer-inner`] : !backgroundColor ? [`${rootClass}-image-wrapper`] : [],
124-
customStyles: {
125-
"--spectrum-opacity-checkerboard-size": "var(--spectrum-thumbnail-opacity-checkerboard-square-size)"
126-
},
127124
content: image ? [image] : [],
128125
}, context)}
129126
</div>

0 commit comments

Comments
 (0)