@antebudimir/eslint-plugin-vanilla-extract 1.15.0 → 1.16.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 +73 -4
- package/dist/css-rules/no-empty-blocks/empty-style-visitor-creator.js +8 -2
- package/dist/css-rules/no-empty-blocks/recipe-processor.js +23 -3
- package/dist/css-rules/no-trailing-zero/index.d.ts +2 -1
- package/dist/css-rules/no-trailing-zero/index.js +2 -1
- package/dist/css-rules/no-unitless-values/_tests_/no-unitless-values.test.d.ts +1 -0
- package/dist/css-rules/no-unitless-values/_tests_/no-unitless-values.test.js +444 -0
- package/dist/css-rules/no-unitless-values/index.d.ts +2 -0
- package/dist/css-rules/no-unitless-values/index.js +2 -0
- package/dist/css-rules/no-unitless-values/rule-definition.d.ts +3 -0
- package/dist/css-rules/no-unitless-values/rule-definition.js +35 -0
- package/dist/css-rules/no-unitless-values/unitless-value-processor.d.ts +13 -0
- package/dist/css-rules/no-unitless-values/unitless-value-processor.js +330 -0
- package/dist/css-rules/no-unitless-values/unitless-value-visitor-creator.d.ts +11 -0
- package/dist/css-rules/{no-px-unit/visitor-creator.js → no-unitless-values/unitless-value-visitor-creator.js} +26 -13
- package/dist/css-rules/shared-utils/empty-object-processor.d.ts +5 -0
- package/dist/css-rules/shared-utils/empty-object-processor.js +11 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/package.json +2 -1
- package/dist/css-rules/no-px-unit/no-px-unit-visitor-creator.d.ts +0 -2
- package/dist/css-rules/no-px-unit/no-px-unit-visitor-creator.js +0 -55
- package/dist/css-rules/no-px-unit/processor.d.ts +0 -3
- package/dist/css-rules/no-px-unit/processor.js +0 -93
- package/dist/css-rules/no-px-unit/visitor-creator.d.ts +0 -2
- package/dist/demo-bad-example.css.d.ts +0 -4
- package/dist/demo-bad-example.css.js +0 -45
- package/dist/demo-good-example.css.d.ts +0 -5
- package/dist/demo-good-example.css.js +0 -48
- package/dist/demo-theme.css.d.ts +0 -37
- package/dist/demo-theme.css.js +0 -39
- package/dist/sample-bad.css.d.ts +0 -26
- package/dist/sample-bad.css.js +0 -85
- package/dist/sample-good.css.d.ts +0 -27
- package/dist/sample-good.css.js +0 -94
- package/dist/sample-theme.css.d.ts +0 -37
- package/dist/sample-theme.css.js +0 -38
- package/dist/sample.css.d.ts +0 -75
- package/dist/sample.css.js +0 -530
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { style } from '@vanilla-extract/css';
|
|
2
|
-
// This file has hard-coded values that will trigger eslint errors
|
|
3
|
-
// when the prefer-theme-tokens rule is enabled
|
|
4
|
-
export const button = style({
|
|
5
|
-
// ❌ Hard-coded color - should use theme.colors.text
|
|
6
|
-
color: '#ffffff',
|
|
7
|
-
// ❌ Hard-coded color - should use theme.colors.primary
|
|
8
|
-
backgroundColor: '#3b82f6',
|
|
9
|
-
// ❌ Hard-coded spacing - should use theme.spacing
|
|
10
|
-
padding: '12px 24px',
|
|
11
|
-
// ❌ Hard-coded font size - should use theme.fontSizes
|
|
12
|
-
fontSize: '14px',
|
|
13
|
-
// ❌ Hard-coded border radius - should use theme.radii
|
|
14
|
-
borderRadius: '6px',
|
|
15
|
-
// ❌ Hard-coded color in border
|
|
16
|
-
border: '1px solid #e5e7eb',
|
|
17
|
-
});
|
|
18
|
-
export const card = style({
|
|
19
|
-
// ❌ Multiple hard-coded colors
|
|
20
|
-
backgroundColor: 'white',
|
|
21
|
-
color: 'black',
|
|
22
|
-
// ❌ Hard-coded spacing values
|
|
23
|
-
padding: '16px',
|
|
24
|
-
margin: '8px',
|
|
25
|
-
gap: '12px',
|
|
26
|
-
// ❌ Hard-coded border radius
|
|
27
|
-
borderRadius: '8px',
|
|
28
|
-
});
|
|
29
|
-
export const text = style({
|
|
30
|
-
// ❌ Hard-coded font sizes
|
|
31
|
-
fontSize: '16px',
|
|
32
|
-
lineHeight: '24px',
|
|
33
|
-
// ❌ Hard-coded colors
|
|
34
|
-
color: 'rgb(31, 41, 55)',
|
|
35
|
-
});
|
|
36
|
-
export const container = style({
|
|
37
|
-
// ❌ Hard-coded spacing in multiple properties
|
|
38
|
-
marginTop: '20px',
|
|
39
|
-
paddingLeft: '16px',
|
|
40
|
-
paddingRight: '16px',
|
|
41
|
-
// ❌ Hard-coded width (though percentages are allowed)
|
|
42
|
-
width: '300px',
|
|
43
|
-
// ❌ Hard-coded color
|
|
44
|
-
borderColor: '#e5e7eb',
|
|
45
|
-
});
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { style } from '@vanilla-extract/css';
|
|
2
|
-
import { theme } from './demo-theme.css';
|
|
3
|
-
// This file uses theme tokens - no eslint errors!
|
|
4
|
-
export const button = style({
|
|
5
|
-
// ✅ Using theme tokens for colors
|
|
6
|
-
color: theme.colors.text,
|
|
7
|
-
backgroundColor: theme.colors.primary,
|
|
8
|
-
// ✅ Using theme tokens for spacing
|
|
9
|
-
padding: `${theme.spacing.sm} ${theme.spacing.md}`,
|
|
10
|
-
// ✅ Using theme tokens for font size
|
|
11
|
-
fontSize: theme.fontSizes.sm,
|
|
12
|
-
// ✅ Using theme tokens for border radius
|
|
13
|
-
borderRadius: theme.radii.md,
|
|
14
|
-
// ✅ Using theme tokens in border
|
|
15
|
-
border: `1px solid ${theme.colors.border}`,
|
|
16
|
-
});
|
|
17
|
-
export const card = style({
|
|
18
|
-
// ✅ All theme tokens
|
|
19
|
-
backgroundColor: theme.colors.background,
|
|
20
|
-
color: theme.colors.text,
|
|
21
|
-
padding: theme.spacing.md,
|
|
22
|
-
margin: theme.spacing.sm,
|
|
23
|
-
gap: theme.spacing.sm,
|
|
24
|
-
borderRadius: theme.radii.lg,
|
|
25
|
-
});
|
|
26
|
-
export const text = style({
|
|
27
|
-
// ✅ Theme tokens for typography
|
|
28
|
-
fontSize: theme.fontSizes.base,
|
|
29
|
-
lineHeight: theme.fontSizes.lg,
|
|
30
|
-
color: theme.colors.text,
|
|
31
|
-
});
|
|
32
|
-
export const container = style({
|
|
33
|
-
// ✅ Theme tokens for spacing
|
|
34
|
-
marginTop: theme.spacing.lg,
|
|
35
|
-
paddingLeft: theme.spacing.md,
|
|
36
|
-
paddingRight: theme.spacing.md,
|
|
37
|
-
// ✅ Percentages are allowed by default
|
|
38
|
-
width: '100%',
|
|
39
|
-
// ✅ Theme token for color
|
|
40
|
-
borderColor: theme.colors.border,
|
|
41
|
-
});
|
|
42
|
-
export const allowedValues = style({
|
|
43
|
-
// ✅ These special values are allowed by default
|
|
44
|
-
margin: '0', // Zero is allowed
|
|
45
|
-
padding: 'auto', // Auto is allowed
|
|
46
|
-
width: '100%', // Percentages are allowed
|
|
47
|
-
height: 'inherit', // CSS keywords are allowed
|
|
48
|
-
});
|
package/dist/demo-theme.css.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export declare const themeClass: string, theme: {
|
|
2
|
-
colors: {
|
|
3
|
-
primary: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
4
|
-
secondary: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
5
|
-
background: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
6
|
-
text: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
7
|
-
error: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
8
|
-
success: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
9
|
-
warning: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
10
|
-
hover: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
11
|
-
border: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
12
|
-
};
|
|
13
|
-
spacing: {
|
|
14
|
-
xs: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
15
|
-
sm: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
16
|
-
md: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
17
|
-
lg: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
18
|
-
xl: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
19
|
-
'2xl': `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
20
|
-
};
|
|
21
|
-
fontSizes: {
|
|
22
|
-
xs: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
23
|
-
sm: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
24
|
-
base: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
25
|
-
lg: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
26
|
-
xl: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
27
|
-
'2xl': `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
28
|
-
'3xl': `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
29
|
-
};
|
|
30
|
-
radii: {
|
|
31
|
-
none: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
32
|
-
sm: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
33
|
-
md: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
34
|
-
lg: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
35
|
-
full: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
36
|
-
};
|
|
37
|
-
};
|
package/dist/demo-theme.css.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { createTheme } from '@vanilla-extract/css';
|
|
2
|
-
// Create a theme with design tokens
|
|
3
|
-
export const [themeClass, theme] = createTheme({
|
|
4
|
-
colors: {
|
|
5
|
-
primary: '#3b82f6',
|
|
6
|
-
secondary: '#8b5cf6',
|
|
7
|
-
background: '#ffffff',
|
|
8
|
-
text: '#1f2937',
|
|
9
|
-
error: '#ef4444',
|
|
10
|
-
success: '#10b981',
|
|
11
|
-
warning: '#f59e0b',
|
|
12
|
-
hover: '#2563eb',
|
|
13
|
-
border: '#e5e7eb',
|
|
14
|
-
},
|
|
15
|
-
spacing: {
|
|
16
|
-
xs: '0.25rem',
|
|
17
|
-
sm: '0.5rem',
|
|
18
|
-
md: '1rem',
|
|
19
|
-
lg: '1.5rem',
|
|
20
|
-
xl: '2rem',
|
|
21
|
-
'2xl': '3rem',
|
|
22
|
-
},
|
|
23
|
-
fontSizes: {
|
|
24
|
-
xs: '0.75rem',
|
|
25
|
-
sm: '0.875rem',
|
|
26
|
-
base: '1rem',
|
|
27
|
-
lg: '1.125rem',
|
|
28
|
-
xl: '1.25rem',
|
|
29
|
-
'2xl': '1.5rem',
|
|
30
|
-
'3xl': '1.875rem',
|
|
31
|
-
},
|
|
32
|
-
radii: {
|
|
33
|
-
none: '0',
|
|
34
|
-
sm: '0.125rem',
|
|
35
|
-
md: '0.375rem',
|
|
36
|
-
lg: '0.5rem',
|
|
37
|
-
full: '9999px',
|
|
38
|
-
},
|
|
39
|
-
});
|
package/dist/sample-bad.css.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export declare const badButton: string;
|
|
2
|
-
export declare const badCard: string;
|
|
3
|
-
export declare const badText: string;
|
|
4
|
-
export declare const badBox: string;
|
|
5
|
-
export declare const badComponent: string;
|
|
6
|
-
export declare const badRecipe: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
7
|
-
size: {
|
|
8
|
-
small: {
|
|
9
|
-
fontSize: "12px";
|
|
10
|
-
padding: "8px";
|
|
11
|
-
};
|
|
12
|
-
large: {
|
|
13
|
-
fontSize: "18px";
|
|
14
|
-
padding: "24px";
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
variant: {
|
|
18
|
-
primary: {
|
|
19
|
-
backgroundColor: "#3b82f6";
|
|
20
|
-
};
|
|
21
|
-
danger: {
|
|
22
|
-
backgroundColor: "#ef4444";
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
}>;
|
|
26
|
-
export declare const badResponsive: string;
|
package/dist/sample-bad.css.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { style, globalStyle } from '@vanilla-extract/css';
|
|
2
|
-
import { recipe } from '@vanilla-extract/recipes';
|
|
3
|
-
// ❌ BAD: Hard-coded colors
|
|
4
|
-
export const badButton = style({
|
|
5
|
-
color: '#ffffff', // Should use theme.colors.text
|
|
6
|
-
backgroundColor: '#3b82f6', // Should use theme.colors.primary
|
|
7
|
-
borderColor: 'rgb(59, 130, 246)', // Should use theme.colors.primary
|
|
8
|
-
});
|
|
9
|
-
// ❌ BAD: Hard-coded spacing
|
|
10
|
-
export const badCard = style({
|
|
11
|
-
padding: '16px', // Should use theme.spacing.md
|
|
12
|
-
margin: '8px', // Should use theme.spacing.sm
|
|
13
|
-
gap: '12px', // Should use theme.spacing between sm and md
|
|
14
|
-
width: '200px', // Should use theme or percentage
|
|
15
|
-
});
|
|
16
|
-
// ❌ BAD: Hard-coded font sizes
|
|
17
|
-
export const badText = style({
|
|
18
|
-
fontSize: '14px', // Should use theme.fontSizes.sm
|
|
19
|
-
lineHeight: '1.5rem', // Should use theme.fontSizes
|
|
20
|
-
});
|
|
21
|
-
// ❌ BAD: Hard-coded border radius
|
|
22
|
-
export const badBox = style({
|
|
23
|
-
borderRadius: '8px', // Should use theme.radii.md
|
|
24
|
-
borderTopLeftRadius: '4px', // Should use theme.radii.sm
|
|
25
|
-
});
|
|
26
|
-
// ❌ BAD: Multiple violations
|
|
27
|
-
export const badComponent = style({
|
|
28
|
-
color: 'red', // Hard-coded color
|
|
29
|
-
backgroundColor: '#f0f0f0', // Hard-coded color
|
|
30
|
-
padding: '20px', // Hard-coded spacing
|
|
31
|
-
margin: '10px 15px', // Hard-coded spacing
|
|
32
|
-
fontSize: '16px', // Hard-coded font size
|
|
33
|
-
borderRadius: '6px', // Hard-coded border radius
|
|
34
|
-
border: '1px solid #ccc', // Hard-coded color in border
|
|
35
|
-
});
|
|
36
|
-
// ❌ BAD: Recipe with hard-coded values
|
|
37
|
-
export const badRecipe = recipe({
|
|
38
|
-
base: {
|
|
39
|
-
color: '#000000', // Hard-coded color
|
|
40
|
-
padding: '12px', // Hard-coded spacing
|
|
41
|
-
},
|
|
42
|
-
variants: {
|
|
43
|
-
size: {
|
|
44
|
-
small: {
|
|
45
|
-
fontSize: '12px', // Hard-coded font size
|
|
46
|
-
padding: '8px', // Hard-coded spacing
|
|
47
|
-
},
|
|
48
|
-
large: {
|
|
49
|
-
fontSize: '18px', // Hard-coded font size
|
|
50
|
-
padding: '24px', // Hard-coded spacing
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
variant: {
|
|
54
|
-
primary: {
|
|
55
|
-
backgroundColor: '#3b82f6', // Hard-coded color
|
|
56
|
-
},
|
|
57
|
-
danger: {
|
|
58
|
-
backgroundColor: '#ef4444', // Hard-coded color
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
// ❌ BAD: Nested structures with hard-coded values
|
|
64
|
-
export const badResponsive = style({
|
|
65
|
-
color: '#333',
|
|
66
|
-
'@media': {
|
|
67
|
-
'(min-width: 768px)': {
|
|
68
|
-
padding: '32px', // Hard-coded spacing
|
|
69
|
-
fontSize: '20px', // Hard-coded font size
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
selectors: {
|
|
73
|
-
'&:hover': {
|
|
74
|
-
backgroundColor: '#e0e0e0', // Hard-coded color
|
|
75
|
-
borderColor: 'blue', // Hard-coded color
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
// ❌ BAD: Global styles with hard-coded values
|
|
80
|
-
globalStyle('body', {
|
|
81
|
-
color: '#1f2937', // Hard-coded color
|
|
82
|
-
backgroundColor: '#ffffff', // Hard-coded color
|
|
83
|
-
margin: '0px', // Hard-coded spacing (though 0 is often allowed)
|
|
84
|
-
padding: '0px', // Hard-coded spacing
|
|
85
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export declare const goodButton: string;
|
|
2
|
-
export declare const goodCard: string;
|
|
3
|
-
export declare const goodText: string;
|
|
4
|
-
export declare const goodBox: string;
|
|
5
|
-
export declare const goodComponent: string;
|
|
6
|
-
export declare const goodRecipe: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
7
|
-
size: {
|
|
8
|
-
small: {
|
|
9
|
-
fontSize: any;
|
|
10
|
-
padding: any;
|
|
11
|
-
};
|
|
12
|
-
large: {
|
|
13
|
-
fontSize: any;
|
|
14
|
-
padding: any;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
variant: {
|
|
18
|
-
primary: {
|
|
19
|
-
backgroundColor: any;
|
|
20
|
-
};
|
|
21
|
-
danger: {
|
|
22
|
-
backgroundColor: any;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
}>;
|
|
26
|
-
export declare const goodResponsive: string;
|
|
27
|
-
export declare const goodMixed: string;
|
package/dist/sample-good.css.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { style, globalStyle } from '@vanilla-extract/css';
|
|
2
|
-
import { recipe } from '@vanilla-extract/recipes';
|
|
3
|
-
import { theme } from './sample-theme.css';
|
|
4
|
-
// ✅ GOOD: Using theme tokens for colors
|
|
5
|
-
export const goodButton = style({
|
|
6
|
-
color: theme.colors.text,
|
|
7
|
-
backgroundColor: theme.colors.primary,
|
|
8
|
-
borderColor: theme.colors.border,
|
|
9
|
-
});
|
|
10
|
-
// ✅ GOOD: Using theme tokens for spacing
|
|
11
|
-
export const goodCard = style({
|
|
12
|
-
padding: theme.spacing.md,
|
|
13
|
-
margin: theme.spacing.sm,
|
|
14
|
-
gap: theme.spacing.md,
|
|
15
|
-
width: '100%', // Percentages are allowed
|
|
16
|
-
});
|
|
17
|
-
// ✅ GOOD: Using theme tokens for font sizes
|
|
18
|
-
export const goodText = style({
|
|
19
|
-
fontSize: theme.fontSizes.sm,
|
|
20
|
-
lineHeight: theme.fontSizes.base,
|
|
21
|
-
});
|
|
22
|
-
// ✅ GOOD: Using theme tokens for border radius
|
|
23
|
-
export const goodBox = style({
|
|
24
|
-
borderRadius: theme.radii.md,
|
|
25
|
-
borderTopLeftRadius: theme.radii.sm,
|
|
26
|
-
});
|
|
27
|
-
// ✅ GOOD: All theme tokens
|
|
28
|
-
export const goodComponent = style({
|
|
29
|
-
color: theme.colors.text,
|
|
30
|
-
backgroundColor: theme.colors.background,
|
|
31
|
-
padding: theme.spacing.lg,
|
|
32
|
-
margin: `${theme.spacing.sm} ${theme.spacing.md}`,
|
|
33
|
-
fontSize: theme.fontSizes.base,
|
|
34
|
-
borderRadius: theme.radii.md,
|
|
35
|
-
border: `1px solid ${theme.colors.border}`,
|
|
36
|
-
});
|
|
37
|
-
// ✅ GOOD: Recipe with theme tokens
|
|
38
|
-
export const goodRecipe = recipe({
|
|
39
|
-
base: {
|
|
40
|
-
color: theme.colors.text,
|
|
41
|
-
padding: theme.spacing.md,
|
|
42
|
-
},
|
|
43
|
-
variants: {
|
|
44
|
-
size: {
|
|
45
|
-
small: {
|
|
46
|
-
fontSize: theme.fontSizes.sm,
|
|
47
|
-
padding: theme.spacing.sm,
|
|
48
|
-
},
|
|
49
|
-
large: {
|
|
50
|
-
fontSize: theme.fontSizes.xl,
|
|
51
|
-
padding: theme.spacing.xl,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
variant: {
|
|
55
|
-
primary: {
|
|
56
|
-
backgroundColor: theme.colors.primary,
|
|
57
|
-
},
|
|
58
|
-
danger: {
|
|
59
|
-
backgroundColor: theme.colors.error,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
// ✅ GOOD: Nested structures with theme tokens
|
|
65
|
-
export const goodResponsive = style({
|
|
66
|
-
color: theme.colors.text,
|
|
67
|
-
'@media': {
|
|
68
|
-
'(min-width: 768px)': {
|
|
69
|
-
padding: theme.spacing['2xl'],
|
|
70
|
-
fontSize: theme.fontSizes['2xl'],
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
selectors: {
|
|
74
|
-
'&:hover': {
|
|
75
|
-
backgroundColor: theme.colors.hover,
|
|
76
|
-
borderColor: theme.colors.primary,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
// ✅ GOOD: Global styles with theme tokens
|
|
81
|
-
globalStyle('body', {
|
|
82
|
-
color: theme.colors.text,
|
|
83
|
-
backgroundColor: theme.colors.background,
|
|
84
|
-
margin: '0', // Special values like '0' are allowed
|
|
85
|
-
padding: '0',
|
|
86
|
-
});
|
|
87
|
-
// ✅ GOOD: Mixed with allowed values
|
|
88
|
-
export const goodMixed = style({
|
|
89
|
-
color: theme.colors.text,
|
|
90
|
-
margin: '0', // '0' is allowed
|
|
91
|
-
padding: 'auto', // 'auto' is allowed
|
|
92
|
-
width: '100%', // Percentages are allowed
|
|
93
|
-
height: 'inherit', // CSS keywords are allowed
|
|
94
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export declare const themeClass: string, theme: {
|
|
2
|
-
colors: {
|
|
3
|
-
primary: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
4
|
-
secondary: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
5
|
-
background: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
6
|
-
text: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
7
|
-
error: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
8
|
-
success: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
9
|
-
warning: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
10
|
-
hover: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
11
|
-
border: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
12
|
-
};
|
|
13
|
-
spacing: {
|
|
14
|
-
xs: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
15
|
-
sm: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
16
|
-
md: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
17
|
-
lg: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
18
|
-
xl: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
19
|
-
'2xl': `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
20
|
-
};
|
|
21
|
-
fontSizes: {
|
|
22
|
-
xs: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
23
|
-
sm: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
24
|
-
base: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
25
|
-
lg: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
26
|
-
xl: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
27
|
-
'2xl': `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
28
|
-
'3xl': `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
29
|
-
};
|
|
30
|
-
radii: {
|
|
31
|
-
none: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
32
|
-
sm: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
33
|
-
md: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
34
|
-
lg: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
35
|
-
full: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
36
|
-
};
|
|
37
|
-
};
|
package/dist/sample-theme.css.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { createTheme } from '@vanilla-extract/css';
|
|
2
|
-
export const [themeClass, theme] = createTheme({
|
|
3
|
-
colors: {
|
|
4
|
-
primary: '#3b82f6',
|
|
5
|
-
secondary: '#8b5cf6',
|
|
6
|
-
background: '#ffffff',
|
|
7
|
-
text: '#1f2937',
|
|
8
|
-
error: '#ef4444',
|
|
9
|
-
success: '#10b981',
|
|
10
|
-
warning: '#f59e0b',
|
|
11
|
-
hover: '#2563eb',
|
|
12
|
-
border: '#e5e7eb',
|
|
13
|
-
},
|
|
14
|
-
spacing: {
|
|
15
|
-
xs: '0.25rem',
|
|
16
|
-
sm: '0.5rem',
|
|
17
|
-
md: '1rem',
|
|
18
|
-
lg: '1.5rem',
|
|
19
|
-
xl: '2rem',
|
|
20
|
-
'2xl': '3rem',
|
|
21
|
-
},
|
|
22
|
-
fontSizes: {
|
|
23
|
-
xs: '0.75rem',
|
|
24
|
-
sm: '0.875rem',
|
|
25
|
-
base: '1rem',
|
|
26
|
-
lg: '1.125rem',
|
|
27
|
-
xl: '1.25rem',
|
|
28
|
-
'2xl': '1.5rem',
|
|
29
|
-
'3xl': '1.875rem',
|
|
30
|
-
},
|
|
31
|
-
radii: {
|
|
32
|
-
none: '0',
|
|
33
|
-
sm: '0.125rem',
|
|
34
|
-
md: '0.375rem',
|
|
35
|
-
lg: '0.5rem',
|
|
36
|
-
full: '9999px',
|
|
37
|
-
},
|
|
38
|
-
});
|
package/dist/sample.css.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
export declare const theFont: string;
|
|
2
|
-
export declare const spinster: void;
|
|
3
|
-
export declare const starter: string;
|
|
4
|
-
export declare const accordionContent: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
5
|
-
isOpen: {
|
|
6
|
-
false: {
|
|
7
|
-
boxSizing: "inherit";
|
|
8
|
-
position: "relative";
|
|
9
|
-
right: "inherit";
|
|
10
|
-
display: "flex";
|
|
11
|
-
gap: "revert";
|
|
12
|
-
transform: "none";
|
|
13
|
-
margin: "11rem";
|
|
14
|
-
outline: "none";
|
|
15
|
-
border: "Background";
|
|
16
|
-
borderRight: "ActiveBorder";
|
|
17
|
-
borderLeft: "ActiveBorder";
|
|
18
|
-
borderRadius: "initial";
|
|
19
|
-
borderBottomLeftRadius: "initial";
|
|
20
|
-
borderBottomRightRadius: "initial";
|
|
21
|
-
boxShadow: "none";
|
|
22
|
-
backgroundColor: "initial";
|
|
23
|
-
cursor: "pointer";
|
|
24
|
-
width: "100%";
|
|
25
|
-
color: "red";
|
|
26
|
-
fontSize: "large";
|
|
27
|
-
};
|
|
28
|
-
true: {
|
|
29
|
-
boxSizing: "inherit";
|
|
30
|
-
position: "relative";
|
|
31
|
-
right: "inherit";
|
|
32
|
-
display: "flex";
|
|
33
|
-
gap: "revert";
|
|
34
|
-
transform: "none";
|
|
35
|
-
margin: "11rem";
|
|
36
|
-
outline: "none";
|
|
37
|
-
border: "Background";
|
|
38
|
-
borderRight: "ActiveBorder";
|
|
39
|
-
borderLeft: "ActiveBorder";
|
|
40
|
-
borderRadius: "initial";
|
|
41
|
-
borderBottomLeftRadius: "initial";
|
|
42
|
-
borderBottomRightRadius: "initial";
|
|
43
|
-
boxShadow: "none";
|
|
44
|
-
backgroundColor: "initial";
|
|
45
|
-
cursor: "pointer";
|
|
46
|
-
width: "100%";
|
|
47
|
-
color: "red";
|
|
48
|
-
fontSize: "large";
|
|
49
|
-
':hover': {
|
|
50
|
-
boxSizing: "inherit";
|
|
51
|
-
position: "relative";
|
|
52
|
-
right: "inherit";
|
|
53
|
-
display: "flex";
|
|
54
|
-
gap: "revert";
|
|
55
|
-
transform: "none";
|
|
56
|
-
margin: "11rem";
|
|
57
|
-
outline: "none";
|
|
58
|
-
border: "Background";
|
|
59
|
-
borderRight: "ActiveBorder";
|
|
60
|
-
borderLeft: "ActiveBorder";
|
|
61
|
-
borderRadius: "initial";
|
|
62
|
-
borderBottomLeftRadius: "initial";
|
|
63
|
-
borderBottomRightRadius: "initial";
|
|
64
|
-
boxShadow: "none";
|
|
65
|
-
backgroundColor: "initial";
|
|
66
|
-
cursor: "pointer";
|
|
67
|
-
width: "100%";
|
|
68
|
-
color: "red";
|
|
69
|
-
fontSize: "large";
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
}>;
|
|
74
|
-
export declare const item: string;
|
|
75
|
-
export declare const selectButtonVariants: Record<"bordered" | "borderless", string>;
|