@mantine/vanilla-extract 7.13.5-alpha.0 → 7.13.5-alpha.2
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/cjs/index.cjs +8 -0
- package/cjs/index.cjs.map +1 -0
- package/cjs/theme-to-vars.cjs +118 -0
- package/cjs/theme-to-vars.cjs.map +1 -0
- package/esm/index.mjs +2 -0
- package/esm/index.mjs.map +1 -0
- package/esm/theme-to-vars.mjs +116 -0
- package/esm/theme-to-vars.mjs.map +1 -0
- package/lib/index.d.mts +2 -0
- package/lib/index.d.ts +2 -0
- package/lib/theme-to-vars.d.ts +3 -0
- package/lib/types.d.ts +90 -0
- package/package.json +2 -2
package/cjs/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@mantine/core');
|
|
4
|
+
|
|
5
|
+
function getSizesVariables(theme, themeKey, name) {
|
|
6
|
+
return Object.keys(theme[themeKey]).reduce((acc, size) => {
|
|
7
|
+
acc[size] = `var(--mantine-${name}-${size})`;
|
|
8
|
+
return acc;
|
|
9
|
+
}, {});
|
|
10
|
+
}
|
|
11
|
+
function getBreakpointValue(value, theme) {
|
|
12
|
+
return value in theme.breakpoints ? theme.breakpoints[value] : core.em(value);
|
|
13
|
+
}
|
|
14
|
+
function themeToVars(theme) {
|
|
15
|
+
const mergedTheme = core.mergeMantineTheme(core.DEFAULT_THEME, theme);
|
|
16
|
+
const fontSizes = getSizesVariables(mergedTheme, "fontSizes", "font-size");
|
|
17
|
+
const lineHeights = getSizesVariables(mergedTheme, "lineHeights", "line-height");
|
|
18
|
+
const shadows = getSizesVariables(mergedTheme, "shadows", "shadow");
|
|
19
|
+
const radius = getSizesVariables(mergedTheme, "radius", "radius");
|
|
20
|
+
const spacing = getSizesVariables(mergedTheme, "spacing", "spacing");
|
|
21
|
+
const headings = Object.keys(mergedTheme.headings.sizes).reduce(
|
|
22
|
+
(acc, heading) => {
|
|
23
|
+
acc[heading] = {
|
|
24
|
+
fontSize: `var(--mantine-${heading}-font-size)`,
|
|
25
|
+
lineHeight: `var(--mantine-${heading}-line-height)`,
|
|
26
|
+
fontWeight: `var(--mantine-${heading}-font-weight)`
|
|
27
|
+
};
|
|
28
|
+
return acc;
|
|
29
|
+
},
|
|
30
|
+
{}
|
|
31
|
+
);
|
|
32
|
+
const colors = Object.keys(mergedTheme.colors).reduce(
|
|
33
|
+
(acc, color) => {
|
|
34
|
+
acc[color] = {
|
|
35
|
+
0: `var(--mantine-color-${color}-0)`,
|
|
36
|
+
1: `var(--mantine-color-${color}-1)`,
|
|
37
|
+
2: `var(--mantine-color-${color}-2)`,
|
|
38
|
+
3: `var(--mantine-color-${color}-3)`,
|
|
39
|
+
4: `var(--mantine-color-${color}-4)`,
|
|
40
|
+
5: `var(--mantine-color-${color}-5)`,
|
|
41
|
+
6: `var(--mantine-color-${color}-6)`,
|
|
42
|
+
7: `var(--mantine-color-${color}-7)`,
|
|
43
|
+
8: `var(--mantine-color-${color}-8)`,
|
|
44
|
+
9: `var(--mantine-color-${color}-9)`,
|
|
45
|
+
filled: `var(--mantine-color-${color}-filled)`,
|
|
46
|
+
filledHover: `var(--mantine-color-${color}-filled-hover)`,
|
|
47
|
+
light: `var(--mantine-color-${color}-light)`,
|
|
48
|
+
lightHover: `var(--mantine-color-${color}-light-hover)`,
|
|
49
|
+
lightColor: `var(--mantine-color-${color}-light-color)`,
|
|
50
|
+
outline: `var(--mantine-color-${color}-outline)`,
|
|
51
|
+
outlineHover: `var(--mantine-color-${color}-outline-hover)`
|
|
52
|
+
};
|
|
53
|
+
return acc;
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
primary: "var(--mantine-primary-color-filled)",
|
|
57
|
+
primaryColors: {
|
|
58
|
+
0: "var(--mantine-primary-color-0)",
|
|
59
|
+
1: "var(--mantine-primary-color-1)",
|
|
60
|
+
2: "var(--mantine-primary-color-2)",
|
|
61
|
+
3: "var(--mantine-primary-color-3)",
|
|
62
|
+
4: "var(--mantine-primary-color-4)",
|
|
63
|
+
5: "var(--mantine-primary-color-5)",
|
|
64
|
+
6: "var(--mantine-primary-color-6)",
|
|
65
|
+
7: "var(--mantine-primary-color-7)",
|
|
66
|
+
8: "var(--mantine-primary-color-8)",
|
|
67
|
+
9: "var(--mantine-primary-color-9)",
|
|
68
|
+
filled: "var(--mantine-primary-color-filled)",
|
|
69
|
+
filledHover: "var(--mantine-primary-color-filled-hover)",
|
|
70
|
+
light: "var(--mantine-primary-color-light)",
|
|
71
|
+
lightHover: "var(--mantine-primary-color-light-hover)",
|
|
72
|
+
lightColor: "var(--mantine-primary-color-light-color)",
|
|
73
|
+
outline: "var(--mantine-primary-color-outline)",
|
|
74
|
+
outlineHover: "var(--mantine-primary-color-outline-hover)"
|
|
75
|
+
},
|
|
76
|
+
white: "var(--mantine-color-white)",
|
|
77
|
+
black: "var(--mantine-color-black)",
|
|
78
|
+
text: "var(--mantine-color-text)",
|
|
79
|
+
body: "var(--mantine-color-body)",
|
|
80
|
+
error: "var(--mantine-color-error)",
|
|
81
|
+
placeholder: "var(--mantine-color-placeholder)",
|
|
82
|
+
anchor: "var(--mantine-color-anchor)",
|
|
83
|
+
default: "var(--mantine-color-default)",
|
|
84
|
+
defaultHover: "var(--mantine-color-default-hover)",
|
|
85
|
+
defaultColor: "var(--mantine-color-default-color)",
|
|
86
|
+
defaultBorder: "var(--mantine-color-default-border)",
|
|
87
|
+
dimmed: "var(--mantine-color-dimmed)"
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
return {
|
|
91
|
+
scale: "var(--mantine-scale)",
|
|
92
|
+
cursorType: "var(--mantine-cursor-type)",
|
|
93
|
+
webkitFontSmoothing: "var(--mantine-webkit-font-smoothing)",
|
|
94
|
+
mozFontSmoothing: "var(--mantine-moz-font-smoothing)",
|
|
95
|
+
lineHeight: "var(--mantine-line-height)",
|
|
96
|
+
fontFamily: "var(--mantine-font-family)",
|
|
97
|
+
fontFamilyMonospace: "var(--mantine-font-family-monospace)",
|
|
98
|
+
fontFamilyHeadings: "var(--mantine-font-family-headings)",
|
|
99
|
+
headingFontWeight: "var(--mantine-heading-font-weight)",
|
|
100
|
+
radiusDefault: "var(--mantine-radius-default)",
|
|
101
|
+
breakpoints: mergedTheme.breakpoints,
|
|
102
|
+
fontSizes,
|
|
103
|
+
lineHeights,
|
|
104
|
+
shadows,
|
|
105
|
+
radius,
|
|
106
|
+
headings,
|
|
107
|
+
spacing,
|
|
108
|
+
colors,
|
|
109
|
+
rtlSelector: '[dir="rtl"] &',
|
|
110
|
+
darkSelector: '[data-mantine-color-scheme="dark"] &',
|
|
111
|
+
lightSelector: '[data-mantine-color-scheme="light"] &',
|
|
112
|
+
smallerThan: (breakpoint) => `(max-width: ${getBreakpointValue(breakpoint, mergedTheme)})`,
|
|
113
|
+
largerThan: (breakpoint) => `(min-width: ${getBreakpointValue(breakpoint, mergedTheme)})`
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
exports.themeToVars = themeToVars;
|
|
118
|
+
//# sourceMappingURL=theme-to-vars.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-to-vars.cjs","sources":["../src/theme-to-vars.ts"],"sourcesContent":["import {\n DEFAULT_THEME,\n em,\n MantineTheme,\n MantineThemeOverride,\n mergeMantineTheme,\n} from '@mantine/core';\nimport {\n Colors,\n FontSizes,\n Heading,\n Headings,\n LineHeights,\n MantineVars,\n Radius,\n Shadows,\n Spacing,\n} from './types';\n\nfunction getSizesVariables<Result>(theme: any, themeKey: string, name: string): Result {\n return Object.keys(theme[themeKey]).reduce((acc: any, size) => {\n acc[size] = `var(--mantine-${name}-${size})`;\n return acc;\n }, {});\n}\n\nfunction getBreakpointValue(value: string | number, theme: MantineTheme) {\n return value in theme.breakpoints ? (theme.breakpoints as any)[value] : em(value);\n}\n\nexport function themeToVars(theme: MantineThemeOverride): MantineVars {\n const mergedTheme = mergeMantineTheme(DEFAULT_THEME, theme);\n\n const fontSizes = getSizesVariables<FontSizes>(mergedTheme, 'fontSizes', 'font-size');\n\n const lineHeights = getSizesVariables<LineHeights>(mergedTheme, 'lineHeights', 'line-height');\n\n const shadows = getSizesVariables<Shadows>(mergedTheme, 'shadows', 'shadow');\n const radius = getSizesVariables<Radius>(mergedTheme, 'radius', 'radius');\n const spacing = getSizesVariables<Spacing>(mergedTheme, 'spacing', 'spacing');\n\n const headings = Object.keys(mergedTheme.headings.sizes).reduce(\n (acc: Record<string, Heading>, heading) => {\n acc[heading] = {\n fontSize: `var(--mantine-${heading}-font-size)`,\n lineHeight: `var(--mantine-${heading}-line-height)`,\n fontWeight: `var(--mantine-${heading}-font-weight)`,\n };\n return acc;\n },\n {}\n ) as Headings;\n\n const colors = Object.keys(mergedTheme.colors).reduce(\n (acc: any, color) => {\n acc[color] = {\n 0: `var(--mantine-color-${color}-0)`,\n 1: `var(--mantine-color-${color}-1)`,\n 2: `var(--mantine-color-${color}-2)`,\n 3: `var(--mantine-color-${color}-3)`,\n 4: `var(--mantine-color-${color}-4)`,\n 5: `var(--mantine-color-${color}-5)`,\n 6: `var(--mantine-color-${color}-6)`,\n 7: `var(--mantine-color-${color}-7)`,\n 8: `var(--mantine-color-${color}-8)`,\n 9: `var(--mantine-color-${color}-9)`,\n filled: `var(--mantine-color-${color}-filled)`,\n filledHover: `var(--mantine-color-${color}-filled-hover)`,\n light: `var(--mantine-color-${color}-light)`,\n lightHover: `var(--mantine-color-${color}-light-hover)`,\n lightColor: `var(--mantine-color-${color}-light-color)`,\n outline: `var(--mantine-color-${color}-outline)`,\n outlineHover: `var(--mantine-color-${color}-outline-hover)`,\n };\n\n return acc;\n },\n {\n primary: 'var(--mantine-primary-color-filled)',\n primaryColors: {\n 0: 'var(--mantine-primary-color-0)',\n 1: 'var(--mantine-primary-color-1)',\n 2: 'var(--mantine-primary-color-2)',\n 3: 'var(--mantine-primary-color-3)',\n 4: 'var(--mantine-primary-color-4)',\n 5: 'var(--mantine-primary-color-5)',\n 6: 'var(--mantine-primary-color-6)',\n 7: 'var(--mantine-primary-color-7)',\n 8: 'var(--mantine-primary-color-8)',\n 9: 'var(--mantine-primary-color-9)',\n filled: 'var(--mantine-primary-color-filled)',\n filledHover: 'var(--mantine-primary-color-filled-hover)',\n light: 'var(--mantine-primary-color-light)',\n lightHover: 'var(--mantine-primary-color-light-hover)',\n lightColor: 'var(--mantine-primary-color-light-color)',\n outline: 'var(--mantine-primary-color-outline)',\n outlineHover: 'var(--mantine-primary-color-outline-hover)',\n },\n white: 'var(--mantine-color-white)',\n black: 'var(--mantine-color-black)',\n text: 'var(--mantine-color-text)',\n body: 'var(--mantine-color-body)',\n error: 'var(--mantine-color-error)',\n placeholder: 'var(--mantine-color-placeholder)',\n anchor: 'var(--mantine-color-anchor)',\n default: 'var(--mantine-color-default)',\n defaultHover: 'var(--mantine-color-default-hover)',\n defaultColor: 'var(--mantine-color-default-color)',\n defaultBorder: 'var(--mantine-color-default-border)',\n dimmed: 'var(--mantine-color-dimmed)',\n }\n ) as Colors;\n\n return {\n scale: 'var(--mantine-scale)',\n cursorType: 'var(--mantine-cursor-type)',\n webkitFontSmoothing: 'var(--mantine-webkit-font-smoothing)',\n mozFontSmoothing: 'var(--mantine-moz-font-smoothing)',\n lineHeight: 'var(--mantine-line-height)',\n fontFamily: 'var(--mantine-font-family)',\n fontFamilyMonospace: 'var(--mantine-font-family-monospace)',\n fontFamilyHeadings: 'var(--mantine-font-family-headings)',\n headingFontWeight: 'var(--mantine-heading-font-weight)',\n radiusDefault: 'var(--mantine-radius-default)',\n breakpoints: mergedTheme.breakpoints,\n fontSizes,\n lineHeights,\n shadows,\n radius,\n headings,\n spacing,\n colors,\n\n rtlSelector: '[dir=\"rtl\"] &',\n darkSelector: '[data-mantine-color-scheme=\"dark\"] &',\n lightSelector: '[data-mantine-color-scheme=\"light\"] &',\n\n smallerThan: (breakpoint) => `(max-width: ${getBreakpointValue(breakpoint, mergedTheme)})`,\n largerThan: (breakpoint) => `(min-width: ${getBreakpointValue(breakpoint, mergedTheme)})`,\n };\n}\n"],"names":["em","mergeMantineTheme","DEFAULT_THEME"],"mappings":";;;;AAMA,SAAS,iBAAiB,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE;AAClD,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK;AAC5D,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAChD,IAAI,OAAO,GAAG;AACd,GAAG,EAAE,EAAE,CAAC;AACR;AACA,SAAS,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE;AAC1C,EAAE,OAAO,KAAK,IAAI,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,GAAGA,OAAE,CAAC,KAAK,CAAC;AAC1E;AACO,SAAS,WAAW,CAAC,KAAK,EAAE;AACnC,EAAE,MAAM,WAAW,GAAGC,sBAAiB,CAACC,kBAAa,EAAE,KAAK,CAAC;AAC7D,EAAE,MAAM,SAAS,GAAG,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC;AAC5E,EAAE,MAAM,WAAW,GAAG,iBAAiB,CAAC,WAAW,EAAE,aAAa,EAAE,aAAa,CAAC;AAClF,EAAE,MAAM,OAAO,GAAG,iBAAiB,CAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC;AACrE,EAAE,MAAM,MAAM,GAAG,iBAAiB,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC;AACnE,EAAE,MAAM,OAAO,GAAG,iBAAiB,CAAC,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C,CAAC;AAC9F,IAAI,UAAU,EAAE,CAAC,UAAU,KAAK,CAAC,YAAY,EAAE,kBAAkB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;AAC5F,GAAG;AACH;;;;"}
|
package/esm/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { mergeMantineTheme, DEFAULT_THEME, em } from '@mantine/core';
|
|
2
|
+
|
|
3
|
+
function getSizesVariables(theme, themeKey, name) {
|
|
4
|
+
return Object.keys(theme[themeKey]).reduce((acc, size) => {
|
|
5
|
+
acc[size] = `var(--mantine-${name}-${size})`;
|
|
6
|
+
return acc;
|
|
7
|
+
}, {});
|
|
8
|
+
}
|
|
9
|
+
function getBreakpointValue(value, theme) {
|
|
10
|
+
return value in theme.breakpoints ? theme.breakpoints[value] : em(value);
|
|
11
|
+
}
|
|
12
|
+
function themeToVars(theme) {
|
|
13
|
+
const mergedTheme = mergeMantineTheme(DEFAULT_THEME, theme);
|
|
14
|
+
const fontSizes = getSizesVariables(mergedTheme, "fontSizes", "font-size");
|
|
15
|
+
const lineHeights = getSizesVariables(mergedTheme, "lineHeights", "line-height");
|
|
16
|
+
const shadows = getSizesVariables(mergedTheme, "shadows", "shadow");
|
|
17
|
+
const radius = getSizesVariables(mergedTheme, "radius", "radius");
|
|
18
|
+
const spacing = getSizesVariables(mergedTheme, "spacing", "spacing");
|
|
19
|
+
const headings = Object.keys(mergedTheme.headings.sizes).reduce(
|
|
20
|
+
(acc, heading) => {
|
|
21
|
+
acc[heading] = {
|
|
22
|
+
fontSize: `var(--mantine-${heading}-font-size)`,
|
|
23
|
+
lineHeight: `var(--mantine-${heading}-line-height)`,
|
|
24
|
+
fontWeight: `var(--mantine-${heading}-font-weight)`
|
|
25
|
+
};
|
|
26
|
+
return acc;
|
|
27
|
+
},
|
|
28
|
+
{}
|
|
29
|
+
);
|
|
30
|
+
const colors = Object.keys(mergedTheme.colors).reduce(
|
|
31
|
+
(acc, color) => {
|
|
32
|
+
acc[color] = {
|
|
33
|
+
0: `var(--mantine-color-${color}-0)`,
|
|
34
|
+
1: `var(--mantine-color-${color}-1)`,
|
|
35
|
+
2: `var(--mantine-color-${color}-2)`,
|
|
36
|
+
3: `var(--mantine-color-${color}-3)`,
|
|
37
|
+
4: `var(--mantine-color-${color}-4)`,
|
|
38
|
+
5: `var(--mantine-color-${color}-5)`,
|
|
39
|
+
6: `var(--mantine-color-${color}-6)`,
|
|
40
|
+
7: `var(--mantine-color-${color}-7)`,
|
|
41
|
+
8: `var(--mantine-color-${color}-8)`,
|
|
42
|
+
9: `var(--mantine-color-${color}-9)`,
|
|
43
|
+
filled: `var(--mantine-color-${color}-filled)`,
|
|
44
|
+
filledHover: `var(--mantine-color-${color}-filled-hover)`,
|
|
45
|
+
light: `var(--mantine-color-${color}-light)`,
|
|
46
|
+
lightHover: `var(--mantine-color-${color}-light-hover)`,
|
|
47
|
+
lightColor: `var(--mantine-color-${color}-light-color)`,
|
|
48
|
+
outline: `var(--mantine-color-${color}-outline)`,
|
|
49
|
+
outlineHover: `var(--mantine-color-${color}-outline-hover)`
|
|
50
|
+
};
|
|
51
|
+
return acc;
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
primary: "var(--mantine-primary-color-filled)",
|
|
55
|
+
primaryColors: {
|
|
56
|
+
0: "var(--mantine-primary-color-0)",
|
|
57
|
+
1: "var(--mantine-primary-color-1)",
|
|
58
|
+
2: "var(--mantine-primary-color-2)",
|
|
59
|
+
3: "var(--mantine-primary-color-3)",
|
|
60
|
+
4: "var(--mantine-primary-color-4)",
|
|
61
|
+
5: "var(--mantine-primary-color-5)",
|
|
62
|
+
6: "var(--mantine-primary-color-6)",
|
|
63
|
+
7: "var(--mantine-primary-color-7)",
|
|
64
|
+
8: "var(--mantine-primary-color-8)",
|
|
65
|
+
9: "var(--mantine-primary-color-9)",
|
|
66
|
+
filled: "var(--mantine-primary-color-filled)",
|
|
67
|
+
filledHover: "var(--mantine-primary-color-filled-hover)",
|
|
68
|
+
light: "var(--mantine-primary-color-light)",
|
|
69
|
+
lightHover: "var(--mantine-primary-color-light-hover)",
|
|
70
|
+
lightColor: "var(--mantine-primary-color-light-color)",
|
|
71
|
+
outline: "var(--mantine-primary-color-outline)",
|
|
72
|
+
outlineHover: "var(--mantine-primary-color-outline-hover)"
|
|
73
|
+
},
|
|
74
|
+
white: "var(--mantine-color-white)",
|
|
75
|
+
black: "var(--mantine-color-black)",
|
|
76
|
+
text: "var(--mantine-color-text)",
|
|
77
|
+
body: "var(--mantine-color-body)",
|
|
78
|
+
error: "var(--mantine-color-error)",
|
|
79
|
+
placeholder: "var(--mantine-color-placeholder)",
|
|
80
|
+
anchor: "var(--mantine-color-anchor)",
|
|
81
|
+
default: "var(--mantine-color-default)",
|
|
82
|
+
defaultHover: "var(--mantine-color-default-hover)",
|
|
83
|
+
defaultColor: "var(--mantine-color-default-color)",
|
|
84
|
+
defaultBorder: "var(--mantine-color-default-border)",
|
|
85
|
+
dimmed: "var(--mantine-color-dimmed)"
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
return {
|
|
89
|
+
scale: "var(--mantine-scale)",
|
|
90
|
+
cursorType: "var(--mantine-cursor-type)",
|
|
91
|
+
webkitFontSmoothing: "var(--mantine-webkit-font-smoothing)",
|
|
92
|
+
mozFontSmoothing: "var(--mantine-moz-font-smoothing)",
|
|
93
|
+
lineHeight: "var(--mantine-line-height)",
|
|
94
|
+
fontFamily: "var(--mantine-font-family)",
|
|
95
|
+
fontFamilyMonospace: "var(--mantine-font-family-monospace)",
|
|
96
|
+
fontFamilyHeadings: "var(--mantine-font-family-headings)",
|
|
97
|
+
headingFontWeight: "var(--mantine-heading-font-weight)",
|
|
98
|
+
radiusDefault: "var(--mantine-radius-default)",
|
|
99
|
+
breakpoints: mergedTheme.breakpoints,
|
|
100
|
+
fontSizes,
|
|
101
|
+
lineHeights,
|
|
102
|
+
shadows,
|
|
103
|
+
radius,
|
|
104
|
+
headings,
|
|
105
|
+
spacing,
|
|
106
|
+
colors,
|
|
107
|
+
rtlSelector: '[dir="rtl"] &',
|
|
108
|
+
darkSelector: '[data-mantine-color-scheme="dark"] &',
|
|
109
|
+
lightSelector: '[data-mantine-color-scheme="light"] &',
|
|
110
|
+
smallerThan: (breakpoint) => `(max-width: ${getBreakpointValue(breakpoint, mergedTheme)})`,
|
|
111
|
+
largerThan: (breakpoint) => `(min-width: ${getBreakpointValue(breakpoint, mergedTheme)})`
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { themeToVars };
|
|
116
|
+
//# sourceMappingURL=theme-to-vars.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-to-vars.mjs","sources":["../src/theme-to-vars.ts"],"sourcesContent":["import {\n DEFAULT_THEME,\n em,\n MantineTheme,\n MantineThemeOverride,\n mergeMantineTheme,\n} from '@mantine/core';\nimport {\n Colors,\n FontSizes,\n Heading,\n Headings,\n LineHeights,\n MantineVars,\n Radius,\n Shadows,\n Spacing,\n} from './types';\n\nfunction getSizesVariables<Result>(theme: any, themeKey: string, name: string): Result {\n return Object.keys(theme[themeKey]).reduce((acc: any, size) => {\n acc[size] = `var(--mantine-${name}-${size})`;\n return acc;\n }, {});\n}\n\nfunction getBreakpointValue(value: string | number, theme: MantineTheme) {\n return value in theme.breakpoints ? (theme.breakpoints as any)[value] : em(value);\n}\n\nexport function themeToVars(theme: MantineThemeOverride): MantineVars {\n const mergedTheme = mergeMantineTheme(DEFAULT_THEME, theme);\n\n const fontSizes = getSizesVariables<FontSizes>(mergedTheme, 'fontSizes', 'font-size');\n\n const lineHeights = getSizesVariables<LineHeights>(mergedTheme, 'lineHeights', 'line-height');\n\n const shadows = getSizesVariables<Shadows>(mergedTheme, 'shadows', 'shadow');\n const radius = getSizesVariables<Radius>(mergedTheme, 'radius', 'radius');\n const spacing = getSizesVariables<Spacing>(mergedTheme, 'spacing', 'spacing');\n\n const headings = Object.keys(mergedTheme.headings.sizes).reduce(\n (acc: Record<string, Heading>, heading) => {\n acc[heading] = {\n fontSize: `var(--mantine-${heading}-font-size)`,\n lineHeight: `var(--mantine-${heading}-line-height)`,\n fontWeight: `var(--mantine-${heading}-font-weight)`,\n };\n return acc;\n },\n {}\n ) as Headings;\n\n const colors = Object.keys(mergedTheme.colors).reduce(\n (acc: any, color) => {\n acc[color] = {\n 0: `var(--mantine-color-${color}-0)`,\n 1: `var(--mantine-color-${color}-1)`,\n 2: `var(--mantine-color-${color}-2)`,\n 3: `var(--mantine-color-${color}-3)`,\n 4: `var(--mantine-color-${color}-4)`,\n 5: `var(--mantine-color-${color}-5)`,\n 6: `var(--mantine-color-${color}-6)`,\n 7: `var(--mantine-color-${color}-7)`,\n 8: `var(--mantine-color-${color}-8)`,\n 9: `var(--mantine-color-${color}-9)`,\n filled: `var(--mantine-color-${color}-filled)`,\n filledHover: `var(--mantine-color-${color}-filled-hover)`,\n light: `var(--mantine-color-${color}-light)`,\n lightHover: `var(--mantine-color-${color}-light-hover)`,\n lightColor: `var(--mantine-color-${color}-light-color)`,\n outline: `var(--mantine-color-${color}-outline)`,\n outlineHover: `var(--mantine-color-${color}-outline-hover)`,\n };\n\n return acc;\n },\n {\n primary: 'var(--mantine-primary-color-filled)',\n primaryColors: {\n 0: 'var(--mantine-primary-color-0)',\n 1: 'var(--mantine-primary-color-1)',\n 2: 'var(--mantine-primary-color-2)',\n 3: 'var(--mantine-primary-color-3)',\n 4: 'var(--mantine-primary-color-4)',\n 5: 'var(--mantine-primary-color-5)',\n 6: 'var(--mantine-primary-color-6)',\n 7: 'var(--mantine-primary-color-7)',\n 8: 'var(--mantine-primary-color-8)',\n 9: 'var(--mantine-primary-color-9)',\n filled: 'var(--mantine-primary-color-filled)',\n filledHover: 'var(--mantine-primary-color-filled-hover)',\n light: 'var(--mantine-primary-color-light)',\n lightHover: 'var(--mantine-primary-color-light-hover)',\n lightColor: 'var(--mantine-primary-color-light-color)',\n outline: 'var(--mantine-primary-color-outline)',\n outlineHover: 'var(--mantine-primary-color-outline-hover)',\n },\n white: 'var(--mantine-color-white)',\n black: 'var(--mantine-color-black)',\n text: 'var(--mantine-color-text)',\n body: 'var(--mantine-color-body)',\n error: 'var(--mantine-color-error)',\n placeholder: 'var(--mantine-color-placeholder)',\n anchor: 'var(--mantine-color-anchor)',\n default: 'var(--mantine-color-default)',\n defaultHover: 'var(--mantine-color-default-hover)',\n defaultColor: 'var(--mantine-color-default-color)',\n defaultBorder: 'var(--mantine-color-default-border)',\n dimmed: 'var(--mantine-color-dimmed)',\n }\n ) as Colors;\n\n return {\n scale: 'var(--mantine-scale)',\n cursorType: 'var(--mantine-cursor-type)',\n webkitFontSmoothing: 'var(--mantine-webkit-font-smoothing)',\n mozFontSmoothing: 'var(--mantine-moz-font-smoothing)',\n lineHeight: 'var(--mantine-line-height)',\n fontFamily: 'var(--mantine-font-family)',\n fontFamilyMonospace: 'var(--mantine-font-family-monospace)',\n fontFamilyHeadings: 'var(--mantine-font-family-headings)',\n headingFontWeight: 'var(--mantine-heading-font-weight)',\n radiusDefault: 'var(--mantine-radius-default)',\n breakpoints: mergedTheme.breakpoints,\n fontSizes,\n lineHeights,\n shadows,\n radius,\n headings,\n spacing,\n colors,\n\n rtlSelector: '[dir=\"rtl\"] &',\n darkSelector: '[data-mantine-color-scheme=\"dark\"] &',\n lightSelector: '[data-mantine-color-scheme=\"light\"] &',\n\n smallerThan: (breakpoint) => `(max-width: ${getBreakpointValue(breakpoint, mergedTheme)})`,\n largerThan: (breakpoint) => `(min-width: ${getBreakpointValue(breakpoint, mergedTheme)})`,\n };\n}\n"],"names":[],"mappings":";;AAMA,SAAS,iBAAiB,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE;AAClD,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAA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A8B;AAC7C,MAAM,YAAY,EAAE,oCAAoC;AACxD,MAAM,YAAY,EAAE,oCAAoC;AACxD,MAAM,aAAa,EAAE,qCAAqC;AAC1D,MAAM,MAAM,EAAE;AACd;AACA,GAAG;AACH,EAAE,OAAO;AACT,IAAI,KAAK,EAAE,sBAAsB;AACjC,IAAI,UAAU,EAAE,4BAA4B;AAC5C,IAAI,mBAAmB,EAAE,sCAAsC;AAC/D,IAAI,gBAAgB,EAAE,mCAAmC;AACzD,IAAI,UAAU,EAAE,4BAA4B;AAC5C,IAAI,UAAU,EAAE,4BAA4B;AAC5C,IAAI,mBAAmB,EAAE,sCAAsC;AAC/D,IAAI,kBAAkB,EAAE,qCAAqC;AAC7D,IAAI,iBAAiB,EAAE,oCAAoC;AAC3D,IAAI,aAAa,EAAE,+BAA+B;AAClD,IAAI,WAAW,EAAE,WAAW,CAAC,WAAW;AACxC,IAAI,SAAS;AACb,IAAI,WAAW;AACf,IAAI,OAAO;AACX,IAAI,MAAM;AACV,IAAI,QAAQ;AACZ,IAAI,OAAO;AACX,IAAI,MAAM;AACV,IAAI,WAAW,EAAE,eAAe;AAChC,IAAI,YAAY,EAAE,sCAAsC;AACxD,IAAI,aAAa,EAAE,uCAAuC;AAC1D,IAAI,WAAW,EAAE,CAAC,UAAU,KAAK,CAAC,YAAY,EAAE,kBAAkB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;AAC9F,IAAI,UAAU,EAAE,CAAC,UAAU,KAAK,CAAC,YAAY,EAAE,kBAAkB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;AAC5F,GAAG;AACH;;;;"}
|
package/lib/index.d.mts
ADDED
package/lib/index.d.ts
ADDED
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { MantineBreakpoint, MantineColor, MantineFontSize, MantineLineHeight, MantineRadius, MantineShadow, MantineSpacing } from '@mantine/core';
|
|
2
|
+
interface ColorValues {
|
|
3
|
+
0: string;
|
|
4
|
+
1: string;
|
|
5
|
+
2: string;
|
|
6
|
+
3: string;
|
|
7
|
+
4: string;
|
|
8
|
+
5: string;
|
|
9
|
+
6: string;
|
|
10
|
+
7: string;
|
|
11
|
+
8: string;
|
|
12
|
+
9: string;
|
|
13
|
+
filled: string;
|
|
14
|
+
filledHover: string;
|
|
15
|
+
light: string;
|
|
16
|
+
lightHover: string;
|
|
17
|
+
lightColor: string;
|
|
18
|
+
outline: string;
|
|
19
|
+
outlineHover: string;
|
|
20
|
+
}
|
|
21
|
+
export type Colors = {
|
|
22
|
+
[key in MantineColor]: ColorValues;
|
|
23
|
+
} & {
|
|
24
|
+
primary: string;
|
|
25
|
+
white: string;
|
|
26
|
+
black: string;
|
|
27
|
+
primaryColors: ColorValues;
|
|
28
|
+
text: string;
|
|
29
|
+
body: string;
|
|
30
|
+
error: string;
|
|
31
|
+
placeholder: string;
|
|
32
|
+
anchor: string;
|
|
33
|
+
default: string;
|
|
34
|
+
defaultHover: string;
|
|
35
|
+
defaultColor: string;
|
|
36
|
+
defaultBorder: string;
|
|
37
|
+
dimmed: string;
|
|
38
|
+
};
|
|
39
|
+
export type Breakpoints = {
|
|
40
|
+
[key in MantineBreakpoint | (string & {})]: string;
|
|
41
|
+
};
|
|
42
|
+
export type Spacing = {
|
|
43
|
+
[key in MantineSpacing | (string & {})]: string;
|
|
44
|
+
};
|
|
45
|
+
export type FontSizes = {
|
|
46
|
+
[key in MantineFontSize | (string & {})]: string;
|
|
47
|
+
};
|
|
48
|
+
export type LineHeights = {
|
|
49
|
+
[key in MantineLineHeight | (string & {})]: string;
|
|
50
|
+
};
|
|
51
|
+
export type Shadows = {
|
|
52
|
+
[key in MantineShadow | (string & {})]: string;
|
|
53
|
+
};
|
|
54
|
+
export type Radius = {
|
|
55
|
+
[key in MantineRadius | (string & {})]: string;
|
|
56
|
+
};
|
|
57
|
+
export type Heading = {
|
|
58
|
+
fontSize: string;
|
|
59
|
+
lineHeight: string;
|
|
60
|
+
fontWeight: string;
|
|
61
|
+
};
|
|
62
|
+
export type Headings = {
|
|
63
|
+
[key in 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6']: Heading;
|
|
64
|
+
};
|
|
65
|
+
export interface MantineVars {
|
|
66
|
+
scale: string;
|
|
67
|
+
cursorType: string;
|
|
68
|
+
webkitFontSmoothing: string;
|
|
69
|
+
mozFontSmoothing: string;
|
|
70
|
+
colors: Colors;
|
|
71
|
+
lineHeight: string;
|
|
72
|
+
fontFamily: string;
|
|
73
|
+
fontFamilyMonospace: string;
|
|
74
|
+
fontFamilyHeadings: string;
|
|
75
|
+
headingFontWeight: string;
|
|
76
|
+
radiusDefault: string;
|
|
77
|
+
breakpoints: Breakpoints;
|
|
78
|
+
spacing: Spacing;
|
|
79
|
+
fontSizes: FontSizes;
|
|
80
|
+
lineHeights: LineHeights;
|
|
81
|
+
shadows: Shadows;
|
|
82
|
+
radius: Radius;
|
|
83
|
+
headings: Headings;
|
|
84
|
+
rtlSelector: string;
|
|
85
|
+
darkSelector: string;
|
|
86
|
+
lightSelector: string;
|
|
87
|
+
smallerThan: (breakpoint: MantineBreakpoint | (string & {}) | number) => string;
|
|
88
|
+
largerThan: (breakpoint: MantineBreakpoint | (string & {}) | number) => string;
|
|
89
|
+
}
|
|
90
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/vanilla-extract",
|
|
3
|
-
"version": "7.13.5-alpha.
|
|
3
|
+
"version": "7.13.5-alpha.2",
|
|
4
4
|
"description": "Vanilla Extract integration for Mantine theme",
|
|
5
5
|
"homepage": "https://mantine.dev",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
"directory": "packages/@mantine/vanilla-extract"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@mantine/core": "7.13.5-alpha.
|
|
38
|
+
"@mantine/core": "7.13.5-alpha.2"
|
|
39
39
|
}
|
|
40
40
|
}
|