@primer/primitives 11.4.0 → 11.4.1-rc.4e2d1de5
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/DESIGN_TOKENS_GUIDE.md +185 -0
- package/DESIGN_TOKENS_SPEC.md +565 -0
- package/dist/build/formats/markdownLlmGuidelines.d.ts +7 -6
- package/dist/build/formats/markdownLlmGuidelines.js +1034 -60
- package/dist/build/schemas/borderToken.d.ts +16 -2
- package/dist/build/schemas/dimensionToken.d.ts +8 -1
- package/dist/build/schemas/dimensionValue.d.ts +24 -1
- package/dist/build/schemas/dimensionValue.js +20 -1
- package/dist/build/schemas/durationToken.d.ts +7 -1
- package/dist/build/schemas/durationValue.d.ts +11 -1
- package/dist/build/schemas/durationValue.js +13 -3
- package/dist/build/schemas/shadowToken.d.ts +672 -84
- package/dist/build/schemas/transitionToken.d.ts +14 -2
- package/dist/build/schemas/typographyToken.d.ts +32 -4
- package/dist/build/transformers/dimensionToPixelUnitless.d.ts +3 -2
- package/dist/build/transformers/dimensionToPixelUnitless.js +22 -26
- package/dist/build/transformers/dimensionToRem.d.ts +2 -1
- package/dist/build/transformers/dimensionToRem.js +21 -22
- package/dist/build/transformers/dimensionToRemPxArray.d.ts +2 -1
- package/dist/build/transformers/dimensionToRemPxArray.js +21 -22
- package/dist/build/transformers/durationToCss.d.ts +2 -1
- package/dist/build/transformers/durationToCss.js +18 -11
- package/dist/build/transformers/utilities/parseDimension.d.ts +12 -0
- package/dist/build/transformers/utilities/parseDimension.js +31 -0
- package/dist/build/types/dimensionTokenValue.d.ts +9 -0
- package/dist/css/functional/themes/dark-colorblind-high-contrast.css +18 -14
- package/dist/css/functional/themes/dark-colorblind.css +18 -14
- package/dist/css/functional/themes/dark-dimmed-high-contrast.css +18 -14
- package/dist/css/functional/themes/dark-dimmed.css +18 -14
- package/dist/css/functional/themes/dark-high-contrast.css +18 -14
- package/dist/css/functional/themes/dark-tritanopia-high-contrast.css +18 -14
- package/dist/css/functional/themes/dark-tritanopia.css +18 -14
- package/dist/css/functional/themes/dark.css +18 -14
- package/dist/css/functional/themes/light-colorblind-high-contrast.css +18 -14
- package/dist/css/functional/themes/light-colorblind.css +18 -14
- package/dist/css/functional/themes/light-high-contrast.css +18 -14
- package/dist/css/functional/themes/light-tritanopia-high-contrast.css +18 -14
- package/dist/css/functional/themes/light-tritanopia.css +18 -14
- package/dist/css/functional/themes/light.css +18 -14
- package/dist/css/primitives.css +4 -0
- package/dist/docs/base/motion/motion.json +96 -24
- package/dist/docs/base/size/size.json +76 -19
- package/dist/docs/base/typography/typography.json +24 -6
- package/dist/docs/functional/size/border.json +20 -5
- package/dist/docs/functional/size/breakpoints.json +24 -6
- package/dist/docs/functional/size/radius.json +16 -4
- package/dist/docs/functional/size/size.json +60 -15
- package/dist/docs/functional/themes/dark-colorblind-high-contrast.json +109 -7
- package/dist/docs/functional/themes/dark-colorblind.json +109 -7
- package/dist/docs/functional/themes/dark-dimmed-high-contrast.json +109 -7
- package/dist/docs/functional/themes/dark-dimmed.json +109 -7
- package/dist/docs/functional/themes/dark-high-contrast.json +109 -7
- package/dist/docs/functional/themes/dark-tritanopia-high-contrast.json +109 -7
- package/dist/docs/functional/themes/dark-tritanopia.json +109 -7
- package/dist/docs/functional/themes/dark.json +109 -7
- package/dist/docs/functional/themes/light-colorblind-high-contrast.json +115 -13
- package/dist/docs/functional/themes/light-colorblind.json +115 -13
- package/dist/docs/functional/themes/light-high-contrast.json +115 -13
- package/dist/docs/functional/themes/light-tritanopia-high-contrast.json +115 -13
- package/dist/docs/functional/themes/light-tritanopia.json +115 -13
- package/dist/docs/functional/themes/light.json +115 -13
- package/dist/docs/functional/typography/typography.json +8 -2
- package/dist/fallbacks/base/motion/motion.json +48 -12
- package/dist/figma/themes/light-colorblind.json +4 -4
- package/dist/figma/themes/light-high-contrast.json +4 -4
- package/dist/figma/themes/light-tritanopia.json +4 -4
- package/dist/figma/themes/light.json +4 -4
- package/dist/internalCss/dark-colorblind-high-contrast.css +14 -14
- package/dist/internalCss/dark-colorblind.css +14 -14
- package/dist/internalCss/dark-dimmed-high-contrast.css +14 -14
- package/dist/internalCss/dark-dimmed.css +14 -14
- package/dist/internalCss/dark-high-contrast.css +14 -14
- package/dist/internalCss/dark-tritanopia-high-contrast.css +14 -14
- package/dist/internalCss/dark-tritanopia.css +14 -14
- package/dist/internalCss/dark.css +14 -14
- package/dist/internalCss/light-colorblind-high-contrast.css +14 -14
- package/dist/internalCss/light-colorblind.css +14 -14
- package/dist/internalCss/light-high-contrast.css +14 -14
- package/dist/internalCss/light-tritanopia-high-contrast.css +14 -14
- package/dist/internalCss/light-tritanopia.css +14 -14
- package/dist/internalCss/light.css +14 -14
- package/dist/styleLint/base/motion/motion.json +96 -24
- package/dist/styleLint/base/size/size.json +76 -19
- package/dist/styleLint/base/typography/typography.json +30 -12
- package/dist/styleLint/functional/size/border.json +21 -6
- package/dist/styleLint/functional/size/breakpoints.json +24 -6
- package/dist/styleLint/functional/size/radius.json +17 -5
- 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 +111 -66
- package/dist/styleLint/functional/themes/dark-colorblind-high-contrast.json +129 -27
- package/dist/styleLint/functional/themes/dark-colorblind.json +129 -27
- package/dist/styleLint/functional/themes/dark-dimmed-high-contrast.json +129 -27
- package/dist/styleLint/functional/themes/dark-dimmed.json +129 -27
- package/dist/styleLint/functional/themes/dark-high-contrast.json +129 -27
- package/dist/styleLint/functional/themes/dark-tritanopia-high-contrast.json +129 -27
- package/dist/styleLint/functional/themes/dark-tritanopia.json +129 -27
- package/dist/styleLint/functional/themes/dark.json +129 -27
- package/dist/styleLint/functional/themes/light-colorblind-high-contrast.json +135 -33
- package/dist/styleLint/functional/themes/light-colorblind.json +135 -33
- package/dist/styleLint/functional/themes/light-high-contrast.json +135 -33
- package/dist/styleLint/functional/themes/light-tritanopia-high-contrast.json +135 -33
- package/dist/styleLint/functional/themes/light-tritanopia.json +135 -33
- package/dist/styleLint/functional/themes/light.json +135 -33
- package/dist/styleLint/functional/typography/typography.json +28 -22
- package/package.json +6 -5
- package/src/tokens/base/motion/timing.json5 +12 -12
- package/src/tokens/base/size/size.json5 +19 -19
- package/src/tokens/base/typography/typography.json5 +6 -6
- package/src/tokens/functional/color/bgColor.json5 +8 -0
- package/src/tokens/functional/color/display.json5 +7 -0
- package/src/tokens/functional/color/fgColor.json5 +8 -0
- package/src/tokens/functional/color/syntax.json5 +14 -0
- package/src/tokens/functional/shadow/shadow.json5 +39 -4
- package/src/tokens/functional/size/border.json5 +5 -5
- package/src/tokens/functional/size/breakpoints.json5 +6 -6
- package/src/tokens/functional/size/radius.json5 +4 -4
- package/src/tokens/functional/size/size.json5 +15 -15
- package/src/tokens/functional/typography/typography.json5 +8 -4
- package/dist/build/parsers/index.d.ts +0 -1
- package/dist/build/parsers/index.js +0 -1
- package/dist/build/parsers/w3cJsonParser.d.ts +0 -6
- package/dist/build/parsers/w3cJsonParser.js +0 -25
- package/dist/removed/testing.json5 +0 -4
- package/guidelines/color.llm.md +0 -16
- package/guidelines/guidelines.llm.md +0 -34
- package/guidelines/motion.llm.md +0 -41
- package/guidelines/spacing.llm.md +0 -20
- package/guidelines/typography.llm.md +0 -14
- package/src/tokens/removed/testing.json5 +0 -4
- package/token-guidelines.llm.md +0 -695
|
@@ -3,9 +3,21 @@ export declare const transitionToken: z.ZodObject<{
|
|
|
3
3
|
$description: z.ZodOptional<z.ZodString>;
|
|
4
4
|
$deprecated: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
5
5
|
$value: z.ZodUnion<readonly [z.ZodObject<{
|
|
6
|
-
duration: z.ZodUnion<readonly [z.ZodUnion<readonly [z.
|
|
6
|
+
duration: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
7
|
+
value: z.ZodNumber;
|
|
8
|
+
unit: z.ZodEnum<{
|
|
9
|
+
s: "s";
|
|
10
|
+
ms: "ms";
|
|
11
|
+
}>;
|
|
12
|
+
}, z.core.$strict>, z.ZodString]>, z.ZodString]>;
|
|
7
13
|
timingFunction: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodString]>, z.ZodString]>;
|
|
8
|
-
delay: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.
|
|
14
|
+
delay: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
15
|
+
value: z.ZodNumber;
|
|
16
|
+
unit: z.ZodEnum<{
|
|
17
|
+
s: "s";
|
|
18
|
+
ms: "ms";
|
|
19
|
+
}>;
|
|
20
|
+
}, z.core.$strict>, z.ZodString]>, z.ZodString]>>;
|
|
9
21
|
}, z.core.$strip>, z.ZodString]>;
|
|
10
22
|
$type: z.ZodLiteral<"string" | "number" | "border" | "color" | "fontFamily" | "fontWeight" | "transition" | "dimension" | "duration" | "gradient" | "shadow" | "typography" | "cubicBezier" | "custom-viewportRange">;
|
|
11
23
|
$extensions: z.ZodOptional<z.ZodObject<{
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const typographyValue: z.ZodObject<{
|
|
3
|
-
fontSize: z.ZodUnion<readonly [z.ZodUnion<readonly [z.
|
|
4
|
-
|
|
3
|
+
fontSize: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
4
|
+
value: z.ZodNumber;
|
|
5
|
+
unit: z.ZodEnum<{
|
|
6
|
+
em: "em";
|
|
7
|
+
px: "px";
|
|
8
|
+
rem: "rem";
|
|
9
|
+
}>;
|
|
10
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"0">, z.ZodLiteral<0>]>]>, z.ZodString]>;
|
|
11
|
+
lineHeight: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
12
|
+
value: z.ZodNumber;
|
|
13
|
+
unit: z.ZodEnum<{
|
|
14
|
+
em: "em";
|
|
15
|
+
px: "px";
|
|
16
|
+
rem: "rem";
|
|
17
|
+
}>;
|
|
18
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"0">, z.ZodLiteral<0>]>]>, z.ZodString]>>;
|
|
5
19
|
fontWeight: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
6
20
|
fontFamily: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
7
21
|
}, z.core.$strip>;
|
|
@@ -9,8 +23,22 @@ export declare const typographyToken: z.ZodObject<{
|
|
|
9
23
|
$description: z.ZodOptional<z.ZodString>;
|
|
10
24
|
$deprecated: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
|
|
11
25
|
$value: z.ZodUnion<readonly [z.ZodObject<{
|
|
12
|
-
fontSize: z.ZodUnion<readonly [z.ZodUnion<readonly [z.
|
|
13
|
-
|
|
26
|
+
fontSize: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
27
|
+
value: z.ZodNumber;
|
|
28
|
+
unit: z.ZodEnum<{
|
|
29
|
+
em: "em";
|
|
30
|
+
px: "px";
|
|
31
|
+
rem: "rem";
|
|
32
|
+
}>;
|
|
33
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"0">, z.ZodLiteral<0>]>]>, z.ZodString]>;
|
|
34
|
+
lineHeight: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
35
|
+
value: z.ZodNumber;
|
|
36
|
+
unit: z.ZodEnum<{
|
|
37
|
+
em: "em";
|
|
38
|
+
px: "px";
|
|
39
|
+
rem: "rem";
|
|
40
|
+
}>;
|
|
41
|
+
}, z.core.$strict>, z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"0">, z.ZodLiteral<0>]>]>, z.ZodString]>>;
|
|
14
42
|
fontWeight: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
15
43
|
fontFamily: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
|
|
16
44
|
}, z.core.$strip>, z.ZodString]>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Transform } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
|
-
* @description converts dimension tokens value to pixel value without unit
|
|
3
|
+
* @description converts dimension tokens value to pixel value without unit
|
|
4
4
|
* @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
|
|
5
5
|
* @matcher matches all tokens of $type `dimension`
|
|
6
|
-
* @transformer returns a
|
|
6
|
+
* @transformer returns a number for px/rem values, or a string with unit for em values (cannot convert to unitless)
|
|
7
|
+
* @note Expects W3C DTCG format { value: number, unit: "px" | "rem" | "em" }
|
|
7
8
|
*/
|
|
8
9
|
export declare const dimensionToPixelUnitless: Transform;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isDimension } from '../filters/index.js';
|
|
2
|
+
import { parseDimension } from './utilities/parseDimension.js';
|
|
2
3
|
/**
|
|
3
4
|
* @description base font size from options or 16
|
|
4
5
|
* @param options
|
|
@@ -6,22 +7,11 @@ import { isDimension } from '../filters/index.js';
|
|
|
6
7
|
*/
|
|
7
8
|
const getBasePxFontSize = (options) => (options && options.basePxFontSize) || 16;
|
|
8
9
|
/**
|
|
9
|
-
* @description
|
|
10
|
-
* @param value token value
|
|
11
|
-
* @param unit unit string like px or value
|
|
12
|
-
* @returns boolean
|
|
13
|
-
*/
|
|
14
|
-
const hasUnit = (value, unit) => {
|
|
15
|
-
if (typeof value === 'number') {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
return value.indexOf(unit) > -1;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* @description converts dimension tokens value to pixel value without unit, ignores `em` as they are relative to the font size of the parent element
|
|
10
|
+
* @description converts dimension tokens value to pixel value without unit
|
|
22
11
|
* @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
|
|
23
12
|
* @matcher matches all tokens of $type `dimension`
|
|
24
|
-
* @transformer returns a
|
|
13
|
+
* @transformer returns a number for px/rem values, or a string with unit for em values (cannot convert to unitless)
|
|
14
|
+
* @note Expects W3C DTCG format { value: number, unit: "px" | "rem" | "em" }
|
|
25
15
|
*/
|
|
26
16
|
export const dimensionToPixelUnitless = {
|
|
27
17
|
name: 'dimension/pixelUnitless',
|
|
@@ -31,19 +21,25 @@ export const dimensionToPixelUnitless = {
|
|
|
31
21
|
transform: (token, config, options) => {
|
|
32
22
|
const valueProp = options.usesDtcg ? '$value' : 'value';
|
|
33
23
|
const baseFont = getBasePxFontSize(config);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
24
|
+
try {
|
|
25
|
+
const { value, unit } = parseDimension(token[valueProp]);
|
|
26
|
+
if (value === 0) {
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
// rem values convert to px
|
|
30
|
+
if (unit === 'rem') {
|
|
31
|
+
return value * baseFont;
|
|
32
|
+
}
|
|
33
|
+
// em values pass through as string (relative to parent, cannot convert to unitless px)
|
|
34
|
+
if (unit === 'em') {
|
|
35
|
+
return `${value}em`;
|
|
36
|
+
}
|
|
37
|
+
// px values return the number directly
|
|
38
|
+
return value;
|
|
43
39
|
}
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
catch (error) {
|
|
41
|
+
const originalMessage = error instanceof Error ? error.message : String(error);
|
|
42
|
+
throw new Error(`Invalid dimension token: '${token.path.join('.')}: ${JSON.stringify(token[valueProp])}' - ${originalMessage}\n`);
|
|
46
43
|
}
|
|
47
|
-
return token[valueProp];
|
|
48
44
|
},
|
|
49
45
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Transform } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
|
-
* @description converts dimension tokens value to `rem
|
|
3
|
+
* @description converts dimension tokens value to `rem`
|
|
4
4
|
* @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
|
|
5
5
|
* @matcher matches all tokens of $type `dimension`
|
|
6
6
|
* @transformer returns a `rem` string
|
|
7
|
+
* @note Expects W3C DTCG format { value: number, unit: "px" | "rem" | "em" }
|
|
7
8
|
*/
|
|
8
9
|
export declare const dimensionToRem: Transform;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isDimension } from '../filters/index.js';
|
|
2
|
+
import { parseDimension } from './utilities/parseDimension.js';
|
|
2
3
|
/**
|
|
3
4
|
* @description base font size from options or 16
|
|
4
5
|
* @param options
|
|
@@ -6,22 +7,11 @@ import { isDimension } from '../filters/index.js';
|
|
|
6
7
|
*/
|
|
7
8
|
const getBasePxFontSize = (options) => (options && options.basePxFontSize) || 16;
|
|
8
9
|
/**
|
|
9
|
-
* @description
|
|
10
|
-
* @param value token value
|
|
11
|
-
* @param unit unit string like px or value
|
|
12
|
-
* @returns boolean
|
|
13
|
-
*/
|
|
14
|
-
const hasUnit = (value, unit) => {
|
|
15
|
-
if (typeof value === 'number') {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
return value.indexOf(unit) > -1;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* @description converts dimension tokens value to `rem`, ignores `em` as they are relative to the font size of the parent element
|
|
10
|
+
* @description converts dimension tokens value to `rem`
|
|
22
11
|
* @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
|
|
23
12
|
* @matcher matches all tokens of $type `dimension`
|
|
24
13
|
* @transformer returns a `rem` string
|
|
14
|
+
* @note Expects W3C DTCG format { value: number, unit: "px" | "rem" | "em" }
|
|
25
15
|
*/
|
|
26
16
|
export const dimensionToRem = {
|
|
27
17
|
name: 'dimension/rem',
|
|
@@ -31,16 +21,25 @@ export const dimensionToRem = {
|
|
|
31
21
|
transform: (token, config, options) => {
|
|
32
22
|
const valueProp = options.usesDtcg ? '$value' : 'value';
|
|
33
23
|
const baseFont = getBasePxFontSize(config);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
try {
|
|
25
|
+
const { value, unit } = parseDimension(token[valueProp]);
|
|
26
|
+
if (value === 0) {
|
|
27
|
+
return '0';
|
|
28
|
+
}
|
|
29
|
+
// rem values pass through unchanged
|
|
30
|
+
if (unit === 'rem') {
|
|
31
|
+
return `${value}rem`;
|
|
32
|
+
}
|
|
33
|
+
// em values pass through unchanged (relative to parent, cannot convert)
|
|
34
|
+
if (unit === 'em') {
|
|
35
|
+
return `${value}em`;
|
|
36
|
+
}
|
|
37
|
+
// px values convert to rem
|
|
38
|
+
return `${value / baseFont}rem`;
|
|
40
39
|
}
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
catch (error) {
|
|
41
|
+
const details = error instanceof Error && error.message ? ` - ${error.message}` : error ? ` - ${String(error)}` : '';
|
|
42
|
+
throw new Error(`Invalid dimension token: '${token.name}: ${JSON.stringify(token[valueProp])}' is not valid and cannot be transformed to 'rem'${details}\n`);
|
|
43
43
|
}
|
|
44
|
-
return `${floatVal / baseFont}rem`;
|
|
45
44
|
},
|
|
46
45
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Transform } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
|
-
* @description converts dimension tokens value to `rem
|
|
3
|
+
* @description converts dimension tokens value to an array with both `rem` and `px` values
|
|
4
4
|
* @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
|
|
5
5
|
* @matcher matches all tokens of $type `dimension`
|
|
6
6
|
* @transformer returns an array with the `rem` and `pixel` string
|
|
7
|
+
* @note Expects W3C DTCG format { value: number, unit: "px" | "rem" | "em" }
|
|
7
8
|
*/
|
|
8
9
|
export declare const dimensionToRemPxArray: Transform;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isDimension } from '../filters/index.js';
|
|
2
|
+
import { parseDimension } from './utilities/parseDimension.js';
|
|
2
3
|
/**
|
|
3
4
|
* @description base font size from options or 16
|
|
4
5
|
* @param options
|
|
@@ -6,22 +7,11 @@ import { isDimension } from '../filters/index.js';
|
|
|
6
7
|
*/
|
|
7
8
|
const getBasePxFontSize = (options) => (options && options.basePxFontSize) || 16;
|
|
8
9
|
/**
|
|
9
|
-
* @description
|
|
10
|
-
* @param value token value
|
|
11
|
-
* @param unit unit string like px or value
|
|
12
|
-
* @returns boolean
|
|
13
|
-
*/
|
|
14
|
-
const hasUnit = (value, unit) => {
|
|
15
|
-
if (typeof value === 'number') {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
return value.indexOf(unit) > -1;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* @description converts dimension tokens value to `rem`, ignores `em` as they are relative to the font size of the parent element
|
|
10
|
+
* @description converts dimension tokens value to an array with both `rem` and `px` values
|
|
22
11
|
* @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
|
|
23
12
|
* @matcher matches all tokens of $type `dimension`
|
|
24
13
|
* @transformer returns an array with the `rem` and `pixel` string
|
|
14
|
+
* @note Expects W3C DTCG format { value: number, unit: "px" | "rem" | "em" }
|
|
25
15
|
*/
|
|
26
16
|
export const dimensionToRemPxArray = {
|
|
27
17
|
name: 'dimension/remPxArray',
|
|
@@ -31,16 +21,25 @@ export const dimensionToRemPxArray = {
|
|
|
31
21
|
transform: (token, config, options) => {
|
|
32
22
|
const valueProp = options.usesDtcg ? '$value' : 'value';
|
|
33
23
|
const baseFont = getBasePxFontSize(config);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
try {
|
|
25
|
+
const { value, unit } = parseDimension(token[valueProp]);
|
|
26
|
+
if (value === 0) {
|
|
27
|
+
return ['0', '0'];
|
|
28
|
+
}
|
|
29
|
+
// em values pass through unchanged (relative to parent, cannot convert)
|
|
30
|
+
if (unit === 'em') {
|
|
31
|
+
return [`${value}em`, `${value}em`];
|
|
32
|
+
}
|
|
33
|
+
// rem values pass through, convert to px for second value
|
|
34
|
+
if (unit === 'rem') {
|
|
35
|
+
return [`${value}rem`, `${value * baseFont}px`];
|
|
36
|
+
}
|
|
37
|
+
// px values convert to rem for first value
|
|
38
|
+
return [`${value / baseFont}rem`, `${value}px`];
|
|
40
39
|
}
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
catch (error) {
|
|
41
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
42
|
+
throw new Error(`Invalid dimension token: '${token.name}: ${JSON.stringify(token[valueProp])}' is not valid and cannot be transformed to 'rem' - ${errorMessage}\n`);
|
|
43
43
|
}
|
|
44
|
-
return [`${floatVal / baseFont}rem`, `${floatVal}px`];
|
|
45
44
|
},
|
|
46
45
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Transform } from 'style-dictionary/types';
|
|
2
2
|
/**
|
|
3
|
-
* @description converts duration tokens
|
|
3
|
+
* @description converts duration tokens to css duration string
|
|
4
4
|
* @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
|
|
5
5
|
* @matcher matches all tokens of $type `duration`
|
|
6
6
|
* @transformer returns a css duration
|
|
7
|
+
* @note W3C DTCG format: { value: number, unit: "ms" | "s" }
|
|
7
8
|
*/
|
|
8
9
|
export declare const durationToCss: Transform;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { isDuration } from '../filters/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* @description converts duration tokens
|
|
3
|
+
* @description converts duration tokens to css duration string
|
|
4
4
|
* @type value transformer — [StyleDictionary.ValueTransform](https://github.com/amzn/style-dictionary/blob/main/types/Transform.d.ts)
|
|
5
5
|
* @matcher matches all tokens of $type `duration`
|
|
6
6
|
* @transformer returns a css duration
|
|
7
|
+
* @note W3C DTCG format: { value: number, unit: "ms" | "s" }
|
|
7
8
|
*/
|
|
8
9
|
export const durationToCss = {
|
|
9
10
|
name: 'duration/css',
|
|
@@ -12,18 +13,24 @@ export const durationToCss = {
|
|
|
12
13
|
filter: isDuration,
|
|
13
14
|
transform: (token, _config, options) => {
|
|
14
15
|
const valueProp = options.usesDtcg ? '$value' : 'value';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const tokenValue = token[valueProp];
|
|
17
|
+
// Validate W3C DTCG object format: { value: number, unit: "ms" | "s" }
|
|
18
|
+
if (typeof tokenValue !== 'object' || tokenValue === null || !('value' in tokenValue) || !('unit' in tokenValue)) {
|
|
19
|
+
throw new Error(`duration token value must be an object with "value" and "unit" properties (W3C DTCG format). Invalid token: ${token.name} with value: ${JSON.stringify(tokenValue)}`);
|
|
18
20
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const { value, unit } = tokenValue;
|
|
22
|
+
// Validate unit
|
|
23
|
+
if (unit !== 'ms' && unit !== 's') {
|
|
24
|
+
throw new Error(`duration token unit must be "ms" or "s", invalid token: ${token.name} with unit: ${unit}`);
|
|
25
|
+
}
|
|
26
|
+
// Validate value is a finite, non-negative number
|
|
27
|
+
if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {
|
|
28
|
+
throw new Error(`duration token value must be a finite, non-negative number, invalid token: ${token.name} with value: ${value}`);
|
|
29
|
+
}
|
|
30
|
+
// Convert ms >= 1000 to seconds for cleaner output
|
|
31
|
+
if (unit === 'ms' && value >= 1000) {
|
|
32
|
+
return `${value / 1000}s`;
|
|
25
33
|
}
|
|
26
|
-
// return value
|
|
27
34
|
return `${value}${unit}`;
|
|
28
35
|
},
|
|
29
36
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DimensionTokenValue } from '../../types/dimensionTokenValue.js';
|
|
2
|
+
/**
|
|
3
|
+
* @description Parses and validates a dimension value in W3C DTCG object format
|
|
4
|
+
* @param input - The dimension value in W3C object format { value: number, unit: "px" | "rem" | "em" }
|
|
5
|
+
* @returns Validated DimensionTokenValue
|
|
6
|
+
* @throws Error if the input is not a valid W3C dimension object
|
|
7
|
+
*
|
|
8
|
+
* W3C DTCG format: { value: 16, unit: "px" }
|
|
9
|
+
* @note `em` is not in the W3C spec but is supported for practical use
|
|
10
|
+
* @link https://www.designtokens.org/tr/drafts/format/#dimension
|
|
11
|
+
*/
|
|
12
|
+
export declare const parseDimension: (input: DimensionTokenValue) => DimensionTokenValue;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Parses and validates a dimension value in W3C DTCG object format
|
|
3
|
+
* @param input - The dimension value in W3C object format { value: number, unit: "px" | "rem" | "em" }
|
|
4
|
+
* @returns Validated DimensionTokenValue
|
|
5
|
+
* @throws Error if the input is not a valid W3C dimension object
|
|
6
|
+
*
|
|
7
|
+
* W3C DTCG format: { value: 16, unit: "px" }
|
|
8
|
+
* @note `em` is not in the W3C spec but is supported for practical use
|
|
9
|
+
* @link https://www.designtokens.org/tr/drafts/format/#dimension
|
|
10
|
+
*/
|
|
11
|
+
export const parseDimension = (input) => {
|
|
12
|
+
// Runtime validation for W3C DTCG object format
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
14
|
+
if (typeof input !== 'object' || input === null) {
|
|
15
|
+
throw new Error(`Invalid dimension value: ${JSON.stringify(input)} - must be a W3C DTCG dimension object with "value" and "unit" properties`);
|
|
16
|
+
}
|
|
17
|
+
const inputObj = input;
|
|
18
|
+
if (!('value' in inputObj) || !('unit' in inputObj)) {
|
|
19
|
+
throw new Error(`Invalid dimension value: ${JSON.stringify(input)} - must be a W3C DTCG dimension object with "value" and "unit" properties`);
|
|
20
|
+
}
|
|
21
|
+
const { value, unit } = input;
|
|
22
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
23
|
+
throw new Error(`Invalid dimension value: ${JSON.stringify(input)} - value must be a finite number`);
|
|
24
|
+
}
|
|
25
|
+
// Runtime check - unit could be invalid at runtime even if types say otherwise
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
27
|
+
if (unit !== 'px' && unit !== 'rem' && unit !== 'em') {
|
|
28
|
+
throw new Error(`Invalid dimension unit: ${String(unit)} - must be "px", "rem", or "em"`);
|
|
29
|
+
}
|
|
30
|
+
return { value, unit };
|
|
31
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* W3C DTCG dimension token value format
|
|
3
|
+
* @link https://www.designtokens.org/tr/drafts/format/#dimension
|
|
4
|
+
* @note `em` is not in the W3C spec but is supported for practical use
|
|
5
|
+
*/
|
|
6
|
+
export type DimensionTokenValue = {
|
|
7
|
+
value: number
|
|
8
|
+
unit: 'px' | 'rem' | 'em'
|
|
9
|
+
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @spec See /DESIGN_TOKENS_SPEC.md for naming logic and semantic pairings.
|
|
3
|
+
* @rule Never use raw values (hex/px). Use semantic tokens ONLY.
|
|
4
|
+
*/
|
|
1
5
|
[data-color-mode="dark"][data-dark-theme="dark_colorblind_high_contrast"],
|
|
2
6
|
[data-color-mode="auto"][data-light-theme="dark_colorblind_high_contrast"] {
|
|
3
7
|
--button-primary-bgColor-active: #3685f3;
|
|
@@ -792,11 +796,11 @@
|
|
|
792
796
|
--reactionButton-selected-fgColor-rest: var(--fgColor-link);
|
|
793
797
|
--selectMenu-borderColor: var(--borderColor-default);
|
|
794
798
|
--selection-bgColor: #194fb1b3; /** Background color for text selection highlights */
|
|
795
|
-
--shadow-floating-legacy: 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966;
|
|
796
|
-
--shadow-inset: inset 0px 1px 0px 0px #0104093d;
|
|
797
|
-
--shadow-resting-medium: 0px 1px 1px 0px #01040966, 0px 3px 6px 0px #010409cc;
|
|
798
|
-
--shadow-resting-small: 0px 1px 1px 0px #01040999, 0px 1px 3px 0px #01040999;
|
|
799
|
-
--shadow-resting-xsmall: 0px 1px 1px 0px #010409cc;
|
|
799
|
+
--shadow-floating-legacy: 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966; /** Legacy floating shadow for backward compatibility */
|
|
800
|
+
--shadow-inset: inset 0px 1px 0px 0px #0104093d; /** Inset shadow for recessed elements */
|
|
801
|
+
--shadow-resting-medium: 0px 1px 1px 0px #01040966, 0px 3px 6px 0px #010409cc; /** Medium resting shadow for cards and elevated surfaces */
|
|
802
|
+
--shadow-resting-small: 0px 1px 1px 0px #01040999, 0px 1px 3px 0px #01040999; /** Small resting shadow for buttons and interactive elements */
|
|
803
|
+
--shadow-resting-xsmall: 0px 1px 1px 0px #010409cc; /** Extra small resting shadow for minimal elevation */
|
|
800
804
|
--topicTag-borderColor: var(--borderColor-accent-emphasis);
|
|
801
805
|
--treeViewItem-leadingVisual-iconColor-rest: var(--fgColor-muted);
|
|
802
806
|
--underlineNav-iconColor-rest: var(--fgColor-muted);
|
|
@@ -872,9 +876,9 @@
|
|
|
872
876
|
--page-header-bgColor: var(--bgColor-default);
|
|
873
877
|
--progressBar-track-bgColor: var(--bgColor-inverse);
|
|
874
878
|
--shadow-floating-large: 0px 0px 0px 1px #b7bdc8, 0px 24px 48px 0px #010409; /** Large floating shadow for modals and dialogs */
|
|
875
|
-
--shadow-floating-medium: 0px 0px 0px 1px #b7bdc8, 0px 8px 16px -4px #01040966, 0px 4px 32px -4px #01040966, 0px 24px 48px -12px #01040966, 0px 48px 96px -24px #01040966;
|
|
879
|
+
--shadow-floating-medium: 0px 0px 0px 1px #b7bdc8, 0px 8px 16px -4px #01040966, 0px 4px 32px -4px #01040966, 0px 24px 48px -12px #01040966, 0px 48px 96px -24px #01040966; /** Medium floating shadow for popovers and action menus */
|
|
876
880
|
--shadow-floating-small: 0px 0px 0px 1px #b7bdc8, 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966; /** Small floating shadow for dropdowns, tooltips, and small overlays */
|
|
877
|
-
--shadow-floating-xlarge: 0px 0px 0px 1px #b7bdc8, 0px 32px 64px 0px #010409;
|
|
881
|
+
--shadow-floating-xlarge: 0px 0px 0px 1px #b7bdc8, 0px 32px 64px 0px #010409; /** Extra large floating shadow for full-screen overlays and sheets */
|
|
878
882
|
--tooltip-bgColor: var(--bgColor-inverse);
|
|
879
883
|
--tooltip-fgColor: var(--fgColor-onInverse);
|
|
880
884
|
--border-neutral-emphasis: 0.0625rem solid #b7bdc8;
|
|
@@ -1689,11 +1693,11 @@
|
|
|
1689
1693
|
--reactionButton-selected-fgColor-rest: var(--fgColor-link);
|
|
1690
1694
|
--selectMenu-borderColor: var(--borderColor-default);
|
|
1691
1695
|
--selection-bgColor: #194fb1b3; /** Background color for text selection highlights */
|
|
1692
|
-
--shadow-floating-legacy: 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966;
|
|
1693
|
-
--shadow-inset: inset 0px 1px 0px 0px #0104093d;
|
|
1694
|
-
--shadow-resting-medium: 0px 1px 1px 0px #01040966, 0px 3px 6px 0px #010409cc;
|
|
1695
|
-
--shadow-resting-small: 0px 1px 1px 0px #01040999, 0px 1px 3px 0px #01040999;
|
|
1696
|
-
--shadow-resting-xsmall: 0px 1px 1px 0px #010409cc;
|
|
1696
|
+
--shadow-floating-legacy: 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966; /** Legacy floating shadow for backward compatibility */
|
|
1697
|
+
--shadow-inset: inset 0px 1px 0px 0px #0104093d; /** Inset shadow for recessed elements */
|
|
1698
|
+
--shadow-resting-medium: 0px 1px 1px 0px #01040966, 0px 3px 6px 0px #010409cc; /** Medium resting shadow for cards and elevated surfaces */
|
|
1699
|
+
--shadow-resting-small: 0px 1px 1px 0px #01040999, 0px 1px 3px 0px #01040999; /** Small resting shadow for buttons and interactive elements */
|
|
1700
|
+
--shadow-resting-xsmall: 0px 1px 1px 0px #010409cc; /** Extra small resting shadow for minimal elevation */
|
|
1697
1701
|
--topicTag-borderColor: var(--borderColor-accent-emphasis);
|
|
1698
1702
|
--treeViewItem-leadingVisual-iconColor-rest: var(--fgColor-muted);
|
|
1699
1703
|
--underlineNav-iconColor-rest: var(--fgColor-muted);
|
|
@@ -1769,9 +1773,9 @@
|
|
|
1769
1773
|
--page-header-bgColor: var(--bgColor-default);
|
|
1770
1774
|
--progressBar-track-bgColor: var(--bgColor-inverse);
|
|
1771
1775
|
--shadow-floating-large: 0px 0px 0px 1px #b7bdc8, 0px 24px 48px 0px #010409; /** Large floating shadow for modals and dialogs */
|
|
1772
|
-
--shadow-floating-medium: 0px 0px 0px 1px #b7bdc8, 0px 8px 16px -4px #01040966, 0px 4px 32px -4px #01040966, 0px 24px 48px -12px #01040966, 0px 48px 96px -24px #01040966;
|
|
1776
|
+
--shadow-floating-medium: 0px 0px 0px 1px #b7bdc8, 0px 8px 16px -4px #01040966, 0px 4px 32px -4px #01040966, 0px 24px 48px -12px #01040966, 0px 48px 96px -24px #01040966; /** Medium floating shadow for popovers and action menus */
|
|
1773
1777
|
--shadow-floating-small: 0px 0px 0px 1px #b7bdc8, 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966; /** Small floating shadow for dropdowns, tooltips, and small overlays */
|
|
1774
|
-
--shadow-floating-xlarge: 0px 0px 0px 1px #b7bdc8, 0px 32px 64px 0px #010409;
|
|
1778
|
+
--shadow-floating-xlarge: 0px 0px 0px 1px #b7bdc8, 0px 32px 64px 0px #010409; /** Extra large floating shadow for full-screen overlays and sheets */
|
|
1775
1779
|
--tooltip-bgColor: var(--bgColor-inverse);
|
|
1776
1780
|
--tooltip-fgColor: var(--fgColor-onInverse);
|
|
1777
1781
|
--border-neutral-emphasis: 0.0625rem solid #b7bdc8;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @spec See /DESIGN_TOKENS_SPEC.md for naming logic and semantic pairings.
|
|
3
|
+
* @rule Never use raw values (hex/px). Use semantic tokens ONLY.
|
|
4
|
+
*/
|
|
1
5
|
[data-color-mode="dark"][data-dark-theme="dark_colorblind"],
|
|
2
6
|
[data-color-mode="auto"][data-light-theme="dark_colorblind"] {
|
|
3
7
|
--button-primary-bgColor-active: #3685f3;
|
|
@@ -815,11 +819,11 @@
|
|
|
815
819
|
--reactionButton-selected-fgColor-rest: var(--fgColor-link);
|
|
816
820
|
--selectMenu-borderColor: var(--borderColor-default);
|
|
817
821
|
--selection-bgColor: #1f6febb3; /** Background color for text selection highlights */
|
|
818
|
-
--shadow-floating-legacy: 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966;
|
|
819
|
-
--shadow-inset: inset 0px 1px 0px 0px #0104093d;
|
|
820
|
-
--shadow-resting-medium: 0px 1px 1px 0px #01040966, 0px 3px 6px 0px #010409cc;
|
|
821
|
-
--shadow-resting-small: 0px 1px 1px 0px #01040999, 0px 1px 3px 0px #01040999;
|
|
822
|
-
--shadow-resting-xsmall: 0px 1px 1px 0px #010409cc;
|
|
822
|
+
--shadow-floating-legacy: 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966; /** Legacy floating shadow for backward compatibility */
|
|
823
|
+
--shadow-inset: inset 0px 1px 0px 0px #0104093d; /** Inset shadow for recessed elements */
|
|
824
|
+
--shadow-resting-medium: 0px 1px 1px 0px #01040966, 0px 3px 6px 0px #010409cc; /** Medium resting shadow for cards and elevated surfaces */
|
|
825
|
+
--shadow-resting-small: 0px 1px 1px 0px #01040999, 0px 1px 3px 0px #01040999; /** Small resting shadow for buttons and interactive elements */
|
|
826
|
+
--shadow-resting-xsmall: 0px 1px 1px 0px #010409cc; /** Extra small resting shadow for minimal elevation */
|
|
823
827
|
--tooltip-bgColor: var(--bgColor-emphasis);
|
|
824
828
|
--treeViewItem-leadingVisual-iconColor-rest: var(--fgColor-muted);
|
|
825
829
|
--underlineNav-iconColor-rest: var(--fgColor-muted);
|
|
@@ -887,9 +891,9 @@
|
|
|
887
891
|
--buttonKeybindingHint-danger-borderColor-rest: var(--buttonKeybindingHint-default-borderColor-rest);
|
|
888
892
|
--buttonKeybindingHint-danger-fgColor-disabled: var(--buttonKeybindingHint-default-fgColor-disabled);
|
|
889
893
|
--shadow-floating-large: 0px 0px 0px 1px #3d444d, 0px 24px 48px 0px #010409; /** Large floating shadow for modals and dialogs */
|
|
890
|
-
--shadow-floating-medium: 0px 0px 0px 1px #3d444d, 0px 8px 16px -4px #01040966, 0px 4px 32px -4px #01040966, 0px 24px 48px -12px #01040966, 0px 48px 96px -24px #01040966;
|
|
894
|
+
--shadow-floating-medium: 0px 0px 0px 1px #3d444d, 0px 8px 16px -4px #01040966, 0px 4px 32px -4px #01040966, 0px 24px 48px -12px #01040966, 0px 48px 96px -24px #01040966; /** Medium floating shadow for popovers and action menus */
|
|
891
895
|
--shadow-floating-small: 0px 0px 0px 1px #3d444d, 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966; /** Small floating shadow for dropdowns, tooltips, and small overlays */
|
|
892
|
-
--shadow-floating-xlarge: 0px 0px 0px 1px #3d444d, 0px 32px 64px 0px #010409;
|
|
896
|
+
--shadow-floating-xlarge: 0px 0px 0px 1px #3d444d, 0px 32px 64px 0px #010409; /** Extra large floating shadow for full-screen overlays and sheets */
|
|
893
897
|
--underlineNav-borderColor-hover: var(--borderColor-neutral-muted);
|
|
894
898
|
--button-danger-borderColor-active: var(--button-danger-borderColor-hover);
|
|
895
899
|
--button-outline-borderColor-hover: var(--button-default-borderColor-hover);
|
|
@@ -1712,11 +1716,11 @@
|
|
|
1712
1716
|
--reactionButton-selected-fgColor-rest: var(--fgColor-link);
|
|
1713
1717
|
--selectMenu-borderColor: var(--borderColor-default);
|
|
1714
1718
|
--selection-bgColor: #1f6febb3; /** Background color for text selection highlights */
|
|
1715
|
-
--shadow-floating-legacy: 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966;
|
|
1716
|
-
--shadow-inset: inset 0px 1px 0px 0px #0104093d;
|
|
1717
|
-
--shadow-resting-medium: 0px 1px 1px 0px #01040966, 0px 3px 6px 0px #010409cc;
|
|
1718
|
-
--shadow-resting-small: 0px 1px 1px 0px #01040999, 0px 1px 3px 0px #01040999;
|
|
1719
|
-
--shadow-resting-xsmall: 0px 1px 1px 0px #010409cc;
|
|
1719
|
+
--shadow-floating-legacy: 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966; /** Legacy floating shadow for backward compatibility */
|
|
1720
|
+
--shadow-inset: inset 0px 1px 0px 0px #0104093d; /** Inset shadow for recessed elements */
|
|
1721
|
+
--shadow-resting-medium: 0px 1px 1px 0px #01040966, 0px 3px 6px 0px #010409cc; /** Medium resting shadow for cards and elevated surfaces */
|
|
1722
|
+
--shadow-resting-small: 0px 1px 1px 0px #01040999, 0px 1px 3px 0px #01040999; /** Small resting shadow for buttons and interactive elements */
|
|
1723
|
+
--shadow-resting-xsmall: 0px 1px 1px 0px #010409cc; /** Extra small resting shadow for minimal elevation */
|
|
1720
1724
|
--tooltip-bgColor: var(--bgColor-emphasis);
|
|
1721
1725
|
--treeViewItem-leadingVisual-iconColor-rest: var(--fgColor-muted);
|
|
1722
1726
|
--underlineNav-iconColor-rest: var(--fgColor-muted);
|
|
@@ -1784,9 +1788,9 @@
|
|
|
1784
1788
|
--buttonKeybindingHint-danger-borderColor-rest: var(--buttonKeybindingHint-default-borderColor-rest);
|
|
1785
1789
|
--buttonKeybindingHint-danger-fgColor-disabled: var(--buttonKeybindingHint-default-fgColor-disabled);
|
|
1786
1790
|
--shadow-floating-large: 0px 0px 0px 1px #3d444d, 0px 24px 48px 0px #010409; /** Large floating shadow for modals and dialogs */
|
|
1787
|
-
--shadow-floating-medium: 0px 0px 0px 1px #3d444d, 0px 8px 16px -4px #01040966, 0px 4px 32px -4px #01040966, 0px 24px 48px -12px #01040966, 0px 48px 96px -24px #01040966;
|
|
1791
|
+
--shadow-floating-medium: 0px 0px 0px 1px #3d444d, 0px 8px 16px -4px #01040966, 0px 4px 32px -4px #01040966, 0px 24px 48px -12px #01040966, 0px 48px 96px -24px #01040966; /** Medium floating shadow for popovers and action menus */
|
|
1788
1792
|
--shadow-floating-small: 0px 0px 0px 1px #3d444d, 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966; /** Small floating shadow for dropdowns, tooltips, and small overlays */
|
|
1789
|
-
--shadow-floating-xlarge: 0px 0px 0px 1px #3d444d, 0px 32px 64px 0px #010409;
|
|
1793
|
+
--shadow-floating-xlarge: 0px 0px 0px 1px #3d444d, 0px 32px 64px 0px #010409; /** Extra large floating shadow for full-screen overlays and sheets */
|
|
1790
1794
|
--underlineNav-borderColor-hover: var(--borderColor-neutral-muted);
|
|
1791
1795
|
--button-danger-borderColor-active: var(--button-danger-borderColor-hover);
|
|
1792
1796
|
--button-outline-borderColor-hover: var(--button-default-borderColor-hover);
|