@primer/primitives 10.1.0-rc.f1589f93 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -21
- package/dist/build/filters/index.d.ts +0 -1
- package/dist/build/filters/index.js +0 -1
- package/dist/build/formats/jsonFigma.js +1 -2
- package/dist/build/platforms/css.js +6 -7
- package/dist/build/platforms/docJson.js +0 -1
- package/dist/build/platforms/fallbacks.js +0 -1
- package/dist/build/platforms/javascript.js +0 -1
- package/dist/build/platforms/json.js +0 -1
- package/dist/build/platforms/styleLint.js +0 -1
- package/dist/build/platforms/typescript.js +0 -1
- package/dist/build/primerStyleDictionary.js +7 -3
- package/dist/build/schemas/colorToken.d.ts +0 -18
- package/dist/build/schemas/colorToken.js +0 -7
- package/dist/build/transformers/borderToCss.js +2 -2
- package/dist/build/transformers/colorToRgbaFloat.js +2 -12
- package/dist/build/transformers/index.d.ts +0 -1
- package/dist/build/transformers/index.js +0 -1
- package/dist/css/functional/size/border.css +7 -6
- package/dist/css/functional/themes/dark-colorblind.css +60 -6
- package/dist/css/functional/themes/dark-dimmed.css +60 -6
- package/dist/css/functional/themes/dark-high-contrast.css +60 -6
- package/dist/css/functional/themes/dark-tritanopia.css +60 -6
- package/dist/css/functional/themes/dark.css +60 -6
- package/dist/css/functional/themes/light-colorblind.css +60 -6
- package/dist/css/functional/themes/light-high-contrast.css +60 -6
- package/dist/css/functional/themes/light-tritanopia.css +60 -6
- package/dist/css/functional/themes/light.css +60 -6
- package/dist/css/primitives.css +7 -6
- package/dist/docs/base/size/size.json +19 -19
- package/dist/docs/base/typography/typography.json +4 -4
- package/dist/docs/functional/size/border.json +41 -28
- package/dist/docs/functional/size/breakpoints.json +6 -6
- package/dist/docs/functional/size/size-coarse.json +3 -3
- package/dist/docs/functional/size/size-fine.json +3 -3
- package/dist/docs/functional/size/size.json +66 -66
- package/dist/docs/functional/size/viewport.json +6 -6
- package/dist/docs/functional/themes/dark-colorblind.json +475 -128
- package/dist/docs/functional/themes/dark-dimmed.json +519 -444
- package/dist/docs/functional/themes/dark-high-contrast.json +490 -241
- package/dist/docs/functional/themes/dark-tritanopia.json +485 -200
- package/dist/docs/functional/themes/dark.json +469 -102
- package/dist/docs/functional/themes/light-colorblind.json +463 -94
- package/dist/docs/functional/themes/light-high-contrast.json +487 -274
- package/dist/docs/functional/themes/light-tritanopia.json +463 -102
- package/dist/docs/functional/themes/light.json +460 -105
- package/dist/docs/functional/typography/typography.json +46 -46
- package/dist/fallbacks/functional/size/border.json +7 -6
- package/dist/figma/themes/dark-colorblind.json +14 -54
- package/dist/figma/themes/dark-dimmed.json +15 -356
- package/dist/figma/themes/dark-high-contrast.json +10 -129
- package/dist/figma/themes/dark-tritanopia.json +14 -111
- package/dist/figma/themes/dark.json +14 -34
- package/dist/figma/themes/light-colorblind.json +10 -20
- package/dist/figma/themes/light-high-contrast.json +10 -177
- package/dist/figma/themes/light-tritanopia.json +10 -24
- package/dist/figma/themes/light.json +10 -32
- package/dist/internalCss/dark-colorblind.css +88 -6
- package/dist/internalCss/dark-dimmed.css +88 -6
- package/dist/internalCss/dark-high-contrast.css +88 -6
- package/dist/internalCss/dark-tritanopia.css +88 -6
- package/dist/internalCss/dark.css +88 -6
- package/dist/internalCss/light-colorblind.css +88 -6
- package/dist/internalCss/light-high-contrast.css +88 -6
- package/dist/internalCss/light-tritanopia.css +88 -6
- package/dist/internalCss/light.css +88 -6
- package/dist/styleLint/base/size/size.json +19 -19
- package/dist/styleLint/base/typography/typography.json +4 -4
- package/dist/styleLint/functional/size/border.json +41 -28
- package/dist/styleLint/functional/size/breakpoints.json +6 -6
- package/dist/styleLint/functional/size/size-coarse.json +3 -3
- package/dist/styleLint/functional/size/size-fine.json +3 -3
- package/dist/styleLint/functional/size/size.json +66 -66
- package/dist/styleLint/functional/size/viewport.json +6 -6
- package/dist/styleLint/functional/themes/dark-colorblind.json +475 -128
- package/dist/styleLint/functional/themes/dark-dimmed.json +519 -444
- package/dist/styleLint/functional/themes/dark-high-contrast.json +490 -241
- package/dist/styleLint/functional/themes/dark-tritanopia.json +485 -200
- package/dist/styleLint/functional/themes/dark.json +469 -102
- package/dist/styleLint/functional/themes/light-colorblind.json +463 -94
- package/dist/styleLint/functional/themes/light-high-contrast.json +487 -274
- package/dist/styleLint/functional/themes/light-tritanopia.json +463 -102
- package/dist/styleLint/functional/themes/light.json +460 -105
- package/dist/styleLint/functional/typography/typography.json +46 -46
- package/package.json +1 -1
- package/src/tokens/base/typography/typography.json5 +48 -0
- package/src/tokens/functional/border/border.json5 +236 -0
- package/src/tokens/functional/color/dark/app-dark.json5 +0 -2
- package/src/tokens/functional/color/dark/overrides/dark.dimmed.json5 +120 -6
- package/src/tokens/functional/color/dark/overrides/dark.high-contrast.json5 +46 -29
- package/src/tokens/functional/color/dark/overrides/dark.protanopia-deuteranopia.json5 +15 -20
- package/src/tokens/functional/color/dark/overrides/dark.tritanopia.json5 +32 -18
- package/src/tokens/functional/color/dark/patterns-dark.json5 +13 -45
- package/src/tokens/functional/color/dark/primitives-dark.json5 +1 -6
- package/src/tokens/functional/color/light/overrides/light.high-contrast.json5 +67 -20
- package/src/tokens/functional/color/light/overrides/light.protanopia-deuteranopia.json5 +4 -21
- package/src/tokens/functional/color/light/overrides/light.tritanopia.json5 +3 -16
- package/src/tokens/functional/color/light/patterns-light.json5 +11 -47
- package/src/tokens/functional/color/light/primitives-light.json5 +2 -10
- package/src/tokens/functional/size/border.json5 +115 -0
- package/src/tokens/functional/typography/typography.json5 +527 -0
- package/dist/build/filters/isColorWithMix.d.ts +0 -7
- package/dist/build/filters/isColorWithMix.js +0 -24
- package/dist/build/transformers/colorToHexMix.d.ts +0 -8
- package/dist/build/transformers/colorToHexMix.js +0 -20
- package/dist/build/transformers/utilities/mix.d.ts +0 -5
- package/dist/build/transformers/utilities/mix.js +0 -38
- package/src/tokens/base/typography/typography.json +0 -48
- package/src/tokens/functional/border/dark.json5 +0 -12
- package/src/tokens/functional/border/light.json5 +0 -12
- package/src/tokens/functional/color/dark/patterns-dark.json +0 -3963
- package/src/tokens/functional/size/border.json +0 -111
- package/src/tokens/functional/typography/typography.json +0 -527
- /package/src/tokens/base/size/{size.json → size.json5} +0 -0
- /package/src/tokens/functional/size/{breakpoints.json → breakpoints.json5} +0 -0
- /package/src/tokens/functional/size/{size-coarse.json → size-coarse.json5} +0 -0
- /package/src/tokens/functional/size/{size-fine.json → size-fine.json5} +0 -0
- /package/src/tokens/functional/size/{size.json → size.json5} +0 -0
- /package/src/tokens/functional/size/{viewport.json → viewport.json5} +0 -0
package/README.md
CHANGED
|
@@ -80,27 +80,6 @@ You can create color tokens that inherit a color but have a different alpha valu
|
|
|
80
80
|
}
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
#### Mix
|
|
84
|
-
|
|
85
|
-
In rare cases, you may need to create a color between two steps in the color scale, e.g. between `gray.4` and `gray.5`. A common example are interactive states, like `hover` where a full step on the color scale would be to much. For those cases you can use the `mix` property.
|
|
86
|
-
|
|
87
|
-
The `mix` proeprty mixes the color it gets into the main color from the `$value` attribute. The amount added is controlled by the `weight`. A weight of `0.1` adds 10% of the color, and a weight of `0.75` adds 75%.
|
|
88
|
-
|
|
89
|
-
A `mix` proprty must always have a `color` and a `weight` child. `color` can be a `hex` value or a reference to a valid color. The `weight` property must receive a value between `0.0` and `1`.
|
|
90
|
-
|
|
91
|
-
```json5
|
|
92
|
-
{
|
|
93
|
-
control: {
|
|
94
|
-
$value: '{base.color.gray.4}', // main color
|
|
95
|
-
$type: 'color',
|
|
96
|
-
mix: {
|
|
97
|
-
color: '{base.color.gray.5}', // color to mix into the main color
|
|
98
|
-
weight: 0.2, // amount of the mix color that is added === 20% of gray.5 is mix into gray.4
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
83
|
#### Extensions property
|
|
105
84
|
|
|
106
85
|
According to the [w3c design token specs](https://design-tokens.github.io/community-group/format/#design-token), the [`$extensions`](https://design-tokens.github.io/community-group/format/#extensions) property is used for additional meta data.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { isBorder } from './isBorder.js';
|
|
2
2
|
export { isColor } from './isColor.js';
|
|
3
3
|
export { isColorWithAlpha } from './isColorWithAlpha.js';
|
|
4
|
-
export { isColorWithMix } from './isColorWithMix.js';
|
|
5
4
|
export { isDimension } from './isDimension.js';
|
|
6
5
|
export { isDeprecated } from './isDeprecated.js';
|
|
7
6
|
export { isDuration } from './isDuration.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { isBorder } from './isBorder.js';
|
|
2
2
|
export { isColor } from './isColor.js';
|
|
3
3
|
export { isColorWithAlpha } from './isColorWithAlpha.js';
|
|
4
|
-
export { isColorWithMix } from './isColorWithMix.js';
|
|
5
4
|
export { isDimension } from './isDimension.js';
|
|
6
5
|
export { isDeprecated } from './isDeprecated.js';
|
|
7
6
|
export { isDuration } from './isDuration.js';
|
|
@@ -76,7 +76,7 @@ export const jsonFigma = (_a) => __awaiter(void 0, [_a], void 0, function* ({ di
|
|
|
76
76
|
// loop through tokens sorted by reference
|
|
77
77
|
for (const token of sortedTokens) {
|
|
78
78
|
// deconstruct token
|
|
79
|
-
const { attributes, $value: value, $type, $description: description, original, alpha
|
|
79
|
+
const { attributes, $value: value, $type, $description: description, original, alpha } = token;
|
|
80
80
|
const { mode, collection, scopes, group, codeSyntax } = attributes || {};
|
|
81
81
|
// early escape if no type is present
|
|
82
82
|
if (!$type)
|
|
@@ -102,7 +102,6 @@ export const jsonFigma = (_a) => __awaiter(void 0, [_a], void 0, function* ({ di
|
|
|
102
102
|
value,
|
|
103
103
|
type: getFigmaType($type),
|
|
104
104
|
alpha,
|
|
105
|
-
isMix: mix ? true : undefined,
|
|
106
105
|
description,
|
|
107
106
|
refId: [collection, token.name].filter(Boolean).join('/'),
|
|
108
107
|
reference: getReference(dictionary, original.$value, platform),
|
|
@@ -23,7 +23,6 @@ export const css = (outputFile, prefix, buildPath, options) => {
|
|
|
23
23
|
transforms: [
|
|
24
24
|
'name/pathToKebabCase',
|
|
25
25
|
'color/hex',
|
|
26
|
-
'color/hexMix',
|
|
27
26
|
'cubicBezier/css',
|
|
28
27
|
'dimension/rem',
|
|
29
28
|
'duration/css',
|
|
@@ -47,8 +46,8 @@ export const css = (outputFile, prefix, buildPath, options) => {
|
|
|
47
46
|
(options === null || options === void 0 ? void 0 : options.themed) === true &&
|
|
48
47
|
token.$type !== 'custom-viewportRange' &&
|
|
49
48
|
!isFromFile(token, [
|
|
50
|
-
'src/tokens/functional/size/size-coarse.
|
|
51
|
-
'src/tokens/functional/size/size-fine.
|
|
49
|
+
'src/tokens/functional/size/size-coarse.json5',
|
|
50
|
+
'src/tokens/functional/size/size-fine.json5',
|
|
52
51
|
]),
|
|
53
52
|
options: Object.assign({ showFileHeader: false, outputReferences: false, descriptions: false, queries: getCssSelectors(outputFile) }, options === null || options === void 0 ? void 0 : options.options),
|
|
54
53
|
},
|
|
@@ -59,8 +58,8 @@ export const css = (outputFile, prefix, buildPath, options) => {
|
|
|
59
58
|
(options === null || options === void 0 ? void 0 : options.themed) !== true &&
|
|
60
59
|
token.$type !== 'custom-viewportRange' &&
|
|
61
60
|
!isFromFile(token, [
|
|
62
|
-
'src/tokens/functional/size/size-coarse.
|
|
63
|
-
'src/tokens/functional/size/size-fine.
|
|
61
|
+
'src/tokens/functional/size/size-coarse.json5',
|
|
62
|
+
'src/tokens/functional/size/size-fine.json5',
|
|
64
63
|
]),
|
|
65
64
|
options: Object.assign({ showFileHeader: false, descriptions: false }, options === null || options === void 0 ? void 0 : options.options),
|
|
66
65
|
},
|
|
@@ -77,8 +76,8 @@ export const css = (outputFile, prefix, buildPath, options) => {
|
|
|
77
76
|
format: `css/advanced`,
|
|
78
77
|
filter: token => isSource(token) &&
|
|
79
78
|
isFromFile(token, [
|
|
80
|
-
'src/tokens/functional/size/size-coarse.
|
|
81
|
-
'src/tokens/functional/size/size-fine.
|
|
79
|
+
'src/tokens/functional/size/size-coarse.json5',
|
|
80
|
+
'src/tokens/functional/size/size-fine.json5',
|
|
82
81
|
]),
|
|
83
82
|
options: {
|
|
84
83
|
descriptions: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import StyleDictionary from 'style-dictionary';
|
|
2
|
-
import { borderToCss, colorToRgbAlpha, colorToHex,
|
|
2
|
+
import { borderToCss, colorToRgbAlpha, colorToHex, colorToRgbaFloat, cubicBezierToCss, dimensionToRem, dimensionToPixelUnitless, durationToCss, figmaAttributes, fontFamilyToCss, fontFamilyToFigma, fontWeightToNumber, jsonDeprecated, namePathToDotNotation, namePathToCamelCase, namePathToPascalCase, namePathToKebabCase, namePathToSlashNotation, namePathToFigma, shadowToCss, typographyToCss, dimensionToRemPxArray, floatToPixel, floatToPixelUnitless, } from './transformers/index.js';
|
|
3
3
|
import { javascriptCommonJs, javascriptEsm, typescriptExportDefinition, jsonNestedPrefixed, cssCustomMedia, jsonOneDimensional, jsonPostCssFallback, cssAdvanced, jsonFigma, } from './formats/index.js';
|
|
4
4
|
import { themeOverrides } from './preprocessors/themeOverrides.js';
|
|
5
5
|
/**
|
|
@@ -8,7 +8,12 @@ import { themeOverrides } from './preprocessors/themeOverrides.js';
|
|
|
8
8
|
* @formats [javascript/esm](https://github.com/primer/primitives/blob/main/config/formats/javascript-esm.ts), [javascript/commonJs](https://github.com/primer/primitives/blob/main/config/formats/javascript-commonJs.ts), [typescript/export-definition](https://github.com/primer/primitives/blob/main/config/formats/typescript-export-defition.ts)
|
|
9
9
|
* @transformers [color/rgbAlpha](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-rgb-alpha.ts), [color/hexAlpha](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-hex-alpha.ts), [color/hex](https://github.com/primer/primitives/blob/main/config/tranformers/color-to-hex6.ts), [json/deprecated](https://github.com/primer/primitives/blob/main/config/tranformers/json-deprecated.ts), [name/pathToDotNotation](https://github.com/primer/primitives/blob/main/config/tranformers/name-path-to-dot-notation.ts)
|
|
10
10
|
*/
|
|
11
|
-
export const PrimerStyleDictionary = new StyleDictionary(
|
|
11
|
+
export const PrimerStyleDictionary = new StyleDictionary({
|
|
12
|
+
// these are the defaults
|
|
13
|
+
log: {
|
|
14
|
+
verbosity: 'default', // 'default' | 'silent' | 'verbose'
|
|
15
|
+
},
|
|
16
|
+
});
|
|
12
17
|
/**
|
|
13
18
|
* Formats
|
|
14
19
|
*
|
|
@@ -55,7 +60,6 @@ PrimerStyleDictionary.registerFormat({
|
|
|
55
60
|
*/
|
|
56
61
|
PrimerStyleDictionary.registerTransform(colorToRgbAlpha);
|
|
57
62
|
PrimerStyleDictionary.registerTransform(colorToRgbaFloat);
|
|
58
|
-
PrimerStyleDictionary.registerTransform(colorToHexMix);
|
|
59
63
|
PrimerStyleDictionary.registerTransform(colorToHex);
|
|
60
64
|
PrimerStyleDictionary.registerTransform(cubicBezierToCss);
|
|
61
65
|
PrimerStyleDictionary.registerTransform(floatToPixel);
|
|
@@ -6,16 +6,6 @@ export declare const colorToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
6
6
|
$value: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>]>;
|
|
7
7
|
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
8
8
|
alpha: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodAny, any, any>>>;
|
|
9
|
-
mix: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
10
|
-
color: z.ZodString;
|
|
11
|
-
weight: z.ZodNumber;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
color: string;
|
|
14
|
-
weight: number;
|
|
15
|
-
}, {
|
|
16
|
-
color: string;
|
|
17
|
-
weight: number;
|
|
18
|
-
}>>>;
|
|
19
9
|
$extensions: z.ZodOptional<z.ZodObject<{
|
|
20
10
|
alpha: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
21
11
|
'org.primer.figma': z.ZodOptional<z.ZodObject<{
|
|
@@ -109,10 +99,6 @@ export declare const colorToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
109
99
|
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
110
100
|
alpha?: any;
|
|
111
101
|
$description?: string | undefined;
|
|
112
|
-
mix?: {
|
|
113
|
-
color: string;
|
|
114
|
-
weight: number;
|
|
115
|
-
} | null | undefined;
|
|
116
102
|
$deprecated?: string | boolean | undefined;
|
|
117
103
|
$extensions?: {
|
|
118
104
|
alpha?: number | null | undefined;
|
|
@@ -139,10 +125,6 @@ export declare const colorToken: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
139
125
|
$type: "string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "dimension" | "duration" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange";
|
|
140
126
|
alpha?: any;
|
|
141
127
|
$description?: string | undefined;
|
|
142
|
-
mix?: {
|
|
143
|
-
color: string;
|
|
144
|
-
weight: number;
|
|
145
|
-
} | null | undefined;
|
|
146
128
|
$deprecated?: string | boolean | undefined;
|
|
147
129
|
$extensions?: {
|
|
148
130
|
alpha?: number | null | undefined;
|
|
@@ -11,13 +11,6 @@ export const colorToken = baseToken
|
|
|
11
11
|
$value: z.union([colorHexValue, referenceValue]),
|
|
12
12
|
$type: tokenType('color'),
|
|
13
13
|
alpha: alphaValue.optional().nullable(),
|
|
14
|
-
mix: z
|
|
15
|
-
.object({
|
|
16
|
-
color: z.string(),
|
|
17
|
-
weight: z.number().min(0).max(1),
|
|
18
|
-
})
|
|
19
|
-
.nullable()
|
|
20
|
-
.optional(),
|
|
21
14
|
$extensions: z
|
|
22
15
|
.object({
|
|
23
16
|
alpha: z.number().min(0).max(1).optional().nullable(),
|
|
@@ -32,7 +32,7 @@ export const borderToCss = {
|
|
|
32
32
|
if (!checkForBorderTokenProperties(value)) {
|
|
33
33
|
throw new Error(`Invalid border token property ${JSON.stringify(value)}. Must be an object with color, width and style properties.`);
|
|
34
34
|
}
|
|
35
|
-
/*
|
|
36
|
-
return `${value.
|
|
35
|
+
/* width | style | color */
|
|
36
|
+
return `${value.width} ${value.style} ${value.color}`;
|
|
37
37
|
},
|
|
38
38
|
};
|
|
@@ -2,25 +2,15 @@ import { toHex } from 'color2k';
|
|
|
2
2
|
import { isColor } from '../filters/index.js';
|
|
3
3
|
import { getTokenValue } from './utilities/getTokenValue.js';
|
|
4
4
|
import { rgbaFloatToHex } from './utilities/rgbaFloatToHex.js';
|
|
5
|
-
import mix from './utilities/mix.js';
|
|
6
5
|
import { hexToRgbaFloat } from './utilities/hexToRgbaFloat.js';
|
|
7
6
|
import { isRgbaFloat } from './utilities/isRgbaFloat.js';
|
|
8
7
|
const toRgbaFloat = (token, alpha = undefined) => {
|
|
9
|
-
var _a;
|
|
10
8
|
let tokenValue = getTokenValue(token);
|
|
11
|
-
let tokenMixColor = (_a = token.mix) === null || _a === void 0 ? void 0 : _a.color;
|
|
12
9
|
// get hex value from color string
|
|
13
10
|
if (isRgbaFloat(tokenValue)) {
|
|
14
11
|
tokenValue = rgbaFloatToHex(tokenValue, false);
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
tokenMixColor = rgbaFloatToHex(tokenMixColor, false);
|
|
18
|
-
}
|
|
19
|
-
let hex = toHex(tokenValue);
|
|
20
|
-
// mix color with mix color and weight
|
|
21
|
-
if (token.mix && token.mix.color && token.mix.weight) {
|
|
22
|
-
hex = toHex(mix(tokenValue, tokenMixColor, token.mix.weight));
|
|
23
|
-
}
|
|
13
|
+
const hex = toHex(tokenValue);
|
|
24
14
|
// return color as RgbaFloat
|
|
25
15
|
return hexToRgbaFloat(hex, alpha);
|
|
26
16
|
};
|
|
@@ -38,7 +28,7 @@ export const colorToRgbaFloat = {
|
|
|
38
28
|
transform: (token) => {
|
|
39
29
|
const value = getTokenValue(token);
|
|
40
30
|
// skip if value is already rgb float
|
|
41
|
-
if (isRgbaFloat(value) && !('
|
|
31
|
+
if (isRgbaFloat(value) && !('alpha' in token))
|
|
42
32
|
return value;
|
|
43
33
|
// convert hex or rgb values to rgba float
|
|
44
34
|
return toRgbaFloat(token, token.alpha);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { borderToCss } from './borderToCss.js';
|
|
2
2
|
export { colorToHex } from './colorToHex.js';
|
|
3
|
-
export { colorToHexMix } from './colorToHexMix.js';
|
|
4
3
|
export { colorToRgbAlpha } from './colorToRgbAlpha.js';
|
|
5
4
|
export { colorToRgbaFloat } from './colorToRgbaFloat.js';
|
|
6
5
|
export { cubicBezierToCss } from './cubicBezierToCss.js';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { borderToCss } from './borderToCss.js';
|
|
2
2
|
export { colorToHex } from './colorToHex.js';
|
|
3
|
-
export { colorToHexMix } from './colorToHexMix.js';
|
|
4
3
|
export { colorToRgbAlpha } from './colorToRgbAlpha.js';
|
|
5
4
|
export { colorToRgbaFloat } from './colorToRgbaFloat.js';
|
|
6
5
|
export { cubicBezierToCss } from './cubicBezierToCss.js';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--boxShadow-thin: inset 0 0 0
|
|
3
|
-
--boxShadow-thick: inset 0 0 0
|
|
4
|
-
--boxShadow-thicker: inset 0 0 0
|
|
5
|
-
--borderWidth-
|
|
6
|
-
--borderWidth-
|
|
7
|
-
--borderWidth-
|
|
2
|
+
--boxShadow-thin: inset 0 0 0 0.0625rem; /* Thin shadow for borders */
|
|
3
|
+
--boxShadow-thick: inset 0 0 0 0.125rem;
|
|
4
|
+
--boxShadow-thicker: inset 0 0 0 0.25rem;
|
|
5
|
+
--borderWidth-default: 0.0625rem;
|
|
6
|
+
--borderWidth-thin: 0.0625rem;
|
|
7
|
+
--borderWidth-thick: 0.125rem;
|
|
8
|
+
--borderWidth-thicker: 0.25rem;
|
|
8
9
|
--borderRadius-small: 0.1875rem;
|
|
9
10
|
--borderRadius-medium: 0.375rem;
|
|
10
11
|
--borderRadius-large: 0.75rem;
|
|
@@ -259,10 +259,10 @@
|
|
|
259
259
|
--button-invisible-bgColor-rest: #00000000;
|
|
260
260
|
--button-invisible-bgColor-hover: #656c7633;
|
|
261
261
|
--button-invisible-bgColor-active: #656c7640;
|
|
262
|
-
--button-invisible-bgColor-disabled: #
|
|
262
|
+
--button-invisible-bgColor-disabled: #00000000;
|
|
263
263
|
--button-invisible-borderColor-rest: #00000000;
|
|
264
264
|
--button-invisible-borderColor-hover: #00000000;
|
|
265
|
-
--button-invisible-borderColor-disabled: #
|
|
265
|
+
--button-invisible-borderColor-disabled: #00000000;
|
|
266
266
|
--button-outline-fgColor-rest: #388bfd;
|
|
267
267
|
--button-outline-fgColor-hover: #58a6ff;
|
|
268
268
|
--button-outline-fgColor-active: #ffffff;
|
|
@@ -311,6 +311,7 @@
|
|
|
311
311
|
--reactionButton-selected-fgColor-rest: #4493f8;
|
|
312
312
|
--reactionButton-selected-fgColor-hover: #79c0ff;
|
|
313
313
|
--focus-outlineColor: #1f6feb;
|
|
314
|
+
--focus-outline: 2px solid #1f6feb;
|
|
314
315
|
--menu-bgColor-active: #151b23;
|
|
315
316
|
--overlay-bgColor: #151b23;
|
|
316
317
|
--overlay-borderColor: #3d444db3;
|
|
@@ -576,7 +577,33 @@
|
|
|
576
577
|
--shadow-floating-large: 0px 0px 0px 1px #3d444d, 0px 24px 48px 0px #010409;
|
|
577
578
|
--shadow-floating-xlarge: 0px 0px 0px 1px #3d444d, 0px 32px 64px 0px #010409;
|
|
578
579
|
--shadow-floating-legacy: 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966;
|
|
579
|
-
--
|
|
580
|
+
--border-default: 0.0625rem solid #3d444d;
|
|
581
|
+
--border-muted: 0.0625rem solid #3d444db3;
|
|
582
|
+
--border-emphasis: 0.0625rem solid #656c76;
|
|
583
|
+
--border-disabled: 0.0625rem solid #656c761a;
|
|
584
|
+
--border-transparent: 0.0625rem solid #00000000;
|
|
585
|
+
--border-neutral-emphasis: 0.0625rem solid #656c76;
|
|
586
|
+
--border-neutral-muted: 0.0625rem solid #3d444db3;
|
|
587
|
+
--border-accent-emphasis: 0.0625rem solid #1f6feb;
|
|
588
|
+
--border-accent-muted: 0.0625rem solid #388bfd66;
|
|
589
|
+
--border-success-emphasis: 0.0625rem solid #1f6feb;
|
|
590
|
+
--border-success-muted: 0.0625rem solid #388bfd66;
|
|
591
|
+
--border-open-emphasis: 0.0625rem solid #1f6feb;
|
|
592
|
+
--border-open-muted: 0.0625rem solid #388bfd66;
|
|
593
|
+
--border-danger-emphasis: 0.0625rem solid #bd561d;
|
|
594
|
+
--border-danger-muted: 0.0625rem solid #db6d2866;
|
|
595
|
+
--border-closed-emphasis: 0.0625rem solid #bd561d;
|
|
596
|
+
--border-closed-muted: 0.0625rem solid #db6d2866;
|
|
597
|
+
--border-attention-emphasis: 0.0625rem solid #9e6a03;
|
|
598
|
+
--border-attention-muted: 0.0625rem solid #bb800966;
|
|
599
|
+
--border-severe-emphasis: 0.0625rem solid #bd561d;
|
|
600
|
+
--border-severe-muted: 0.0625rem solid #db6d2866;
|
|
601
|
+
--border-done-emphasis: 0.0625rem solid #8957e5;
|
|
602
|
+
--border-done-muted: 0.0625rem solid #ab7df866;
|
|
603
|
+
--border-upsell-emphasis: 0.0625rem solid #8957e5;
|
|
604
|
+
--border-upsell-muted: 0.0625rem solid #ab7df866;
|
|
605
|
+
--border-sponsors-emphasis: 0.0625rem solid #bf4b8a;
|
|
606
|
+
--border-sponsors-muted: 0.0625rem solid #db61a266;
|
|
580
607
|
}
|
|
581
608
|
@media (prefers-color-scheme: dark) {
|
|
582
609
|
[data-color-mode="auto"][data-dark-theme="dark_colorblind"],
|
|
@@ -838,10 +865,10 @@
|
|
|
838
865
|
--button-invisible-bgColor-rest: #00000000;
|
|
839
866
|
--button-invisible-bgColor-hover: #656c7633;
|
|
840
867
|
--button-invisible-bgColor-active: #656c7640;
|
|
841
|
-
--button-invisible-bgColor-disabled: #
|
|
868
|
+
--button-invisible-bgColor-disabled: #00000000;
|
|
842
869
|
--button-invisible-borderColor-rest: #00000000;
|
|
843
870
|
--button-invisible-borderColor-hover: #00000000;
|
|
844
|
-
--button-invisible-borderColor-disabled: #
|
|
871
|
+
--button-invisible-borderColor-disabled: #00000000;
|
|
845
872
|
--button-outline-fgColor-rest: #388bfd;
|
|
846
873
|
--button-outline-fgColor-hover: #58a6ff;
|
|
847
874
|
--button-outline-fgColor-active: #ffffff;
|
|
@@ -890,6 +917,7 @@
|
|
|
890
917
|
--reactionButton-selected-fgColor-rest: #4493f8;
|
|
891
918
|
--reactionButton-selected-fgColor-hover: #79c0ff;
|
|
892
919
|
--focus-outlineColor: #1f6feb;
|
|
920
|
+
--focus-outline: 2px solid #1f6feb;
|
|
893
921
|
--menu-bgColor-active: #151b23;
|
|
894
922
|
--overlay-bgColor: #151b23;
|
|
895
923
|
--overlay-borderColor: #3d444db3;
|
|
@@ -1155,6 +1183,32 @@
|
|
|
1155
1183
|
--shadow-floating-large: 0px 0px 0px 1px #3d444d, 0px 24px 48px 0px #010409;
|
|
1156
1184
|
--shadow-floating-xlarge: 0px 0px 0px 1px #3d444d, 0px 32px 64px 0px #010409;
|
|
1157
1185
|
--shadow-floating-legacy: 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966;
|
|
1158
|
-
--
|
|
1186
|
+
--border-default: 0.0625rem solid #3d444d;
|
|
1187
|
+
--border-muted: 0.0625rem solid #3d444db3;
|
|
1188
|
+
--border-emphasis: 0.0625rem solid #656c76;
|
|
1189
|
+
--border-disabled: 0.0625rem solid #656c761a;
|
|
1190
|
+
--border-transparent: 0.0625rem solid #00000000;
|
|
1191
|
+
--border-neutral-emphasis: 0.0625rem solid #656c76;
|
|
1192
|
+
--border-neutral-muted: 0.0625rem solid #3d444db3;
|
|
1193
|
+
--border-accent-emphasis: 0.0625rem solid #1f6feb;
|
|
1194
|
+
--border-accent-muted: 0.0625rem solid #388bfd66;
|
|
1195
|
+
--border-success-emphasis: 0.0625rem solid #1f6feb;
|
|
1196
|
+
--border-success-muted: 0.0625rem solid #388bfd66;
|
|
1197
|
+
--border-open-emphasis: 0.0625rem solid #1f6feb;
|
|
1198
|
+
--border-open-muted: 0.0625rem solid #388bfd66;
|
|
1199
|
+
--border-danger-emphasis: 0.0625rem solid #bd561d;
|
|
1200
|
+
--border-danger-muted: 0.0625rem solid #db6d2866;
|
|
1201
|
+
--border-closed-emphasis: 0.0625rem solid #bd561d;
|
|
1202
|
+
--border-closed-muted: 0.0625rem solid #db6d2866;
|
|
1203
|
+
--border-attention-emphasis: 0.0625rem solid #9e6a03;
|
|
1204
|
+
--border-attention-muted: 0.0625rem solid #bb800966;
|
|
1205
|
+
--border-severe-emphasis: 0.0625rem solid #bd561d;
|
|
1206
|
+
--border-severe-muted: 0.0625rem solid #db6d2866;
|
|
1207
|
+
--border-done-emphasis: 0.0625rem solid #8957e5;
|
|
1208
|
+
--border-done-muted: 0.0625rem solid #ab7df866;
|
|
1209
|
+
--border-upsell-emphasis: 0.0625rem solid #8957e5;
|
|
1210
|
+
--border-upsell-muted: 0.0625rem solid #ab7df866;
|
|
1211
|
+
--border-sponsors-emphasis: 0.0625rem solid #bf4b8a;
|
|
1212
|
+
--border-sponsors-muted: 0.0625rem solid #db61a266;
|
|
1159
1213
|
}
|
|
1160
1214
|
}
|
|
@@ -259,10 +259,10 @@
|
|
|
259
259
|
--button-invisible-bgColor-rest: #00000000;
|
|
260
260
|
--button-invisible-bgColor-hover: #656c7626;
|
|
261
261
|
--button-invisible-bgColor-active: #656c7633;
|
|
262
|
-
--button-invisible-bgColor-disabled: #
|
|
262
|
+
--button-invisible-bgColor-disabled: #00000000;
|
|
263
263
|
--button-invisible-borderColor-rest: #00000000;
|
|
264
264
|
--button-invisible-borderColor-hover: #00000000;
|
|
265
|
-
--button-invisible-borderColor-disabled: #
|
|
265
|
+
--button-invisible-borderColor-disabled: #00000000;
|
|
266
266
|
--button-outline-fgColor-rest: #4184e4;
|
|
267
267
|
--button-outline-fgColor-hover: #539bf5;
|
|
268
268
|
--button-outline-fgColor-active: #cdd9e5;
|
|
@@ -311,6 +311,7 @@
|
|
|
311
311
|
--reactionButton-selected-fgColor-rest: #478be6;
|
|
312
312
|
--reactionButton-selected-fgColor-hover: #6cb6ff;
|
|
313
313
|
--focus-outlineColor: #316dca;
|
|
314
|
+
--focus-outline: 2px solid #316dca;
|
|
314
315
|
--menu-bgColor-active: #151b23;
|
|
315
316
|
--overlay-bgColor: #2a313c;
|
|
316
317
|
--overlay-borderColor: #3d444db3;
|
|
@@ -576,7 +577,33 @@
|
|
|
576
577
|
--shadow-floating-large: 0px 0px 0px 1px #3d444d, 0px 24px 48px 0px #1c2128;
|
|
577
578
|
--shadow-floating-xlarge: 0px 0px 0px 1px #3d444d, 0px 32px 64px 0px #1c2128;
|
|
578
579
|
--shadow-floating-legacy: 0px 6px 12px -3px #1c212866, 0px 6px 18px 0px #1c212866;
|
|
579
|
-
--
|
|
580
|
+
--border-default: 0.0625rem solid #3d444d;
|
|
581
|
+
--border-muted: 0.0625rem solid #3d444db3;
|
|
582
|
+
--border-emphasis: 0.0625rem solid #656c76;
|
|
583
|
+
--border-disabled: 0.0625rem solid #656c761a;
|
|
584
|
+
--border-transparent: 0.0625rem solid #00000000;
|
|
585
|
+
--border-neutral-emphasis: 0.0625rem solid #656c76;
|
|
586
|
+
--border-neutral-muted: 0.0625rem solid #3d444db3;
|
|
587
|
+
--border-accent-emphasis: 0.0625rem solid #316dca;
|
|
588
|
+
--border-accent-muted: 0.0625rem solid #4184e466;
|
|
589
|
+
--border-success-emphasis: 0.0625rem solid #347d39;
|
|
590
|
+
--border-success-muted: 0.0625rem solid #46954a66;
|
|
591
|
+
--border-open-emphasis: 0.0625rem solid #347d39;
|
|
592
|
+
--border-open-muted: 0.0625rem solid #46954a66;
|
|
593
|
+
--border-danger-emphasis: 0.0625rem solid #c93c37;
|
|
594
|
+
--border-danger-muted: 0.0625rem solid #e5534b66;
|
|
595
|
+
--border-closed-emphasis: 0.0625rem solid #c93c37;
|
|
596
|
+
--border-closed-muted: 0.0625rem solid #e5534b66;
|
|
597
|
+
--border-attention-emphasis: 0.0625rem solid #966600;
|
|
598
|
+
--border-attention-muted: 0.0625rem solid #ae7c1466;
|
|
599
|
+
--border-severe-emphasis: 0.0625rem solid #ae5622;
|
|
600
|
+
--border-severe-muted: 0.0625rem solid #cc6b2c66;
|
|
601
|
+
--border-done-emphasis: 0.0625rem solid #8256d0;
|
|
602
|
+
--border-done-muted: 0.0625rem solid #986ee266;
|
|
603
|
+
--border-upsell-emphasis: 0.0625rem solid #8256d0;
|
|
604
|
+
--border-upsell-muted: 0.0625rem solid #986ee266;
|
|
605
|
+
--border-sponsors-emphasis: 0.0625rem solid #ae4c82;
|
|
606
|
+
--border-sponsors-muted: 0.0625rem solid #c9619866;
|
|
580
607
|
}
|
|
581
608
|
@media (prefers-color-scheme: dark) {
|
|
582
609
|
[data-color-mode="auto"][data-dark-theme="dark_dimmed"],
|
|
@@ -838,10 +865,10 @@
|
|
|
838
865
|
--button-invisible-bgColor-rest: #00000000;
|
|
839
866
|
--button-invisible-bgColor-hover: #656c7626;
|
|
840
867
|
--button-invisible-bgColor-active: #656c7633;
|
|
841
|
-
--button-invisible-bgColor-disabled: #
|
|
868
|
+
--button-invisible-bgColor-disabled: #00000000;
|
|
842
869
|
--button-invisible-borderColor-rest: #00000000;
|
|
843
870
|
--button-invisible-borderColor-hover: #00000000;
|
|
844
|
-
--button-invisible-borderColor-disabled: #
|
|
871
|
+
--button-invisible-borderColor-disabled: #00000000;
|
|
845
872
|
--button-outline-fgColor-rest: #4184e4;
|
|
846
873
|
--button-outline-fgColor-hover: #539bf5;
|
|
847
874
|
--button-outline-fgColor-active: #cdd9e5;
|
|
@@ -890,6 +917,7 @@
|
|
|
890
917
|
--reactionButton-selected-fgColor-rest: #478be6;
|
|
891
918
|
--reactionButton-selected-fgColor-hover: #6cb6ff;
|
|
892
919
|
--focus-outlineColor: #316dca;
|
|
920
|
+
--focus-outline: 2px solid #316dca;
|
|
893
921
|
--menu-bgColor-active: #151b23;
|
|
894
922
|
--overlay-bgColor: #2a313c;
|
|
895
923
|
--overlay-borderColor: #3d444db3;
|
|
@@ -1155,6 +1183,32 @@
|
|
|
1155
1183
|
--shadow-floating-large: 0px 0px 0px 1px #3d444d, 0px 24px 48px 0px #1c2128;
|
|
1156
1184
|
--shadow-floating-xlarge: 0px 0px 0px 1px #3d444d, 0px 32px 64px 0px #1c2128;
|
|
1157
1185
|
--shadow-floating-legacy: 0px 6px 12px -3px #1c212866, 0px 6px 18px 0px #1c212866;
|
|
1158
|
-
--
|
|
1186
|
+
--border-default: 0.0625rem solid #3d444d;
|
|
1187
|
+
--border-muted: 0.0625rem solid #3d444db3;
|
|
1188
|
+
--border-emphasis: 0.0625rem solid #656c76;
|
|
1189
|
+
--border-disabled: 0.0625rem solid #656c761a;
|
|
1190
|
+
--border-transparent: 0.0625rem solid #00000000;
|
|
1191
|
+
--border-neutral-emphasis: 0.0625rem solid #656c76;
|
|
1192
|
+
--border-neutral-muted: 0.0625rem solid #3d444db3;
|
|
1193
|
+
--border-accent-emphasis: 0.0625rem solid #316dca;
|
|
1194
|
+
--border-accent-muted: 0.0625rem solid #4184e466;
|
|
1195
|
+
--border-success-emphasis: 0.0625rem solid #347d39;
|
|
1196
|
+
--border-success-muted: 0.0625rem solid #46954a66;
|
|
1197
|
+
--border-open-emphasis: 0.0625rem solid #347d39;
|
|
1198
|
+
--border-open-muted: 0.0625rem solid #46954a66;
|
|
1199
|
+
--border-danger-emphasis: 0.0625rem solid #c93c37;
|
|
1200
|
+
--border-danger-muted: 0.0625rem solid #e5534b66;
|
|
1201
|
+
--border-closed-emphasis: 0.0625rem solid #c93c37;
|
|
1202
|
+
--border-closed-muted: 0.0625rem solid #e5534b66;
|
|
1203
|
+
--border-attention-emphasis: 0.0625rem solid #966600;
|
|
1204
|
+
--border-attention-muted: 0.0625rem solid #ae7c1466;
|
|
1205
|
+
--border-severe-emphasis: 0.0625rem solid #ae5622;
|
|
1206
|
+
--border-severe-muted: 0.0625rem solid #cc6b2c66;
|
|
1207
|
+
--border-done-emphasis: 0.0625rem solid #8256d0;
|
|
1208
|
+
--border-done-muted: 0.0625rem solid #986ee266;
|
|
1209
|
+
--border-upsell-emphasis: 0.0625rem solid #8256d0;
|
|
1210
|
+
--border-upsell-muted: 0.0625rem solid #986ee266;
|
|
1211
|
+
--border-sponsors-emphasis: 0.0625rem solid #ae4c82;
|
|
1212
|
+
--border-sponsors-muted: 0.0625rem solid #c9619866;
|
|
1159
1213
|
}
|
|
1160
1214
|
}
|