You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- in most stories, swatchgroup now uses colors that now meet contrast in
both our light and dark mode to properly show the "default" of having no
border on the swatches in the swatchgroup
- for the light border story, a new set of colors that don't meet color
contrast for light mode are implemented
- the rounding template was updated to use a selection of the new colors
that meet contrast
- updated light border swatch colors for the light border test case
* The only exception is when a swatch group only takes up a single row. In that case, use any of the rounding options.
18
18
*
19
-
* ### Border only for low-contrast swatches
19
+
* ### Apply border to low-contrast swatches only
20
20
*
21
-
* When swatches within a swatch group have low contrast (below 3:1 contrast with the background), they have a less prominent border compared to the swatch component when used by itself, and should have the `.spectrum-Swatch--lightBorder` class. Low contrast color swatches have a border of `gray-900` at 20% opacity. This reduces the likelihood of the UI interfering with color perception and comparisons.
21
+
* When swatches within a swatch group have low contrast (below 3:1 contrast with the background), they have a less prominent border compared to a single swatch component used by itself, and should have the `.spectrum-Swatch--lightBorder` class. This reduces the likelihood of the UI interfering with color perception and comparisons. Otherwise, swatches within a swatch group that meet contrast should have the `.spectrum-Swatch--noBorder` class.
22
22
*
23
-
* Otherwise, swatches within a swatch group should have the `.spectrum-Swatch--noBorder` class.
23
+
* Implementations should apply the `.spectrum-Swatch--lightBorder` to the individual swatches of a swatch group that do not meet 3:1 contrast.
* Only use rounded swatches if there is a single row.
147
146
*/
148
147
exportconstRounding=RoundingTemplate.bind({});
149
-
Rounding.args={};
148
+
Rounding.args={
149
+
items: [
150
+
{swatchColor: "rgb(9, 144, 120)"},
151
+
{swatchColor: "rgb(10, 141, 153)"},
152
+
{swatchColor: "rgb(228, 52, 163)"},
153
+
{swatchColor: "rgb(240, 45, 110)"},
154
+
]
155
+
};
150
156
Rounding.tags=["!dev"];
151
157
Rounding.parameters={
152
158
chromatic: {disableSnapshot: true},
@@ -168,29 +174,31 @@ Sizing.parameters = {
168
174
};
169
175
170
176
/**
171
-
* In this example, the lower contrast swatches utilize the `.spectrum-Swatch--lightBorder` class.
177
+
* When swatches within a swatch group have low contrast (below 3:1 contrast with the background), the `.spectrum-Swatch--lightBorder` class should be applied to those swatches only.
178
+
*
179
+
* The swatch group example below contains all swatches with low contrast in light mode, therefore each has the `.spectrum-Swatch--lightBorder` class applied.
0 commit comments