postcss-preset-mantine
Advanced tools
Comparing version 1.16.0 to 1.17.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const nested = require('postcss-nested'); | ||
@@ -111,3 +112,14 @@ const mixins = require('postcss-mixins'); | ||
}); | ||
const defaultFeatures = { | ||
lightDarkFunction: true, | ||
nested: true, | ||
colorMixAlpha: true, | ||
remEmFunctions: true, | ||
mixins: true, | ||
}; | ||
module.exports = (options = {}) => { | ||
const features = { | ||
...defaultFeatures, | ||
...(options.features || {}), | ||
}; | ||
const plugins = []; | ||
@@ -117,38 +129,46 @@ if (options.autoRem) { | ||
} | ||
if (features.lightDarkFunction) { | ||
plugins.push(lightDark()); | ||
} | ||
if (features.nested) { | ||
plugins.push(nested()); | ||
} | ||
if (features.colorMixAlpha) { | ||
plugins.push(colorMixAlpha()); | ||
} | ||
if (features.remEmFunctions) { | ||
plugins.push(remEm()); | ||
} | ||
if (features.mixins) { | ||
plugins.push(mixins({ | ||
mixins: { | ||
light: colorSchemeMixin('light'), | ||
dark: colorSchemeMixin('dark'), | ||
'light-root': rootColorSchemeMixin('light'), | ||
'dark-root': rootColorSchemeMixin('dark'), | ||
'where-light': colorSchemeMixin('light', 'where'), | ||
'where-dark': colorSchemeMixin('dark', 'where'), | ||
'where-light-root': rootColorSchemeMixin('light', 'where'), | ||
'where-dark-root': rootColorSchemeMixin('dark', 'where'), | ||
hover: hoverMixin, | ||
'where-hover': hoverWhereMixin, | ||
rtl: rtlMixin, | ||
ltr: ltrMixin, | ||
'not-rtl': notRtlMixin, | ||
'not-ltr': notLtrMixin, | ||
'where-rtl': rtlWhereMixin, | ||
'where-ltr': ltrWhereMixin, | ||
'where-not-rtl': notRtlWhereMixin, | ||
'where-not-ltr': notLtrWhereMixin, | ||
'smaller-than': smallerThanMixin, | ||
'larger-than': largerThanMixin, | ||
...(options.mixins || {}), | ||
}, | ||
})); | ||
} | ||
return { | ||
postcssPlugin: 'postcss-preset-mantine', | ||
plugins: [ | ||
lightDark(), | ||
nested(), | ||
colorMixAlpha(), | ||
remEm(), | ||
...plugins, | ||
mixins({ | ||
mixins: { | ||
light: colorSchemeMixin('light'), | ||
dark: colorSchemeMixin('dark'), | ||
'light-root': rootColorSchemeMixin('light'), | ||
'dark-root': rootColorSchemeMixin('dark'), | ||
'where-light': colorSchemeMixin('light', 'where'), | ||
'where-dark': colorSchemeMixin('dark', 'where'), | ||
'where-light-root': rootColorSchemeMixin('light', 'where'), | ||
'where-dark-root': rootColorSchemeMixin('dark', 'where'), | ||
hover: hoverMixin, | ||
'where-hover': hoverWhereMixin, | ||
rtl: rtlMixin, | ||
ltr: ltrMixin, | ||
'not-rtl': notRtlMixin, | ||
'not-ltr': notLtrMixin, | ||
'where-rtl': rtlWhereMixin, | ||
'where-ltr': ltrWhereMixin, | ||
'where-not-rtl': notRtlWhereMixin, | ||
'where-not-ltr': notLtrWhereMixin, | ||
'smaller-than': smallerThanMixin, | ||
'larger-than': largerThanMixin, | ||
...(options.mixins || {}), | ||
}, | ||
}), | ||
], | ||
plugins, | ||
}; | ||
}; | ||
module.exports.postcss = true; |
{ | ||
"name": "postcss-preset-mantine", | ||
"version": "1.16.0", | ||
"version": "1.17.0", | ||
"description": "PostCSS preset for Mantine (7.0+) applications", | ||
@@ -27,4 +27,2 @@ "main": "dist/preset.js", | ||
"jest": "^29.5.0", | ||
"new-github-release-url": "^2.0.0", | ||
"open": "^10.0.0", | ||
"postcss": "^8.4.24", | ||
@@ -31,0 +29,0 @@ "prettier": "^2.8.8", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30971
20
458