tailwind-preset-mantine 1.0.2 → 1.0.4
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/package.json +1 -1
- package/src/index.d.ts +2 -2
- package/src/index.js +5 -5
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MantineThemeColorsOverride } from "@mantine/core";
|
|
2
2
|
import type { Config } from "tailwindcss";
|
|
3
3
|
|
|
4
4
|
declare function tailwindPresetMantine(
|
|
5
|
-
options?: Partial<{ mantineColors:
|
|
5
|
+
options?: Partial<{ mantineColors: MantineThemeColorsOverride }>,
|
|
6
6
|
): Config;
|
|
7
7
|
|
|
8
8
|
export = tailwindPresetMantine;
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// for reference: https://github.com/mantinedev/mantine/blob/master/packages/%40mantine/core/src/core/MantineProvider/global.css
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @typedef {import('@mantine/core').
|
|
4
|
+
* @typedef {import('@mantine/core').MantineThemeColorsOverride} MantineThemeColorsOverride
|
|
5
5
|
* @typedef {import('tailwindcss').Config} TailwindConfig
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -176,7 +176,7 @@ module.exports = function tailwindPresetMantine({
|
|
|
176
176
|
};
|
|
177
177
|
|
|
178
178
|
/**
|
|
179
|
-
* @param {
|
|
179
|
+
* @param {MantineThemeColorsOverride} mantineColors
|
|
180
180
|
*/
|
|
181
181
|
function generateColors(mantineColors) {
|
|
182
182
|
/**
|
|
@@ -184,7 +184,7 @@ function generateColors(mantineColors) {
|
|
|
184
184
|
*/
|
|
185
185
|
const colors = {};
|
|
186
186
|
|
|
187
|
-
for (const color of mantineColors) {
|
|
187
|
+
for (const color of Object.keys(mantineColors)) {
|
|
188
188
|
colors[color] = {
|
|
189
189
|
50: `var(--mantine-color-${color}-0)`,
|
|
190
190
|
100: `var(--mantine-color-${color}-1)`,
|
|
@@ -224,7 +224,7 @@ function generatePrimaryColors() {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
/**
|
|
227
|
-
* @param {
|
|
227
|
+
* @param {MantineThemeColorsOverride} mantineColors
|
|
228
228
|
*/
|
|
229
229
|
function generateVariantSpecificColors(mantineColors) {
|
|
230
230
|
/**
|
|
@@ -232,7 +232,7 @@ function generateVariantSpecificColors(mantineColors) {
|
|
|
232
232
|
*/
|
|
233
233
|
const colors = {};
|
|
234
234
|
|
|
235
|
-
for (const color of mantineColors) {
|
|
235
|
+
for (const color of Object.keys(mantineColors)) {
|
|
236
236
|
colors[`${color}-filled`] = `var(--mantine-color-${color}-filled)`;
|
|
237
237
|
colors[`${color}-filled-hover`] =
|
|
238
238
|
`var(--mantine-color-${color}-filled-hover)`;
|