postcss-preset-mantine
Advanced tools
Comparing version 1.12.1 to 1.12.2
@@ -9,3 +9,10 @@ "use strict"; | ||
const theme = require('./postcss-mantine-theme'); | ||
function colorSchemeMixin(colorScheme) { | ||
function colorSchemeMixin(colorScheme, type = 'default') { | ||
if (type === 'where') { | ||
return { | ||
[`:where([data-mantine-color-scheme='${colorScheme}']) &`]: { | ||
'@mixin-content': {}, | ||
}, | ||
}; | ||
} | ||
return { | ||
@@ -17,3 +24,10 @@ [`[data-mantine-color-scheme='${colorScheme}'] &`]: { | ||
} | ||
function rootColorSchemeMixin(colorScheme) { | ||
function rootColorSchemeMixin(colorScheme, type = 'default') { | ||
if (type === 'where') { | ||
return { | ||
[`&:where(:root[data-mantine-color-scheme='${colorScheme}'])`]: { | ||
'@mixin-content': {}, | ||
}, | ||
}; | ||
} | ||
return { | ||
@@ -57,2 +71,22 @@ [`&[data-mantine-color-scheme='${colorScheme}']`]: { | ||
}; | ||
const rtlWhereMixin = { | ||
':where([dir="rtl"]) &': { | ||
'@mixin-content': {}, | ||
}, | ||
}; | ||
const ltrWhereMixin = { | ||
':where([dir="ltr"]) &': { | ||
'@mixin-content': {}, | ||
}, | ||
}; | ||
const notRtlWhereMixin = { | ||
':where([dir="ltr"]) &': { | ||
'@mixin-content': {}, | ||
}, | ||
}; | ||
const notLtrWhereMixin = { | ||
':where([dir="ltr"]) &': { | ||
'@mixin-content': {}, | ||
}, | ||
}; | ||
const smallerThanMixin = (_mixin, breakpoint) => ({ | ||
@@ -83,2 +117,6 @@ [`@media (max-width: ${converters.em(converters.px(breakpoint) - 0.1)})`]: { | ||
'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, | ||
@@ -89,2 +127,6 @@ rtl: rtlMixin, | ||
'not-ltr': notLtrMixin, | ||
'where-rtl': rtlWhereMixin, | ||
'where-ltr': ltrWhereMixin, | ||
'where-not-rtl': notRtlWhereMixin, | ||
'where-not-ltr': notLtrWhereMixin, | ||
'smaller-than': smallerThanMixin, | ||
@@ -91,0 +133,0 @@ 'larger-than': largerThanMixin, |
{ | ||
"name": "postcss-preset-mantine", | ||
"version": "1.12.1", | ||
"version": "1.12.2", | ||
"description": "PostCSS preset for Mantine (7.0+) applications", | ||
@@ -41,8 +41,8 @@ "main": "dist/preset.js", | ||
"lint": "eslint src --cache", | ||
"format": "prettier src", | ||
"format:check": "prettier --check src", | ||
"prettier:check": "prettier --check src", | ||
"typecheck": "tsc --noEmit", | ||
"jest": "jest", | ||
"jest:update-snapshots": "jest --updateSnapshot", | ||
"prepublish": "yarn test && yarn build", | ||
"test": "npm run lint && npm run format:check && npm run typecheck && npm run jest", | ||
"test": "npm run lint && npm run prettier:check && npm run typecheck && npm run jest", | ||
"clean": "rm -rf dist", | ||
@@ -49,0 +49,0 @@ "release": "esno scripts/release" |
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
32843
477