@vanilla-extract/css
Advanced tools
Comparing version 1.2.0 to 1.2.1
# @vanilla-extract/css | ||
## 1.2.1 | ||
### Patch Changes | ||
- [#265](https://github.com/seek-oss/vanilla-extract/pull/265) [`385155f`](https://github.com/seek-oss/vanilla-extract/commit/385155faff4eeab0bba5137383fe948999c04b2c) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Fix fileScope error if `composeStyles` is called at runtime | ||
## 1.2.0 | ||
@@ -4,0 +10,0 @@ |
import type { FileScope } from './types'; | ||
export declare function setFileScope(filePath: string, packageName?: string): void; | ||
export declare function endFileScope(): void; | ||
export declare function hasFileScope(): boolean; | ||
export declare function getFileScope(): FileScope; | ||
export declare function getAndIncrementRefCounter(): number; |
@@ -393,3 +393,11 @@ 'use strict'; | ||
function composeStyles(...classNames) { | ||
return createComposition(dudupeAndJoinClassList(classNames)); | ||
const classList = dudupeAndJoinClassList(classNames); // When using Sprinkles with the runtime (e.g. within a jest test) | ||
// `composeStyles` can be called outside of a fileScope. Checking | ||
// the fileScope is bit of a hack but will solve the issue for now | ||
if (!fileScope_dist_vanillaExtractCssFileScope.hasFileScope()) { | ||
return classList; | ||
} | ||
return createComposition(classList); | ||
} | ||
@@ -396,0 +404,0 @@ |
import { transformCss } from '../transformCss/dist/vanilla-extract-css-transformCss.browser.esm.js'; | ||
import { setAdapterIfNotSet, appendCss, registerClassName, registerComposition } from '../adapter/dist/vanilla-extract-css-adapter.browser.esm.js'; | ||
import hash from '@emotion/hash'; | ||
import { getAndIncrementRefCounter, getFileScope } from '../fileScope/dist/vanilla-extract-css-fileScope.browser.esm.js'; | ||
import { getAndIncrementRefCounter, getFileScope, hasFileScope } from '../fileScope/dist/vanilla-extract-css-fileScope.browser.esm.js'; | ||
import { walkObject, get } from '@vanilla-extract/private'; | ||
@@ -382,5 +382,13 @@ import cssesc from 'cssesc'; | ||
function composeStyles(...classNames) { | ||
return createComposition(dudupeAndJoinClassList(classNames)); | ||
const classList = dudupeAndJoinClassList(classNames); // When using Sprinkles with the runtime (e.g. within a jest test) | ||
// `composeStyles` can be called outside of a fileScope. Checking | ||
// the fileScope is bit of a hack but will solve the issue for now | ||
if (!hasFileScope()) { | ||
return classList; | ||
} | ||
return createComposition(classList); | ||
} | ||
export { assignVars, composeStyles, createGlobalTheme, createTheme, createThemeContract, createVar, fallbackVar, fontFace, generateIdentifier, globalFontFace, globalKeyframes, globalStyle, keyframes, style, styleVariants }; |
@@ -393,3 +393,11 @@ 'use strict'; | ||
function composeStyles(...classNames) { | ||
return createComposition(dudupeAndJoinClassList(classNames)); | ||
const classList = dudupeAndJoinClassList(classNames); // When using Sprinkles with the runtime (e.g. within a jest test) | ||
// `composeStyles` can be called outside of a fileScope. Checking | ||
// the fileScope is bit of a hack but will solve the issue for now | ||
if (!fileScope_dist_vanillaExtractCssFileScope.hasFileScope()) { | ||
return classList; | ||
} | ||
return createComposition(classList); | ||
} | ||
@@ -396,0 +404,0 @@ |
@@ -367,3 +367,11 @@ 'use strict'; | ||
function composeStyles(...classNames) { | ||
return createComposition(dudupeAndJoinClassList(classNames)); | ||
const classList = dudupeAndJoinClassList(classNames); // When using Sprinkles with the runtime (e.g. within a jest test) | ||
// `composeStyles` can be called outside of a fileScope. Checking | ||
// the fileScope is bit of a hack but will solve the issue for now | ||
if (!fileScope_dist_vanillaExtractCssFileScope.hasFileScope()) { | ||
return classList; | ||
} | ||
return createComposition(classList); | ||
} | ||
@@ -370,0 +378,0 @@ |
import { transformCss } from '../transformCss/dist/vanilla-extract-css-transformCss.esm.js'; | ||
import { setAdapterIfNotSet, appendCss, registerClassName, registerComposition } from '../adapter/dist/vanilla-extract-css-adapter.esm.js'; | ||
import hash from '@emotion/hash'; | ||
import { getAndIncrementRefCounter, getFileScope } from '../fileScope/dist/vanilla-extract-css-fileScope.esm.js'; | ||
import { getAndIncrementRefCounter, getFileScope, hasFileScope } from '../fileScope/dist/vanilla-extract-css-fileScope.esm.js'; | ||
import { walkObject, get } from '@vanilla-extract/private'; | ||
@@ -382,5 +382,13 @@ import cssesc from 'cssesc'; | ||
function composeStyles(...classNames) { | ||
return createComposition(dudupeAndJoinClassList(classNames)); | ||
const classList = dudupeAndJoinClassList(classNames); // When using Sprinkles with the runtime (e.g. within a jest test) | ||
// `composeStyles` can be called outside of a fileScope. Checking | ||
// the fileScope is bit of a hack but will solve the issue for now | ||
if (!hasFileScope()) { | ||
return classList; | ||
} | ||
return createComposition(classList); | ||
} | ||
export { assignVars, composeStyles, createGlobalTheme, createTheme, createThemeContract, createVar, fallbackVar, fontFace, generateIdentifier, globalFontFace, globalKeyframes, globalStyle, keyframes, style, styleVariants }; |
@@ -26,2 +26,5 @@ 'use strict'; | ||
} | ||
function hasFileScope() { | ||
return fileScopes.length > 0; | ||
} | ||
function getFileScope() { | ||
@@ -46,2 +49,3 @@ if (fileScopes.length === 0) { | ||
exports.getFileScope = getFileScope; | ||
exports.hasFileScope = hasFileScope; | ||
exports.setFileScope = setFileScope; |
@@ -18,2 +18,5 @@ import dedent from 'dedent'; | ||
} | ||
function hasFileScope() { | ||
return fileScopes.length > 0; | ||
} | ||
function getFileScope() { | ||
@@ -35,2 +38,2 @@ if (fileScopes.length === 0) { | ||
export { endFileScope, getAndIncrementRefCounter, getFileScope, setFileScope }; | ||
export { endFileScope, getAndIncrementRefCounter, getFileScope, hasFileScope, setFileScope }; |
@@ -26,2 +26,5 @@ 'use strict'; | ||
} | ||
function hasFileScope() { | ||
return fileScopes.length > 0; | ||
} | ||
function getFileScope() { | ||
@@ -46,2 +49,3 @@ if (fileScopes.length === 0) { | ||
exports.getFileScope = getFileScope; | ||
exports.hasFileScope = hasFileScope; | ||
exports.setFileScope = setFileScope; |
@@ -26,2 +26,5 @@ 'use strict'; | ||
} | ||
function hasFileScope() { | ||
return fileScopes.length > 0; | ||
} | ||
function getFileScope() { | ||
@@ -46,2 +49,3 @@ if (fileScopes.length === 0) { | ||
exports.getFileScope = getFileScope; | ||
exports.hasFileScope = hasFileScope; | ||
exports.setFileScope = setFileScope; |
@@ -18,2 +18,5 @@ import dedent from 'dedent'; | ||
} | ||
function hasFileScope() { | ||
return fileScopes.length > 0; | ||
} | ||
function getFileScope() { | ||
@@ -35,2 +38,2 @@ if (fileScopes.length === 0) { | ||
export { endFileScope, getAndIncrementRefCounter, getFileScope, setFileScope }; | ||
export { endFileScope, getAndIncrementRefCounter, getFileScope, hasFileScope, setFileScope }; |
{ | ||
"name": "@vanilla-extract/css", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Zero-runtime Stylesheets-in-TypeScript", | ||
@@ -5,0 +5,0 @@ "sideEffects": true, |
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
226746
5539