@vanilla-extract/recipes
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -58,5 +58,7 @@ 'use strict'; | ||
var shouldApplyCompound = (compoundCheck, selections) => { | ||
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => { | ||
for (var key of Object.keys(compoundCheck)) { | ||
if (compoundCheck[key] !== selections[key]) { | ||
var _selections$key; | ||
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) { | ||
return false; | ||
@@ -97,3 +99,3 @@ } | ||
for (var [compoundCheck, compoundClassName] of config.compoundVariants) { | ||
if (shouldApplyCompound(compoundCheck, selections)) { | ||
if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) { | ||
className += ' ' + compoundClassName; | ||
@@ -100,0 +102,0 @@ } |
@@ -58,5 +58,7 @@ 'use strict'; | ||
var shouldApplyCompound = (compoundCheck, selections) => { | ||
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => { | ||
for (var key of Object.keys(compoundCheck)) { | ||
if (compoundCheck[key] !== selections[key]) { | ||
var _selections$key; | ||
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) { | ||
return false; | ||
@@ -97,3 +99,3 @@ } | ||
for (var [compoundCheck, compoundClassName] of config.compoundVariants) { | ||
if (shouldApplyCompound(compoundCheck, selections)) { | ||
if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) { | ||
className += ' ' + compoundClassName; | ||
@@ -100,0 +102,0 @@ } |
@@ -54,5 +54,7 @@ function _defineProperty(obj, key, value) { | ||
var shouldApplyCompound = (compoundCheck, selections) => { | ||
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => { | ||
for (var key of Object.keys(compoundCheck)) { | ||
if (compoundCheck[key] !== selections[key]) { | ||
var _selections$key; | ||
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) { | ||
return false; | ||
@@ -93,3 +95,3 @@ } | ||
for (var [compoundCheck, compoundClassName] of config.compoundVariants) { | ||
if (shouldApplyCompound(compoundCheck, selections)) { | ||
if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) { | ||
className += ' ' + compoundClassName; | ||
@@ -96,0 +98,0 @@ } |
{ | ||
"name": "@vanilla-extract/recipes", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Create multi-variant styles with a type-safe runtime API, heavily inspired by https://stitches.dev", | ||
@@ -40,4 +40,4 @@ "sideEffects": false, | ||
"devDependencies": { | ||
"@vanilla-extract/css": "^1.6.8" | ||
"@vanilla-extract/css": "^1.7.1" | ||
} | ||
} |
@@ -87,2 +87,3 @@ # 🧁 vanilla-extract | ||
- [Gatsby](#gatsby) | ||
- [Rollup](#rollup) | ||
- [Test environments](#test-environments) | ||
@@ -334,2 +335,28 @@ - [Configuration](#configuration) | ||
### Rollup | ||
> Note: This option is useful for library development but not suitable for application bundles. | ||
> Rollup has no built-in CSS bundling, so this plugin just outputs styles as individual CSS assets. | ||
> For applications we instead recommend to use Vite | ||
> (which itself uses Rollup under the hood but comes with its own CSS bundling). | ||
1. Install the dependencies. | ||
```bash | ||
npm install @vanilla-extract/css @vanilla-extract/rollup-plugin | ||
``` | ||
2. Add the [Rollup](https://rollupjs.org/) plugin to your Rollup config. | ||
> 💡 This plugin accepts an optional [configuration object](#configuration). | ||
```js | ||
import { vanillaExtractPlugin } from '@vanilla-extract/rollup-plugin'; | ||
// rollup.config.js | ||
export default { | ||
plugins: [vanillaExtractPlugin()] | ||
} | ||
``` | ||
### Test environments | ||
@@ -336,0 +363,0 @@ |
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
47062
415
1226