Skip to content

Commit 5167768

Browse files
author
Melissa Thompson
committed
feat(opacitycheckerboard): small t-shirt size squares
1 parent 2216cf5 commit 5167768

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

components/opacitycheckerboard/index.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ permissions and limitations under the License. */
1515
--spectrum-opacity-checkerboard-square-light
1616
);
1717
--spectrum-opacity-checkerboard-size: var(
18-
--spectrum-opacity-checkerboard-square-size
18+
--spectrum-opacity-checkerboard-square-size-medium
1919
);
2020
--spectrum-opacity-checkerboard-position: left top;
2121
}
2222

23+
.spectrum-OpacityCheckerboard--sizeS {
24+
--spectrum-opacity-checkerboard-size: var(
25+
--spectrum-opacity-checkerboard-square-size-small
26+
);
27+
}
28+
2329
.spectrum-OpacityCheckerboard {
2430
background: repeating-conic-gradient(
2531
var(

components/opacitycheckerboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"main": "dist/index-vars.css",
1717
"peerDependencies": {
18-
"@spectrum-css/tokens": ">=13"
18+
"@spectrum-css/tokens": "^14.0.0-next.3"
1919
},
2020
"devDependencies": {
2121
"@spectrum-css/component-builder-simple": "^5.0.6-next.1"

components/opacitycheckerboard/stories/opacitycheckerboard.stories.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ export default {
1919
control: "text",
2020
description: "Value for <code>--mod-opacity-checkerboard-position</code>. Accepts any valid CSS background-position property value.",
2121
},
22+
size: {
23+
name: "Size",
24+
type: { name: "string", required: true },
25+
table: {
26+
type: { summary: "string" },
27+
category: "Component",
28+
},
29+
options: ["s", "m"],
30+
control: "select",
31+
},
2232
},
2333
args: {
2434
rootClass: "spectrum-OpacityCheckerboard",

components/opacitycheckerboard/stories/template.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ export const Template = ({
1212
customStyles = {},
1313
id,
1414
content = [],
15+
size,
1516
role,
1617
}) => {
1718
return html`
1819
<div
1920
class=${classMap({
2021
[rootClass]: true,
22+
[`${rootClass}--size${size?.toUpperCase()}`]: typeof size !== "undefined",
2123
...customClasses.reduce((a, c) => ({ ...a, [c]: true }), {}),
2224
})}
2325
style=${ifDefined(styleMap({

0 commit comments

Comments
 (0)