@aziontech/theme 1.12.0 → 2.0.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 +1 -1
- package/package.json +19 -21
- package/src/scripts/build-tokens.mjs +391 -0
- package/src/scripts/compile-primitives.js +165 -0
- package/src/scripts/compile-theme.js +117 -0
- package/src/{tokens/build → scripts}/css-vars.js +10 -9
- package/src/{tokens/build → scripts}/resolve.js +2 -0
- package/src/tests/primitives.html +293 -0
- package/src/tests/theme.html +310 -0
- package/src/tests/tokens.html +84 -0
- package/src/tokens/README.md +306 -272
- package/src/tokens/index.js +4 -12
- package/src/tokens/primitives/animations/animate.js +8 -0
- package/src/tokens/primitives/animations/ease.js +7 -0
- package/src/tokens/primitives/border-widths.js +9 -0
- package/src/tokens/primitives/breakpoints.js +9 -0
- package/src/tokens/primitives/colors/alpha.js +104 -0
- package/src/tokens/primitives/colors/brand.js +40 -0
- package/src/tokens/primitives/colors/colors.js +142 -0
- package/src/tokens/primitives/effects/blur.js +11 -0
- package/src/tokens/primitives/effects/drop-shadow.js +10 -0
- package/src/tokens/primitives/effects/inset-shadow.js +7 -0
- package/src/tokens/primitives/effects/opacity.js +8 -0
- package/src/tokens/primitives/effects/perspective.js +9 -0
- package/src/tokens/primitives/effects/shadow.js +11 -0
- package/src/tokens/primitives/ring-offset.js +5 -0
- package/src/tokens/primitives/shape/aspect-video.js +3 -0
- package/src/tokens/primitives/shape/container.js +17 -0
- package/src/tokens/primitives/shape/height.js +32 -0
- package/src/tokens/primitives/shape/radius.js +13 -0
- package/src/tokens/primitives/shape/shape.js +12 -0
- package/src/tokens/primitives/shape/size.js +32 -0
- package/src/tokens/primitives/shape/spacing.js +33 -0
- package/src/tokens/primitives/shape/width.js +19 -0
- package/src/tokens/primitives/typography/font-family.js +7 -0
- package/src/tokens/primitives/typography/font-size.js +30 -0
- package/src/tokens/primitives/typography/font-weight.js +13 -0
- package/src/tokens/primitives/typography/leading.js +9 -0
- package/src/tokens/primitives/typography/line-height.js +13 -0
- package/src/tokens/primitives/typography/tracking.js +10 -0
- package/src/{tailwind/semantic-animations-plugin.js → tokens/semantic/animations.js} +3 -21
- package/src/tokens/semantic/colors.js +138 -0
- package/src/tokens/semantic/containers.data.js +18 -0
- package/src/tokens/semantic/containers.js +70 -0
- package/src/tokens/semantic/spacings.data.js +18 -0
- package/src/tokens/semantic/spacings.js +163 -0
- package/src/tokens/semantic/texts.data.js +103 -0
- package/src/{tailwind/semantic-texts-plugin.js → tokens/semantic/texts.js} +91 -70
- package/src/tokens/theme/accent.js +18 -0
- package/src/tokens/theme/background.js +32 -0
- package/src/tokens/theme/border.js +18 -0
- package/src/tokens/theme/feedback/danger.js +16 -0
- package/src/tokens/theme/feedback/info.js +16 -0
- package/src/tokens/theme/feedback/success.js +16 -0
- package/src/tokens/theme/feedback/warning.js +16 -0
- package/src/tokens/theme/primary.js +18 -0
- package/src/tokens/theme/ring.js +12 -0
- package/src/tokens/theme/secondary.js +18 -0
- package/src/tokens/theme/surfaces.js +23 -0
- package/src/tokens/theme/text.js +18 -0
- package/src/tokens/theme.js +32 -0
- package/colors-brand.js +0 -24
- package/src/tailwind/semantic-colors-plugin.js +0 -91
- package/src/tailwind/semantic-spacing-plugin.js +0 -151
- package/src/tailwind/tailwind-theme.js +0 -54
- package/src/tokens/build/preset.js +0 -62
- package/src/tokens/build/tailwind-flat-colors.js +0 -75
- package/src/tokens/build/tailwind-helper.js +0 -12
- package/src/tokens/build/tailwind-plugin.js +0 -175
- package/src/tokens/colors-brand.js +0 -24
- package/src/tokens/primitives/brand.js +0 -69
- package/src/tokens/primitives/colors.js +0 -144
- package/src/tokens/semantic/backgrounds.js +0 -46
- package/src/tokens/semantic/borders.js +0 -44
- package/src/tokens/semantic/text.js +0 -48
- /package/src/{tokens/build → scripts}/refs.js +0 -0
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tailwind plugin to expose semantic animations and keyframes.
|
|
3
|
-
*
|
|
4
|
-
* This adds animation utilities and keyframes for common UI animations.
|
|
5
|
-
*
|
|
6
|
-
* Usage in tailwind.config.js:
|
|
7
|
-
* ```javascript
|
|
8
|
-
* import { theme } from '@aziontech/theme/tailwind/tailwind-theme.js';
|
|
9
|
-
* import semanticAnimations from '@aziontech/theme/tailwind/semantic-animations-plugin';
|
|
10
|
-
*
|
|
11
|
-
* export default {
|
|
12
|
-
* theme,
|
|
13
|
-
* plugins: [semanticAnimations()],
|
|
14
|
-
* };
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
// Lazy-require to avoid hard dependency for consumers
|
|
19
1
|
const plugin = (() => {
|
|
20
2
|
try {
|
|
21
3
|
return require('tailwindcss/plugin');
|
|
@@ -28,8 +10,8 @@ const plugin = (() => {
|
|
|
28
10
|
* Generate semantic animation utilities and keyframes
|
|
29
11
|
* @returns {import('tailwindcss/plugin').Plugin}
|
|
30
12
|
*/
|
|
31
|
-
export const
|
|
32
|
-
return plugin(({ addUtilities, addComponents
|
|
13
|
+
export const animations = () => {
|
|
14
|
+
return plugin(({ addUtilities, addComponents }) => {
|
|
33
15
|
// Animation utilities
|
|
34
16
|
const animations = {
|
|
35
17
|
'.animate-fade-in': {
|
|
@@ -79,4 +61,4 @@ export const semanticAnimations = () => {
|
|
|
79
61
|
});
|
|
80
62
|
};
|
|
81
63
|
|
|
82
|
-
export default
|
|
64
|
+
export default animations;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SEMANTIC COLOR TOKENS
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for semantic color tokens.
|
|
5
|
+
*
|
|
6
|
+
* - `semanticColorsData`: token refs grouped by category (`text`, `background`,
|
|
7
|
+
* `border`) and mode (`light`, `dark`). Consumed by `tokens/build/css-vars.js`
|
|
8
|
+
* to emit `:root` / `.dark` CSS variables.
|
|
9
|
+
* - `semanticColors`: derived map of `var(--…)` strings, grouped by category,
|
|
10
|
+
* consumed by `tokens/theme.js` to extend Tailwind's `textColor`,
|
|
11
|
+
* `backgroundColor`, and `borderColor`. Generates utilities like
|
|
12
|
+
* `text-default`, `bg-surface`, `border-danger` natively — no plugin needed.
|
|
13
|
+
*
|
|
14
|
+
* Adding a new semantic color: add a key under both `light` and `dark` in the
|
|
15
|
+
* relevant category here. The CSS variable and the Tailwind utility are both
|
|
16
|
+
* derived automatically.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { tokenRef } from '../../scripts/refs.js';
|
|
20
|
+
|
|
21
|
+
export const semanticColorsData = {
|
|
22
|
+
text: {
|
|
23
|
+
light: {
|
|
24
|
+
default: tokenRef('primitives.gray.900'),
|
|
25
|
+
muted: tokenRef('primitives.gray.600'),
|
|
26
|
+
link: tokenRef('primitives.blue.600'),
|
|
27
|
+
code: tokenRef('primitives.gray.600'),
|
|
28
|
+
'link-hover': tokenRef('primitives.blue.700'),
|
|
29
|
+
primary: tokenRef('brand.primary.primary-500'),
|
|
30
|
+
'primary-hover': tokenRef('brand.primary.primary-600'),
|
|
31
|
+
accent: tokenRef('brand.accent.accent-500'),
|
|
32
|
+
'accent-hover': tokenRef('brand.accent.accent-600'),
|
|
33
|
+
'danger-hover': tokenRef('primitives.red.500'),
|
|
34
|
+
'warning-hover': tokenRef('primitives.yellow.500'),
|
|
35
|
+
'success-hover': tokenRef('primitives.green.500'),
|
|
36
|
+
success: tokenRef('primitives.green.600'),
|
|
37
|
+
danger: tokenRef('primitives.red.600'),
|
|
38
|
+
warning: tokenRef('primitives.yellow.600'),
|
|
39
|
+
},
|
|
40
|
+
dark: {
|
|
41
|
+
default: tokenRef('primitives.gray.50'),
|
|
42
|
+
muted: tokenRef('primitives.gray.400'),
|
|
43
|
+
link: tokenRef('primitives.blue.400'),
|
|
44
|
+
code: tokenRef('primitives.gray.400'),
|
|
45
|
+
'link-hover': tokenRef('primitives.blue.300'),
|
|
46
|
+
primary: tokenRef('brand.primary.primary-500'),
|
|
47
|
+
'primary-hover': tokenRef('brand.primary.primary-400'),
|
|
48
|
+
accent: tokenRef('brand.accent.accent-500'),
|
|
49
|
+
'accent-hover': tokenRef('brand.accent.accent-400'),
|
|
50
|
+
'danger-hover': tokenRef('primitives.red.500'),
|
|
51
|
+
'warning-hover': tokenRef('primitives.yellow.500'),
|
|
52
|
+
'success-hover': tokenRef('primitives.green.500'),
|
|
53
|
+
success: tokenRef('primitives.green.400'),
|
|
54
|
+
danger: tokenRef('primitives.red.400'),
|
|
55
|
+
warning: tokenRef('primitives.yellow.400'),
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
background: {
|
|
59
|
+
light: {
|
|
60
|
+
'surface-raised': tokenRef('brand.surfaces.surface-0'),
|
|
61
|
+
'surface-overlay': tokenRef('brand.surfaces.surface-50'),
|
|
62
|
+
surface: tokenRef('brand.surfaces.surface-0'),
|
|
63
|
+
canvas: tokenRef('brand.surfaces.surface-100'),
|
|
64
|
+
'danger-hover': tokenRef('primitives.red.400'),
|
|
65
|
+
'warning-hover': tokenRef('primitives.yellow.400'),
|
|
66
|
+
'success-hover': tokenRef('primitives.green.400'),
|
|
67
|
+
success: tokenRef('primitives.green.200'),
|
|
68
|
+
danger: tokenRef('primitives.red.200'),
|
|
69
|
+
warning: tokenRef('primitives.yellow.200'),
|
|
70
|
+
backdrop: tokenRef('primitives.alpha.neutral.25'),
|
|
71
|
+
'primary-hover': tokenRef('brand.primary.primary-600'),
|
|
72
|
+
primary: tokenRef('brand.primary.primary-500'),
|
|
73
|
+
'primary-mask': tokenRef('primitives.alpha.brand.primary.65'),
|
|
74
|
+
},
|
|
75
|
+
dark: {
|
|
76
|
+
'surface-raised': tokenRef('brand.surfaces.surface-800'),
|
|
77
|
+
'surface-overlay': tokenRef('brand.surfaces.surface-700'),
|
|
78
|
+
surface: tokenRef('brand.surfaces.surface-900'),
|
|
79
|
+
canvas: tokenRef('brand.surfaces.surface-950'),
|
|
80
|
+
'danger-hover': tokenRef('primitives.red.600'),
|
|
81
|
+
'warning-hover': tokenRef('primitives.yellow.600'),
|
|
82
|
+
'success-hover': tokenRef('primitives.green.600'),
|
|
83
|
+
success: tokenRef('primitives.green.800'),
|
|
84
|
+
danger: tokenRef('primitives.red.800'),
|
|
85
|
+
warning: tokenRef('primitives.yellow.800'),
|
|
86
|
+
backdrop: tokenRef('primitives.alpha.neutral.25'),
|
|
87
|
+
'primary-hover': tokenRef('brand.primary.primary-400'),
|
|
88
|
+
primary: tokenRef('brand.primary.primary-500'),
|
|
89
|
+
'primary-mask': tokenRef('primitives.alpha.brand.primary.65'),
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
border: {
|
|
93
|
+
light: {
|
|
94
|
+
default: tokenRef('brand.surfaces.surface-100'),
|
|
95
|
+
strong: tokenRef('primitives.base.black'),
|
|
96
|
+
warning: tokenRef('primitives.yellow.600'),
|
|
97
|
+
success: tokenRef('primitives.green.600'),
|
|
98
|
+
danger: tokenRef('primitives.red.600'),
|
|
99
|
+
primary: tokenRef('brand.primary.primary-500'),
|
|
100
|
+
accent: tokenRef('brand.accent.accent-500'),
|
|
101
|
+
'warning-hover': tokenRef('primitives.yellow.500'),
|
|
102
|
+
'success-hover': tokenRef('primitives.green.500'),
|
|
103
|
+
'danger-hover': tokenRef('primitives.red.500'),
|
|
104
|
+
'primary-hover': tokenRef('brand.primary.primary-600'),
|
|
105
|
+
'accent-hover': tokenRef('brand.accent.accent-600'),
|
|
106
|
+
subtle: tokenRef('brand.surfaces.surface-200'),
|
|
107
|
+
},
|
|
108
|
+
dark: {
|
|
109
|
+
default: tokenRef('brand.surfaces.surface-800'),
|
|
110
|
+
strong: tokenRef('primitives.base.white'),
|
|
111
|
+
warning: tokenRef('primitives.yellow.400'),
|
|
112
|
+
success: tokenRef('primitives.green.400'),
|
|
113
|
+
danger: tokenRef('primitives.red.400'),
|
|
114
|
+
primary: tokenRef('brand.primary.primary-500'),
|
|
115
|
+
accent: tokenRef('brand.accent.accent-500'),
|
|
116
|
+
'warning-hover': tokenRef('primitives.yellow.500'),
|
|
117
|
+
'success-hover': tokenRef('primitives.green.500'),
|
|
118
|
+
'danger-hover': tokenRef('primitives.red.500'),
|
|
119
|
+
'primary-hover': tokenRef('brand.primary.primary-400'),
|
|
120
|
+
'accent-hover': tokenRef('brand.accent.accent-400'),
|
|
121
|
+
subtle: tokenRef('brand.surfaces.surface-700'),
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const toCssVarMap = (category, mode) =>
|
|
127
|
+
Object.fromEntries(Object.keys(mode).map((key) => [key, `var(--${category}-${key})`]));
|
|
128
|
+
|
|
129
|
+
export const semanticColors = {
|
|
130
|
+
text: toCssVarMap('text', semanticColorsData.text.light),
|
|
131
|
+
background: toCssVarMap('background', semanticColorsData.background.light),
|
|
132
|
+
border: toCssVarMap('border', semanticColorsData.border.light),
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export default {
|
|
136
|
+
semanticColors,
|
|
137
|
+
semanticColorsData,
|
|
138
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declarative container tokens (mobile-first).
|
|
3
|
+
*
|
|
4
|
+
* Each entry maps a token key to a breakpoint map. `_` is the default;
|
|
5
|
+
* any other key must exist in tokens/primitives/breakpoints.js.
|
|
6
|
+
*
|
|
7
|
+
* Values are ported from the legacy `containers.js` plugin. The `xl` bucket
|
|
8
|
+
* used to be wrapped in `@media (max-width: xl)` — orphan / never matched
|
|
9
|
+
* cleanly — and was corrected to `min-width` here.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export const containersData = {
|
|
13
|
+
px: { _: '1rem', sm: '2.5rem', xl: '0' },
|
|
14
|
+
py: { _: '4rem', sm: '8rem', xl: '12rem' },
|
|
15
|
+
'max-width': { _: '28rem', sm: '64rem', xl: '80rem' },
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default { containersData };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// TODO: deprecated — substituído pelos tokens declarativos em
|
|
2
|
+
// `containers.data.js` e pelo CSS gerado em `dist/globals.css` via
|
|
3
|
+
// `src/scripts/build-tokens.mjs`. Remover quando consumers migrarem.
|
|
4
|
+
const plugin = (() => {
|
|
5
|
+
try {
|
|
6
|
+
return require('tailwindcss/plugin');
|
|
7
|
+
} catch {
|
|
8
|
+
return (handler) => handler;
|
|
9
|
+
}
|
|
10
|
+
})();
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Generate semantic spacing style components
|
|
14
|
+
* @returns {import('tailwindcss/plugin').Plugin}
|
|
15
|
+
*/
|
|
16
|
+
export const containers = () => {
|
|
17
|
+
return plugin(({ addComponents, theme }) => {
|
|
18
|
+
const mobile = {
|
|
19
|
+
'.max-container-width': {
|
|
20
|
+
maxWidth: theme('container.md'),
|
|
21
|
+
},
|
|
22
|
+
'.px-container': {
|
|
23
|
+
paddingLeft: theme('spacing.4'),
|
|
24
|
+
paddingRight: theme('spacing.4'),
|
|
25
|
+
},
|
|
26
|
+
'.py-container': {
|
|
27
|
+
paddingTop: theme('spacing.16'),
|
|
28
|
+
paddingBottom: theme('spacing.16'),
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const medium = {
|
|
33
|
+
[`@media (min-width: ${theme('screens.sm',)})`]: {
|
|
34
|
+
'.max-container-width': {
|
|
35
|
+
maxWidth: theme('container.5xl'),
|
|
36
|
+
},
|
|
37
|
+
'.px-container': {
|
|
38
|
+
paddingLeft: theme('spacing.10'),
|
|
39
|
+
paddingRight: theme('spacing.10'),
|
|
40
|
+
},
|
|
41
|
+
'.py-container': {
|
|
42
|
+
paddingTop: theme('spacing.32'),
|
|
43
|
+
paddingBottom: theme('spacing.32'),
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const large = {
|
|
49
|
+
[`@media (max-width: ${theme('screens.xl',)})`]: {
|
|
50
|
+
'.max-container-width': {
|
|
51
|
+
maxWidth: theme('container.7xl'),
|
|
52
|
+
},
|
|
53
|
+
'.px-container': {
|
|
54
|
+
paddingLeft: theme('spacing.0'),
|
|
55
|
+
paddingRight: theme('spacing.0'),
|
|
56
|
+
},
|
|
57
|
+
'.py-container': {
|
|
58
|
+
paddingTop: theme('spacing.48'),
|
|
59
|
+
paddingBottom: theme('spacing.48'),
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
addComponents(mobile);
|
|
65
|
+
addComponents(medium);
|
|
66
|
+
addComponents(large);
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export default containers;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declarative spacing tokens (mobile-first).
|
|
3
|
+
*
|
|
4
|
+
* Each value maps to two utilities: `.gap-<key>` and `.p-<key>`, both backed
|
|
5
|
+
* by the same CSS variable. Values ported from `spacings.js`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const spacingsData = {
|
|
9
|
+
'spacing-elements-xxl': { _: '2rem', sm: '4rem', xl: '6rem' },
|
|
10
|
+
'spacing-elements-xl': { _: '1.5rem', sm: '2rem', xl: '3rem' },
|
|
11
|
+
'spacing-elements-lg': { _: '1rem', sm: '1.5rem' },
|
|
12
|
+
'spacing-elements-md': { _: '1rem' },
|
|
13
|
+
'spacing-elements-sm': { _: '0.75rem' },
|
|
14
|
+
'spacing-elements-xs': { _: '0.5rem' },
|
|
15
|
+
'spacing-elements-xxs': { _: '0.25rem' },
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default { spacingsData };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// TODO: deprecated — substituído pelos tokens declarativos em
|
|
2
|
+
// `spacings.data.js` e pelo CSS gerado em `dist/globals.css` via
|
|
3
|
+
// `src/scripts/build-tokens.mjs`. Remover quando consumers migrarem.
|
|
4
|
+
const plugin = (() => {
|
|
5
|
+
try {
|
|
6
|
+
return require('tailwindcss/plugin');
|
|
7
|
+
} catch {
|
|
8
|
+
return (handler) => handler;
|
|
9
|
+
}
|
|
10
|
+
})();
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Generate semantic spacing components
|
|
14
|
+
* @returns {import('tailwindcss/plugin').Plugin}
|
|
15
|
+
*/
|
|
16
|
+
export const spacingElements = () => {
|
|
17
|
+
return plugin(({ addComponents, theme }) => {
|
|
18
|
+
const mobile = {
|
|
19
|
+
'.gap-spacing-elements-xxl': {
|
|
20
|
+
gap: theme('spacing.8'),
|
|
21
|
+
},
|
|
22
|
+
'.gap-spacing-elements-xl': {
|
|
23
|
+
gap: theme('spacing.6'),
|
|
24
|
+
},
|
|
25
|
+
'.gap-spacing-elements-lg': {
|
|
26
|
+
gap: theme('spacing.4'),
|
|
27
|
+
},
|
|
28
|
+
'.gap-spacing-elements-md': {
|
|
29
|
+
gap: theme('spacing.4'),
|
|
30
|
+
},
|
|
31
|
+
'.gap-spacing-elements-sm': {
|
|
32
|
+
gap: theme('spacing.3'),
|
|
33
|
+
},
|
|
34
|
+
'.gap-spacing-elements-xs': {
|
|
35
|
+
gap: theme('spacing.2'),
|
|
36
|
+
},
|
|
37
|
+
'.gap-spacing-elements-xxs': {
|
|
38
|
+
gap: theme('spacing.1'),
|
|
39
|
+
},
|
|
40
|
+
'.p-spacing-elements-xxl': {
|
|
41
|
+
padding: theme('spacing.8'),
|
|
42
|
+
},
|
|
43
|
+
'.p-spacing-elements-xl': {
|
|
44
|
+
padding: theme('spacing.6'),
|
|
45
|
+
},
|
|
46
|
+
'.p-spacing-elements-lg': {
|
|
47
|
+
padding: theme('spacing.4'),
|
|
48
|
+
},
|
|
49
|
+
'.p-spacing-elements-md': {
|
|
50
|
+
padding: theme('spacing.4'),
|
|
51
|
+
},
|
|
52
|
+
'.p-spacing-elements-sm': {
|
|
53
|
+
padding: theme('spacing.3'),
|
|
54
|
+
},
|
|
55
|
+
'.p-spacing-elements-xs': {
|
|
56
|
+
padding: theme('spacing.2'),
|
|
57
|
+
},
|
|
58
|
+
'.p-spacing-elements-xxs': {
|
|
59
|
+
padding: theme('spacing.1'),
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const medium = {
|
|
64
|
+
[`@media (min-width: ${theme('screens.sm')})`]: {
|
|
65
|
+
'.gap-spacing-elements-xxl': {
|
|
66
|
+
gap: theme('spacing.16'),
|
|
67
|
+
},
|
|
68
|
+
'.gap-spacing-elements-xl': {
|
|
69
|
+
gap: theme('spacing.8'),
|
|
70
|
+
},
|
|
71
|
+
'.gap-spacing-elements-lg': {
|
|
72
|
+
gap: theme('spacing.6'),
|
|
73
|
+
},
|
|
74
|
+
'.gap-spacing-elements-md': {
|
|
75
|
+
gap: theme('spacing.4'),
|
|
76
|
+
},
|
|
77
|
+
'.gap-spacing-elements-sm': {
|
|
78
|
+
gap: theme('spacing.3'),
|
|
79
|
+
},
|
|
80
|
+
'.gap-spacing-elements-xs': {
|
|
81
|
+
gap: theme('spacing.2'),
|
|
82
|
+
},
|
|
83
|
+
'.gap-spacing-elements-xxs': {
|
|
84
|
+
gap: theme('spacing.1'),
|
|
85
|
+
},
|
|
86
|
+
'.p-spacing-elements-xxl': {
|
|
87
|
+
padding: theme('spacing.16'),
|
|
88
|
+
},
|
|
89
|
+
'.p-spacing-elements-xl': {
|
|
90
|
+
padding: theme('spacing.8'),
|
|
91
|
+
},
|
|
92
|
+
'.p-spacing-elements-lg': {
|
|
93
|
+
padding: theme('spacing.6'),
|
|
94
|
+
},
|
|
95
|
+
'.p-spacing-elements-md': {
|
|
96
|
+
padding: theme('spacing.4'),
|
|
97
|
+
},
|
|
98
|
+
'.p-spacing-elements-sm': {
|
|
99
|
+
padding: theme('spacing.3'),
|
|
100
|
+
},
|
|
101
|
+
'.p-spacing-elements-xs': {
|
|
102
|
+
padding: theme('spacing.2'),
|
|
103
|
+
},
|
|
104
|
+
'.p-spacing-elements-xxs': {
|
|
105
|
+
padding: theme('spacing.1'),
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const large = {
|
|
111
|
+
[`@media (min-width: ${theme('screens.xl')})`]: {
|
|
112
|
+
'.gap-spacing-elements-xxl': {
|
|
113
|
+
gap: theme('spacing.24'),
|
|
114
|
+
},
|
|
115
|
+
'.gap-spacing-elements-xl': {
|
|
116
|
+
gap: theme('spacing.12'),
|
|
117
|
+
},
|
|
118
|
+
'.gap-spacing-elements-lg': {
|
|
119
|
+
gap: theme('spacing.6'),
|
|
120
|
+
},
|
|
121
|
+
'.gap-spacing-elements-md': {
|
|
122
|
+
gap: theme('spacing.4'),
|
|
123
|
+
},
|
|
124
|
+
'.gap-spacing-elements-sm': {
|
|
125
|
+
gap: theme('spacing.3'),
|
|
126
|
+
},
|
|
127
|
+
'.gap-spacing-elements-xs': {
|
|
128
|
+
gap: theme('spacing.2'),
|
|
129
|
+
},
|
|
130
|
+
'.gap-spacing-elements-xxs': {
|
|
131
|
+
gap: theme('spacing.1'),
|
|
132
|
+
},
|
|
133
|
+
'.p-spacing-elements-xxl': {
|
|
134
|
+
padding: theme('spacing.24'),
|
|
135
|
+
},
|
|
136
|
+
'.p-spacing-elements-xl': {
|
|
137
|
+
padding: theme('spacing.12'),
|
|
138
|
+
},
|
|
139
|
+
'.p-spacing-elements-lg': {
|
|
140
|
+
padding: theme('spacing.6'),
|
|
141
|
+
},
|
|
142
|
+
'.p-spacing-elements-md': {
|
|
143
|
+
padding: theme('spacing.4'),
|
|
144
|
+
},
|
|
145
|
+
'.p-spacing-elements-sm': {
|
|
146
|
+
padding: theme('spacing.3'),
|
|
147
|
+
},
|
|
148
|
+
'.p-spacing-elements-xs': {
|
|
149
|
+
padding: theme('spacing.2'),
|
|
150
|
+
},
|
|
151
|
+
'.p-spacing-elements-xxs': {
|
|
152
|
+
padding: theme('spacing.1'),
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
addComponents(mobile);
|
|
158
|
+
addComponents(medium);
|
|
159
|
+
addComponents(large);
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export default spacingElements;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declarative text style tokens (mobile-first).
|
|
3
|
+
*
|
|
4
|
+
* Each entry is a bundle of CSS properties; each property is either a string
|
|
5
|
+
* (static) or a breakpoint map `{ _, sm, md, lg, xl, 2xl }`. Values ported
|
|
6
|
+
* from the legacy `texts.js` plugin — direction inverted from desktop-first
|
|
7
|
+
* (max-width) to mobile-first (min-width).
|
|
8
|
+
*
|
|
9
|
+
* Mapping used during the port:
|
|
10
|
+
* old `large` (≤640) → `_`
|
|
11
|
+
* old `medium` (≤768) → `sm` (≥640)
|
|
12
|
+
* old `mobile` (default, applied >768) → `md` (≥768)
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export const textsData = {
|
|
16
|
+
'text-big-number-md': {
|
|
17
|
+
fontSize: { _: '1.25rem', sm: '1.5rem', md: '2.25rem' },
|
|
18
|
+
lineHeight: '1.20',
|
|
19
|
+
},
|
|
20
|
+
'text-big-number-sm': {
|
|
21
|
+
fontSize: { _: '1rem', sm: '1.25rem' },
|
|
22
|
+
lineHeight: '1.20',
|
|
23
|
+
},
|
|
24
|
+
'text-big-number-lg': {
|
|
25
|
+
fontSize: { _: '1.5rem', sm: '2.25rem', md: '3.75rem' },
|
|
26
|
+
lineHeight: '1.20',
|
|
27
|
+
},
|
|
28
|
+
'text-heading-2xl': {
|
|
29
|
+
fontSize: { _: '1.875rem', sm: '3rem', md: '3.75rem' },
|
|
30
|
+
lineHeight: '1.2',
|
|
31
|
+
},
|
|
32
|
+
'text-heading-xl': {
|
|
33
|
+
fontSize: { _: '1.25rem', sm: '1.875rem', md: '2.25rem' },
|
|
34
|
+
lineHeight: '1.2',
|
|
35
|
+
},
|
|
36
|
+
'text-heading-lg': {
|
|
37
|
+
fontSize: { _: '1.125rem', md: '1.875rem' },
|
|
38
|
+
lineHeight: '1.2',
|
|
39
|
+
},
|
|
40
|
+
'text-heading-md': {
|
|
41
|
+
fontSize: { _: '1rem', sm: '1.25rem', md: '1.5rem' },
|
|
42
|
+
lineHeight: '1.2',
|
|
43
|
+
},
|
|
44
|
+
'text-heading-sm': {
|
|
45
|
+
fontSize: { _: '0.875rem', sm: '1rem', md: '1.125rem' },
|
|
46
|
+
lineHeight: '1.2',
|
|
47
|
+
},
|
|
48
|
+
'text-body-lg': {
|
|
49
|
+
fontSize: { _: '1rem', md: '1.125rem' },
|
|
50
|
+
lineHeight: '1.5',
|
|
51
|
+
},
|
|
52
|
+
'text-body-md': {
|
|
53
|
+
fontSize: '1rem',
|
|
54
|
+
lineHeight: '1.5',
|
|
55
|
+
},
|
|
56
|
+
'text-body-sm': {
|
|
57
|
+
fontSize: '0.875rem',
|
|
58
|
+
lineHeight: '1.5',
|
|
59
|
+
},
|
|
60
|
+
'text-body-xs': {
|
|
61
|
+
fontSize: '0.75rem',
|
|
62
|
+
lineHeight: '1.5',
|
|
63
|
+
},
|
|
64
|
+
'text-body-xss': {
|
|
65
|
+
fontSize: '0.625rem',
|
|
66
|
+
lineHeight: '1.5',
|
|
67
|
+
},
|
|
68
|
+
'text-overline-md': {
|
|
69
|
+
fontSize: { _: '0.75rem', sm: '0.875rem' },
|
|
70
|
+
lineHeight: '1.4',
|
|
71
|
+
letterSpacing: '0.08em',
|
|
72
|
+
textTransform: 'uppercase',
|
|
73
|
+
},
|
|
74
|
+
'text-overline-sm': {
|
|
75
|
+
fontSize: '0.75rem',
|
|
76
|
+
lineHeight: '1.4',
|
|
77
|
+
letterSpacing: '0.08em',
|
|
78
|
+
textTransform: 'uppercase',
|
|
79
|
+
},
|
|
80
|
+
'text-overline-xs': {
|
|
81
|
+
fontSize: '0.625rem',
|
|
82
|
+
lineHeight: '1.4',
|
|
83
|
+
letterSpacing: '0.08em',
|
|
84
|
+
textTransform: 'uppercase',
|
|
85
|
+
},
|
|
86
|
+
'text-button-lg': {
|
|
87
|
+
fontFamily: 'Proto Mono',
|
|
88
|
+
fontSize: '0.875rem',
|
|
89
|
+
fontWeight: '600',
|
|
90
|
+
lineHeight: '1',
|
|
91
|
+
letterSpacing: '0',
|
|
92
|
+
},
|
|
93
|
+
'text-button-md': {
|
|
94
|
+
fontFamily: 'Proto Mono',
|
|
95
|
+
fontSize: '0.75rem',
|
|
96
|
+
fontWeight: '600',
|
|
97
|
+
lineHeight: '1',
|
|
98
|
+
letterSpacing: '0',
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
export default { textsData };
|