tailwind-preset-mantine 1.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/.github/workflows/release.yml +33 -0
- package/.vscode/settings.json +21 -0
- package/LICENSE.md +21 -0
- package/README.md +106 -0
- package/biome.json +9 -0
- package/package.json +29 -0
- package/src/index.d.ts +8 -0
- package/src/index.js +317 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
permissions:
|
|
4
|
+
id-token: write
|
|
5
|
+
contents: write
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
tags:
|
|
10
|
+
- 'v*'
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
release:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
with:
|
|
18
|
+
fetch-depth: 0
|
|
19
|
+
- uses: pnpm/action-setup@v4
|
|
20
|
+
- uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: lts/*
|
|
23
|
+
registry-url: https://registry.npmjs.org/
|
|
24
|
+
|
|
25
|
+
- run: pnpm dlx changelogithub
|
|
26
|
+
env:
|
|
27
|
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
28
|
+
|
|
29
|
+
- run: pnpm install
|
|
30
|
+
- run: pnpm publish --no-git-checks --access public
|
|
31
|
+
env:
|
|
32
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
33
|
+
NPM_CONFIG_PROVENANCE: true
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"unocss.root": ["./examples/vite"],
|
|
3
|
+
"editor.codeActionsOnSave": {
|
|
4
|
+
"source.fixAll.eslint": "always",
|
|
5
|
+
"quickfix.biome": "always",
|
|
6
|
+
"source.organizeImports.biome": "always"
|
|
7
|
+
},
|
|
8
|
+
"editor.defaultFormatter": "biomejs.biome",
|
|
9
|
+
"[json]": {
|
|
10
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
11
|
+
},
|
|
12
|
+
"[html]": {
|
|
13
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
14
|
+
},
|
|
15
|
+
"[javascript]": {
|
|
16
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
17
|
+
},
|
|
18
|
+
"[typescript]": {
|
|
19
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
20
|
+
}
|
|
21
|
+
}
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Songkeys <https://github.com/songkeys>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# tailwind-preset-mantine
|
|
2
|
+
|
|
3
|
+
A Tailwind CSS preset for seamless integration with Mantine UI components.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install tailwind-preset-mantine
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
To use the preset in your Tailwind CSS configuration, add it to the `presets` array:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
// tailwind.config.ts
|
|
17
|
+
import tailwindPresetMantine from 'tailwind-preset-mantine';
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
presets: [
|
|
21
|
+
tailwindPresetMantine,
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If you have a custom mantine theme (https://mantine.dev/theming/theme-object/), you should pass it as an option to make custom colors available to tailwind.
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import tailwindPresetMantine from 'tailwind-preset-mantine'
|
|
30
|
+
import { createTheme } from '@mantine/core';
|
|
31
|
+
|
|
32
|
+
const mantineTheme = createTheme({
|
|
33
|
+
// ...your custom theme
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export default {
|
|
37
|
+
presets: [tailwindPresetMantine({ mantineTheme })],
|
|
38
|
+
};
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Now you can use tailwind with mantine's style applied:
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { Button } from '@mantine/core';
|
|
45
|
+
|
|
46
|
+
export default function Page() {
|
|
47
|
+
// `bg-red-500` will be `background-color: var(--mantine-color-red-5)`
|
|
48
|
+
// `text-white` will be `color: var(--mantine-color-white)`
|
|
49
|
+
return <Button className="bg-red-500 text-white">Hello</Button>
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Prevent style conflicts
|
|
54
|
+
|
|
55
|
+
You will encounter style conflicts when using mantine and tailwind together. (See this [tough discussion](https://github.com/orgs/mantinedev/discussions/1672).) To prevent this, you can follow the steps below:
|
|
56
|
+
|
|
57
|
+
### 1. global.css
|
|
58
|
+
|
|
59
|
+
Change your global.css to use CSS layers to prevent style conflicts:
|
|
60
|
+
|
|
61
|
+
```css
|
|
62
|
+
@layer tw_base, mantine, tw_components, tw_utilities;
|
|
63
|
+
|
|
64
|
+
/* import tailwind */
|
|
65
|
+
@import "tailwindcss/base" layer(tw_base);
|
|
66
|
+
@import "tailwindcss/components" layer(tw_components);
|
|
67
|
+
@import "tailwindcss/utilities" layer(tw_utilities);
|
|
68
|
+
|
|
69
|
+
/* import mantine */
|
|
70
|
+
@import "@mantine/core/styles.layer.css";
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> What's `@layer`?
|
|
74
|
+
> Note that here we setup tailwind slightly different from [the official docs](https://arc.net/l/quote/eifghbsm). We use the [CSS `@layer` directive](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer) to control the order of the css. This is because we want to make sure that the mantine styles doesn't get overridden by tailwind reset (tw_base). In this case, the order is `tw_base -> mantine -> tw_components -> tw_utilities`
|
|
75
|
+
|
|
76
|
+
### 2. postcss.config.js
|
|
77
|
+
|
|
78
|
+
To make it work, you also need to change the postcss config like this:
|
|
79
|
+
|
|
80
|
+
```diff
|
|
81
|
+
// postcss.config.js
|
|
82
|
+
module.exports = {
|
|
83
|
+
plugins: {
|
|
84
|
+
'postcss-import': {},
|
|
85
|
+
'postcss-preset-mantine': {},
|
|
86
|
+
'postcss-simple-vars': {
|
|
87
|
+
variables: {
|
|
88
|
+
'mantine-breakpoint-xs': '36em',
|
|
89
|
+
'mantine-breakpoint-sm': '48em',
|
|
90
|
+
'mantine-breakpoint-md': '62em',
|
|
91
|
+
'mantine-breakpoint-lg': '75em',
|
|
92
|
+
'mantine-breakpoint-xl': '88em',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// for tailwind
|
|
97
|
+
+ autoprefixer: {},
|
|
98
|
+
+ 'tailwindcss/nesting': {},
|
|
99
|
+
+ tailwindcss: {},
|
|
100
|
+
},
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
MIT
|
package/biome.json
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tailwind-preset-mantine",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Integrate Mantine with Tailwind CSS",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mantine",
|
|
7
|
+
"tailwind",
|
|
8
|
+
"preset"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"author": "Songkeys",
|
|
12
|
+
"main": "src/index.js",
|
|
13
|
+
"types": "src/index.d.ts",
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@biomejs/biome": "^1.9.2",
|
|
16
|
+
"@mantine/core": "^7.13.0",
|
|
17
|
+
"bumpp": "^9.5.2",
|
|
18
|
+
"tailwindcss": "^3.4.13"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@mantine/core": "^7",
|
|
22
|
+
"tailwindcss": "^3"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"lint": "biome check .",
|
|
26
|
+
"lint:fix": "biome check . --write",
|
|
27
|
+
"release": "bumpp"
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/index.d.ts
ADDED
package/src/index.js
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/// for reference: https://github.com/mantinedev/mantine/blob/master/packages/%40mantine/core/src/core/MantineProvider/global.css
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import('@mantine/core').MantineThemeOverride} MantineThemeOverride
|
|
5
|
+
* @typedef {import('tailwindcss').Config} TailwindConfig
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { DEFAULT_THEME } = require("@mantine/core");
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @example
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* // tailwind.config.ts
|
|
15
|
+
* import tailwindPresetMantine from 'tailwind-preset-mantine'
|
|
16
|
+
*
|
|
17
|
+
* export default {
|
|
18
|
+
* presets: [tailwindPresetMantine()],
|
|
19
|
+
* };
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* If you have a custom mantine theme (https://mantine.dev/theming/theme-object/),
|
|
23
|
+
* you should pass it as an option to make custom colors available to tailwind.
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* import tailwindPresetMantine from 'tailwind-preset-mantine'
|
|
27
|
+
* import { createTheme } from '@mantine/core';
|
|
28
|
+
*
|
|
29
|
+
* const mantineTheme = createTheme({
|
|
30
|
+
* // ...your custom theme
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* export default {
|
|
34
|
+
* presets: [tailwindPresetMantine({ mantineTheme })],
|
|
35
|
+
* };
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
module.exports = function tailwindPresetMantine({
|
|
39
|
+
mantineTheme = DEFAULT_THEME,
|
|
40
|
+
} = {}) {
|
|
41
|
+
/**
|
|
42
|
+
* @type {TailwindConfig}
|
|
43
|
+
*/
|
|
44
|
+
const preset = {
|
|
45
|
+
content: [],
|
|
46
|
+
darkMode: ["class", '[data-mantine-color-scheme="dark"]'],
|
|
47
|
+
theme: {
|
|
48
|
+
extend: {
|
|
49
|
+
screens: {
|
|
50
|
+
xs: "var(--mantine-breakpoint-xs)",
|
|
51
|
+
sm: "var(--mantine-breakpoint-sm)",
|
|
52
|
+
md: "var(--mantine-breakpoint-md)",
|
|
53
|
+
lg: "var(--mantine-breakpoint-lg)",
|
|
54
|
+
xl: "var(--mantine-breakpoint-xl)",
|
|
55
|
+
},
|
|
56
|
+
fontFamily: {
|
|
57
|
+
DEFAULT: ["var(--mantine-font-family)"],
|
|
58
|
+
sans: ["var(--mantine-font-family)"],
|
|
59
|
+
mono: ["var(--mantine-font-family-monospace)"],
|
|
60
|
+
headings: ["var(--mantine-font-family-headings)"],
|
|
61
|
+
},
|
|
62
|
+
fontSize: {
|
|
63
|
+
xs: "var(--mantine-font-size-xs)",
|
|
64
|
+
sm: "var(--mantine-font-size-sm)",
|
|
65
|
+
md: "var(--mantine-font-size-md)",
|
|
66
|
+
lg: "var(--mantine-font-size-lg)",
|
|
67
|
+
xl: "var(--mantine-font-size-xl)",
|
|
68
|
+
h1: "var(--mantine-h1-font-size)",
|
|
69
|
+
h2: "var(--mantine-h2-font-size)",
|
|
70
|
+
h3: "var(--mantine-h3-font-size)",
|
|
71
|
+
h4: "var(--mantine-h4-font-size)",
|
|
72
|
+
h5: "var(--mantine-h5-font-size)",
|
|
73
|
+
h6: "var(--mantine-h6-font-size)",
|
|
74
|
+
DEFAULT: "var(--mantine-font-size-md)",
|
|
75
|
+
},
|
|
76
|
+
fontWeight: {
|
|
77
|
+
h1: "var(--mantine-h1-font-weight)",
|
|
78
|
+
h2: "var(--mantine-h2-font-weight)",
|
|
79
|
+
h3: "var(--mantine-h3-font-weight)",
|
|
80
|
+
h4: "var(--mantine-h4-font-weight)",
|
|
81
|
+
h5: "var(--mantine-h5-font-weight)",
|
|
82
|
+
h6: "var(--mantine-h6-font-weight)",
|
|
83
|
+
},
|
|
84
|
+
lineHeight: {
|
|
85
|
+
xs: "var(--mantine-line-height-xs)",
|
|
86
|
+
sm: "var(--mantine-line-height-sm)",
|
|
87
|
+
md: "var(--mantine-line-height-md)",
|
|
88
|
+
lg: "var(--mantine-line-height-lg)",
|
|
89
|
+
xl: "var(--mantine-line-height-xl)",
|
|
90
|
+
h1: "var(--mantine-h1-line-height)",
|
|
91
|
+
h2: "var(--mantine-h2-line-height)",
|
|
92
|
+
h3: "var(--mantine-h3-line-height)",
|
|
93
|
+
h4: "var(--mantine-h4-line-height)",
|
|
94
|
+
h5: "var(--mantine-h5-line-height)",
|
|
95
|
+
h6: "var(--mantine-h6-line-height)",
|
|
96
|
+
heading: "var(--mantine-heading-line-height)",
|
|
97
|
+
DEFAULT: "var(--mantine-line-height)",
|
|
98
|
+
},
|
|
99
|
+
spacing: {
|
|
100
|
+
xs: "var(--mantine-spacing-xs)",
|
|
101
|
+
sm: "var(--mantine-spacing-sm)",
|
|
102
|
+
md: "var(--mantine-spacing-md)",
|
|
103
|
+
lg: "var(--mantine-spacing-lg)",
|
|
104
|
+
xl: "var(--mantine-spacing-xl)",
|
|
105
|
+
},
|
|
106
|
+
boxShadow: {
|
|
107
|
+
xs: "var(--mantine-shadow-xs)",
|
|
108
|
+
sm: "var(--mantine-shadow-sm)",
|
|
109
|
+
md: "var(--mantine-shadow-md)",
|
|
110
|
+
lg: "var(--mantine-shadow-lg)",
|
|
111
|
+
xl: "var(--mantine-shadow-xl)",
|
|
112
|
+
DEFAULT: "var(--mantine-shadow-xs)",
|
|
113
|
+
},
|
|
114
|
+
borderRadius: {
|
|
115
|
+
xs: "var(--mantine-radius-xs)",
|
|
116
|
+
sm: "var(--mantine-radius-sm)",
|
|
117
|
+
md: "var(--mantine-radius-md)",
|
|
118
|
+
lg: "var(--mantine-radius-lg)",
|
|
119
|
+
xl: "var(--mantine-radius-xl)",
|
|
120
|
+
DEFAULT: "var(--mantine-radius-default)",
|
|
121
|
+
},
|
|
122
|
+
colors: {
|
|
123
|
+
...generateColors(mantineTheme),
|
|
124
|
+
...generatePrimaryColors(),
|
|
125
|
+
...generateVariantSpecificColors(mantineTheme),
|
|
126
|
+
...generateVariantSpecificPrimaryColors(),
|
|
127
|
+
...generateOtherTextColors(),
|
|
128
|
+
},
|
|
129
|
+
backgroundColor: {
|
|
130
|
+
...generateColors(mantineTheme),
|
|
131
|
+
...generatePrimaryColors(),
|
|
132
|
+
...generateVariantSpecificColors(mantineTheme),
|
|
133
|
+
...generateVariantSpecificPrimaryColors(),
|
|
134
|
+
...generateOtherBackgroundColors(),
|
|
135
|
+
},
|
|
136
|
+
placeholderColor: {
|
|
137
|
+
...generateColors(mantineTheme),
|
|
138
|
+
...generatePrimaryColors(),
|
|
139
|
+
...generateVariantSpecificColors(mantineTheme),
|
|
140
|
+
...generateVariantSpecificPrimaryColors(),
|
|
141
|
+
...generateOtherTextColors(),
|
|
142
|
+
},
|
|
143
|
+
ringColor: {
|
|
144
|
+
...generateColors(mantineTheme),
|
|
145
|
+
...generatePrimaryColors(),
|
|
146
|
+
...generateVariantSpecificColors(mantineTheme),
|
|
147
|
+
...generateVariantSpecificPrimaryColors(),
|
|
148
|
+
...generateOtherBorderColors(),
|
|
149
|
+
},
|
|
150
|
+
divideColor: {
|
|
151
|
+
...generateColors(mantineTheme),
|
|
152
|
+
...generatePrimaryColors(),
|
|
153
|
+
...generateVariantSpecificColors(mantineTheme),
|
|
154
|
+
...generateVariantSpecificPrimaryColors(),
|
|
155
|
+
...generateOtherBorderColors(),
|
|
156
|
+
},
|
|
157
|
+
borderColor: {
|
|
158
|
+
...generateColors(mantineTheme),
|
|
159
|
+
...generatePrimaryColors(),
|
|
160
|
+
...generateVariantSpecificColors(mantineTheme),
|
|
161
|
+
...generateVariantSpecificPrimaryColors(),
|
|
162
|
+
...generateOtherBorderColors(),
|
|
163
|
+
},
|
|
164
|
+
zIndex: {
|
|
165
|
+
app: "var(--mantine-z-index-app)",
|
|
166
|
+
modal: "var(--mantine-z-index-modal)",
|
|
167
|
+
popover: "var(--mantine-z-index-popover)",
|
|
168
|
+
overlay: "var(--mantine-z-index-overlay)",
|
|
169
|
+
max: "var(--mantine-z-index-max)",
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
return preset;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @param {MantineThemeOverride} theme
|
|
180
|
+
*/
|
|
181
|
+
function generateColors(theme) {
|
|
182
|
+
const mantineColors = theme.colors;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @type {NonNullable<TailwindConfig['theme']>['colors']}
|
|
186
|
+
*/
|
|
187
|
+
const colors = {};
|
|
188
|
+
|
|
189
|
+
for (const color of mantineColors) {
|
|
190
|
+
colors[color] = {
|
|
191
|
+
50: `var(--mantine-color-${color}-0)`,
|
|
192
|
+
100: `var(--mantine-color-${color}-1)`,
|
|
193
|
+
200: `var(--mantine-color-${color}-2)`,
|
|
194
|
+
300: `var(--mantine-color-${color}-3)`,
|
|
195
|
+
400: `var(--mantine-color-${color}-4)`,
|
|
196
|
+
500: `var(--mantine-color-${color}-5)`,
|
|
197
|
+
600: `var(--mantine-color-${color}-6)`,
|
|
198
|
+
700: `var(--mantine-color-${color}-7)`,
|
|
199
|
+
800: `var(--mantine-color-${color}-8)`,
|
|
200
|
+
900: `var(--mantine-color-${color}-9)`,
|
|
201
|
+
DEFAULT: `var(--mantine-color-${color}-filled)`,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return colors;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function generatePrimaryColors() {
|
|
209
|
+
const colors = {
|
|
210
|
+
primary: {
|
|
211
|
+
50: "var(--mantine-primary-color-0)",
|
|
212
|
+
100: "var(--mantine-primary-color-1)",
|
|
213
|
+
200: "var(--mantine-primary-color-2)",
|
|
214
|
+
300: "var(--mantine-primary-color-3)",
|
|
215
|
+
400: "var(--mantine-primary-color-4)",
|
|
216
|
+
500: "var(--mantine-primary-color-5)",
|
|
217
|
+
600: "var(--mantine-primary-color-6)",
|
|
218
|
+
700: "var(--mantine-primary-color-7)",
|
|
219
|
+
800: "var(--mantine-primary-color-8)",
|
|
220
|
+
900: "var(--mantine-primary-color-9)",
|
|
221
|
+
DEFAULT: "var(--mantine-primary-color-6)",
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
return colors;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* @param {MantineThemeOverride} theme
|
|
230
|
+
*/
|
|
231
|
+
function generateVariantSpecificColors(theme) {
|
|
232
|
+
const mantineColors = theme.colors;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* @type {NonNullable<TailwindConfig['theme']>['colors']}
|
|
236
|
+
*/
|
|
237
|
+
const colors = {};
|
|
238
|
+
|
|
239
|
+
for (const color of mantineColors) {
|
|
240
|
+
colors[`${color}-filled`] = `var(--mantine-color-${color}-filled)`;
|
|
241
|
+
colors[`${color}-filled-hover`] =
|
|
242
|
+
`var(--mantine-color-${color}-filled-hover)`;
|
|
243
|
+
colors[`${color}-light`] = `var(--mantine-color-${color}-light)`;
|
|
244
|
+
colors[`${color}-light-hover`] =
|
|
245
|
+
`var(--mantine-color-${color}-light-hover)`;
|
|
246
|
+
colors[`${color}-light-color`] =
|
|
247
|
+
`var(--mantine-color-${color}-light-color)`;
|
|
248
|
+
colors[`${color}-outline`] = `var(--mantine-color-${color}-outline)`;
|
|
249
|
+
colors[`${color}-outline-hover`] =
|
|
250
|
+
`var(--mantine-color-${color}-outline-hover)`;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return colors;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function generateVariantSpecificPrimaryColors() {
|
|
257
|
+
/**
|
|
258
|
+
* @type {NonNullable<TailwindConfig['theme']>['colors']}
|
|
259
|
+
*/
|
|
260
|
+
const colors = {
|
|
261
|
+
"primary-filled": "var(--mantine-primary-color-filled)",
|
|
262
|
+
"primary-filled-hover": "var(--mantine-primary-color-filled-hover)",
|
|
263
|
+
"primary-light": "var(--mantine-primary-color-light)",
|
|
264
|
+
"primary-light-hover": "var(--mantine-primary-color-light-hover)",
|
|
265
|
+
"primary-light-color": "var(--mantine-primary-color-light-color)",
|
|
266
|
+
"primary-outline": "var(--mantine-primary-color-outline)",
|
|
267
|
+
"primary-outline-hover": "var(--mantine-primary-color-outline-hover)",
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
return colors;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function generateOtherTextColors() {
|
|
274
|
+
/**
|
|
275
|
+
* @type {NonNullable<TailwindConfig['theme']>['colors']}
|
|
276
|
+
*/
|
|
277
|
+
const colors = {
|
|
278
|
+
white: "var(--mantine-color-white)",
|
|
279
|
+
black: "var(--mantine-color-black)",
|
|
280
|
+
body: "var(--mantine-color-text)",
|
|
281
|
+
error: "var(--mantine-color-error)",
|
|
282
|
+
placeholder: "var(--mantine-color-placeholder)",
|
|
283
|
+
anchor: "var(--mantine-color-anchor)",
|
|
284
|
+
DEFAULT: "var(--mantine-color-default-color)",
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
return colors;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function generateOtherBackgroundColors() {
|
|
291
|
+
/**
|
|
292
|
+
* @type {NonNullable<TailwindConfig['theme']>['colors']}
|
|
293
|
+
*/
|
|
294
|
+
const colors = {
|
|
295
|
+
white: "var(--mantine-color-white)",
|
|
296
|
+
black: "var(--mantine-color-black)",
|
|
297
|
+
body: "var(--mantine-color-body)",
|
|
298
|
+
error: "var(--mantine-color-error)",
|
|
299
|
+
placeholder: "var(--mantine-color-placeholder)",
|
|
300
|
+
anchor: "var(--mantine-color-anchor)",
|
|
301
|
+
DEFAULT: "var(--mantine-color-default)",
|
|
302
|
+
hover: "var(--mantine-color-default-hover)",
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
return colors;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
function generateOtherBorderColors() {
|
|
309
|
+
/**
|
|
310
|
+
* @type {NonNullable<TailwindConfig['theme']>['colors']}
|
|
311
|
+
*/
|
|
312
|
+
const colors = {
|
|
313
|
+
DEFAULT: "var(--mantine-color-default-border)",
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
return colors;
|
|
317
|
+
}
|