Minor Changes
-
#1749
caacf56Thanks @bschlenk! - AllowcreateGlobalVarto accept a name with a leading--Similar to
createGlobalThemeContract,createGlobalVarnow trims a leading--from the variable name. This can be useful if you want to keep the full variable name searchable in your codebase.EXAMPLE USAGE:
import { createGlobalVar } from '@vanilla-extract/css'; // Both produce `var(--my-global-var)` const a = createGlobalVar('my-global-var'); const b = createGlobalVar('--my-global-var');
-
#1720
7bbe189Thanks @cahnory! -style, globalStyle: Add support for@scoperulesEXAMPLE USAGE:
import { style, globalStyle } from '@vanilla-extact/css'; export const styleWithScopeRule = style({ '@scope': { '(body)': { ':after': { content: '"Scoped to body"' } } } }); globalStyle('div', { '@scope': { '(body)': { ':after': { content: '"Scoped to body"' } } } });
Patch Changes
-
#1731
aec0ab7Thanks @sashank-gogula-glean! - Fix incorrect class name substitution when composed class lists contain regex metacharactersClass names containing characters such as
(,),+, or.were being interpreted as regex syntax when building the substitution pattern for composed class lists, causing malformed matches. The class list is now escaped before constructing theRegExp. -
#1740
a4b120fThanks @askoufis! - Fix a bug causingfallbackVarto discard an empty string passed as the fallback valueAn empty string fallback was silently dropped, producing
var(--myVar)instead of the CSS empty-fallback formvar(--myVar, ).fallbackVarnow treats''like any other fallback value.