-
#1566
8b49b35Thanks @lfantone! -style: Add support for@starting-stylerulesEXAMPLE USAGE:
import { style } from '@vanilla-extact/css'; export const styleWithStartingStyle = style({ backgroundColor: 'black', '@starting-style': { backgroundColor: 'white' } });
-
#1646
0b2c09eThanks @plesiecki! - Swap the order ofcreateVar's overloads to enable inference ofVarDelcarationtype -
#1666
c6047fbThanks @askoufis! - Remove custom container properties typeThe
csstypepackage used by Vanilla Extract now provides types for container properties, so the custom type definitions that were previously necessary have been removed.
-
#1610
2b0be1bThanks @askoufis! - Revert "Improve ESM package entrypoints (#1597)" to fixNamed export not founderror when importing ESM entrypoints -
Updated dependencies [
2b0be1b]:- @vanilla-extract/[email protected]
-
#1596
f0533beThanks @cqh963852! -addFunctionSerializer: Fixargstype to support arrays of primitive values -
Updated dependencies [
9d16de8,a7fccf8]:- @vanilla-extract/[email protected]
-
#1557
134117dThanks @askoufis! -css: Improve type-checking performance of string literal types that include CSS variables -
#1560
c66be53Thanks @andjsrk! - Remove unnecessary intersections in a few types -
Updated dependencies [
134117d]:- @vanilla-extract/[email protected]
- #1533
c432ff3Thanks @askoufis! - Fixes a bug where@containerqueries insideselectorswere not being generated
-
#1092
fd673f6Thanks @z4o4z! -keyframes: Add support for avarsproperty to steps withinkeyframesdeclarationsExample usage:
import { createVar, keyframes } from '@vanilla-extract/css'; const angle = createVar({ syntax: '<angle>', inherits: false, initialValue: '0deg' }); export const angleKeyframes = keyframes({ '0%': { vars: { [angle]: '0deg' } }, '100%': { vars: { [angle]: '360deg' } } });
-
#1512
4abfc0bThanks @askoufis! -createTheme,createGlobalTheme: Add support for assigning themes to a layerThemes can now be assigned to a layer by name using the
@layerkey at the top-level of the theme definition.EXAMPLE USAGE:
// themes.css.ts import { createTheme, createGlobalTheme, layer } from '@vanilla-extract/css'; export const themeLayer = layer(); export const [themeA, vars] = createTheme({ '@layer': themeLayer, color: { brand: 'blue' }, font: { body: 'arial' } }); export const vars2 = createGlobalTheme(':root', { '@layer': themeLayer, space: { small: '10px', large: '20px' } });
This will generate the following CSS:
@layer themes_themeLayer__1k6oxph0; @layer themes_themeLayer__1k6oxph0 { .themes_themeA__1k6oxph1 { --color-brand__1k6oxph2: blue; --font-body__1k6oxph3: arial; } :root { --space-small__z05zdf1: 10px; --space-large__z05zdf2: 20px; } }
-
#1092
fd673f6Thanks @z4o4z! -createVar: Add support for defining@propertyrulesExample usage:
import { createVar } from '@vanilla-extract/css'; export const myVar = createVar({ syntax: '<number>', inherits: false, initialValue: '0.5' });
This will generate the following CSS:
@property --myVar__jteyb14 { syntax: '<number>'; inherits: false; initial-value: 0.5; }
- #1505
103ce57Thanks @askoufis! - Fixes a bug that caused invalid selectors to be generated when adjacent classnames contained a substring equal to another local classname
-
#1475
cd9d8b2Thanks @corradopetrelli! - Add::-webkit-calendar-picker-indicatoras a valid pseudo-element -
#1450
7b256d2Thanks @wuz! - AddcreateViewTransitionAPIcreateViewTransitioncreates a single scoped view transition name for use with CSS View Transitions. This avoids potential naming collisions with other view transitions.import { style, createViewTransition } from '@vanilla-extract/css'; export const titleViewTransition = createViewTransition(); export const pageTitle = style({ viewTransitionName: titleViewTransition });
- #1466
6432199fa0717f424fb3f45fbe36410b03b01c1cThanks @askoufis! - Speed up dev prefix generation for long file paths
-
#1463
61878f5fb21a33190ef242551c639e216ba4748aThanks @askoufis! - Export types withexport { type T }syntax -
Updated dependencies [
61878f5fb21a33190ef242551c639e216ba4748a]:- @vanilla-extract/[email protected]
-
#1425
b86f3f59c86420e12593996a14f8cdb5db2f7c25Thanks @askoufis! - Fixes a bug where declarations with identical selectors would not be merged correctly inside conditional rules -
#1410
99e974b2ae56e1e851b376988216b7bd30813813Thanks @pengooseDev! - Fixes a bug causing incorrect type inference when callingcreateThemewith a theme contract
-
#1335
b8a99e4980710a34692034d5da43e584edbc3d17Thanks @askoufis! - Addtypesfield topackage.json -
Updated dependencies [
b8a99e4980710a34692034d5da43e584edbc3d17]:- @vanilla-extract/[email protected]
-
#1386
e58cf9013c6f6cdfacb2a7936b3354e71138e9fbThanks @askoufis! - Replaceoutdentdependency withdedent -
#1385
3df9b4ebc5ad7e03e5c908c10216447b7089132aThanks @askoufis! - Replacechalkdependency withpicocolors
-
#1379
df9fe3ee3fc0057bc14a2333a405f8229f80c214Thanks @ronci! - Add support for passing multiple font face rules toglobalFontFaceEXAMPLE USAGE:
const gentium = 'GlobalGentium'; globalFontFace(gentium, [ { src: 'local("Gentium")', fontWeight: 'normal' }, { src: 'local("Gentium Bold")', fontWeight: 'bold' } ]);
-
#1368
90f0315Thanks @askoufis! - Update@vanilla-extract/privatedependency -
Updated dependencies [
90f0315]:- @vanilla-extract/[email protected]
- #1254
f373d7fThanks @EvgenNoskov! - Allow hyphens in class names when using a custom identifier
- #1207
906d288Thanks @CroModder! - Add some missing simple pseudo selectors
- #1160
e391baeThanks @SombreroElGringo! - Users can now provide a custom identifier hashing function
-
#1114
001be83Thanks @taylorfsteele! - Supports passing multiple font face rules tofontFaceExample usage
import { fontFace, style } from '@vanilla-extract/css'; const gentium = fontFace([ { src: 'local("Gentium")', fontWeight: 'normal' }, { src: 'local("Gentium Bold")', fontWeight: 'bold' } ]); export const font = style({ fontFamily: gentium });
- #1106
8b1c965Thanks @mattcompiles! - Fix "Invalid selector" errors on pseudo-elements with params
-
#955
ece5fc3Thanks @mrm007! - Add support for cascade layers, i.e.@layer.Create a scoped layer to avoid naming collisions, or with an explicit name using globalLayer. Styles can then be assigned to layers using the
@layerkey within your style definition.// layers.css.ts import { layer } from '@vanilla-extract/css'; export const reset = layer('reset'); export const framework = layer('framework'); export const typography = layer('typography'); // typography.css.ts import { style } from '@vanilla-extract/css'; import { typography } from './layers.css'; export const standard = style({ '@layer': { [typography]: { fontSize: '1rem' } } });
- #1030
49ff399Thanks @markdalgleish! - Provide current file scope as an additional argument to the adapter methodsregisterClassNameandregisterComposition. This is to allow fine-grained caching of registered class names and class compositions per file.
- #1030
49ff399Thanks @markdalgleish! - Throw whensetAdapteris called with a falsy value
-
#990
3b724b9Thanks @askoufis! - Align transformation of@keyframesrules with other rulesThis fixes a bug where invalid CSS could be generated inside
@keyframesrules.
- #938
d02684eThanks @adrianaferrugento! - Bumpdeep-object-diffto v1.1.9 in order to fix security vulnerability
- #943
4ecdcd7Thanks @AndrewLeedham! - Fix atscerror caused by a dependency's type declarations being unnecessarily bundled
- #900
176c026Thanks @wobsoriano! - Bump@emotion/hashto 0.9.0
- #893
8ed77c2Thanks @mattcompiles! - Fix issue where conditional styles (e.g.@media,@supports, etc) could be ordered incorrectly
-
#837
9191d5aThanks @mattcompiles! - Improve performance of selector transformsThis issue occured on M1 Macs due to performance issues with large regex patterns.
- #833
b53558aThanks @mattcompiles! - Fix entrypoint resolving in Vitest
-
#810
c38b152Thanks @markdalgleish! - Support excluding file names fromgenerateIdentifieroutput. This is available by passing a newly-added options object rather than a string.Example usage
import { generateIdentifier } from '@vanilla-extract/css'; const identifier = generateIdentifier({ debugId, debugFileName: false });
- #810
c38b152Thanks @markdalgleish! - Fix spaces in debug IDs for variable names.
- #810
c38b152Thanks @markdalgleish! - Fix file name prefix in debug names when file extension is.cjsor.mjs.
-
#807
b0b3662Thanks @mattcompiles! - AddcreateContainerAPIcreateContainercreates a single scoped container name for use with CSS Container Queries. This avoids potential naming collisions with other containers.import { style, createContainer } from '@vanilla-extract/css'; export const sidebarContainer = createContainer(); export const sidebar = style({ containerName: sidebarContainer }); export const navigation = style({ '@container': { [`${sidebarContainer} (min-width: 400px)`]: { display: 'flex' } } });
-
#807
b0b3662Thanks @mattcompiles! - Add support for container queries via the new@containerkey.import { style } from '@vanilla-extract/css'; export const myStyle = style({ '@container': { '(min-width: 400px)': { display: 'flex' } } });
- #723
8467fc2Thanks @mattcompiles! - Validate duplicate '@media' in media queries
- #684
e531251Thanks @mattcompiles! - Improve media query validation messaging
- #651
32f309fThanks @amorriscode! - Add CSS media query validation
-
#520
b294764Thanks @mattcompiles! - Transpile code to meet esmodules targetThis should allow code that runs in the browser to conform to most browser policies. If you need to support browsers prior to the esmodules target (e.g. IE 11) then you'll need to configure custom transpilation in your projects.
-
Updated dependencies [
b294764]:- @vanilla-extract/[email protected]
-
#514
e3dfd4aThanks @benjervis! - Export the package.json for css/fileScopeThis is required to maintain backwards compatibility with older versions of webpack-plugin
- #508
d15e783Thanks @markdalgleish! - Addexportsfield topackage.jsonso nested package paths can be imported in a Node.js ESM context
- #504
16c960fThanks @mattcompiles! - Ensure identifiers are escaped properly
-
#489
0c1ec7dThanks @mattcompiles! - Fix theme contract types in TypeScript 4.5 -
Updated dependencies [
0c1ec7d]:- @vanilla-extract/[email protected]
- #428
e915f7fThanks @mattcompiles! - Ensure whitespace is stripped from debug Ids
-
#409
a9c5cb7Thanks @benjervis! - Improve the browser runtime dev experience.The vanilla browser runtime now creates style tags containing the CSS itself, rather than injecting it directly into the CSSOM.
This helps with debugability, as the generated CSS can actually be seen in the devtools. There are also some new attributes set on the style tags, making it easier to identify the source of each style.
- #381
b1e5936Thanks @mattcompiles! - Fix identfiers not respectingNODE_ENVfor SSR builds
-
#361
531044bThanks @markdalgleish! - Automatically add quotes tocontentvalues when necessaryFor example
{ content: '' }will now return CSS of{ content: "" }
- #354
cdad52dThanks @mattcompiles! - Fix function serialization with older versions of the@vanilla-extract/integrationpackage
-
#348
c6cd1f2Thanks @mattcompiles! - AddaddFunctionSerializerfunctionThis also marks
addRecipeas deprecated.
- #343
50bae14Thanks @mattcompiles! - Cleanup adapter after processing styles
-
#326
2d9b4c3Thanks @mattcompiles! - Support passing arrays of styles tostyleandstyleVariantsMultiple styles can now be composed into a single rule by providing an array of styles.
import { style } from '@vanilla-extract/css'; const base = style({ padding: 12 }); export const primary = style([ base, { background: 'blue' } ]); export const secondary = style([ base, { background: 'aqua' } ]);
When composed styles are used in selectors, they are assigned an additional class if required so they can be uniquely identified. When selectors are processed internally, the composed classes are removed, only leaving behind the unique identifier classes. This allows you to treat them as if they were a single class within vanilla-extract selectors.
import { style, globalStyle } from '@vanilla-extract/css'; const background = style({ background: 'mintcream' }); const padding = style({ padding: 12 }); export const container = style([background, padding]); globalStyle(`${container} *`, { boxSizing: 'border-box' });
This feature is a replacement for the standalone
composeStylesfunction which is now marked as deprecated. You can usestylewith an array as a drop-in replacement.-export const container = composeStyles(background, padding); +export const container = style([background, padding]);
-
#319
26832f1Thanks @nicksrandall! - AddcreateGlobalThemeContractfunctionCreates a contract of globally scoped variable names for themes to implement.
💡 This is useful if you want to make your theme contract available to non-JavaScript environments.
// themes.css.ts import { createGlobalThemeContract, createGlobalTheme } from '@vanilla-extract/css'; export const vars = createGlobalThemeContract({ color: { brand: 'color-brand' }, font: { body: 'font-body' } }); createGlobalTheme(':root', vars, { color: { brand: 'blue' }, font: { body: 'arial' } });
You can also provide a map function as the second argument which has access to the value and the object path.
For example, you can automatically prefix all variable names.
// themes.css.ts import { createGlobalThemeContract } from '@vanilla-extract/css'; export const vars = createGlobalThemeContract( { color: { brand: 'color-brand' }, font: { body: 'font-body' } }, (value) => `prefix-${value}` );
You can also use the map function to automatically generate names from the object path, joining keys with a hyphen.
// themes.css.ts import { createGlobalThemeContract } from '@vanilla-extract/css'; export const vars = createGlobalThemeContract( { color: { brand: null }, font: { body: null } }, (_value, path) => `prefix-${path.join('-')}` );
- #323
1e7d647Thanks @mattcompiles! - Support configurable identifier types
- #284
e65c029Thanks @markdalgleish! - Fix multiple top-level conditional styles in runtime version
- #274
21e2197Thanks @markdalgleish! - Fix type errors with nested null values in theme contracts
- #265
385155fThanks @mattcompiles! - Fix fileScope error ifcomposeStylesis called at runtime
-
#259
b8a6441Thanks @markdalgleish! - Allow the result ofcomposeStylesto be used in selectorsWhen style compositions are used in selectors, they are now assigned an additional class so they can be uniquely identified. When selectors are processed internally, the composed classes are removed, only leaving behind the unique identifier classes. This allows you to treat them as if they were a single class within vanilla-extract selectors.
import { style, globalStyle, composeStyles } from '@vanilla-extract/css'; const background = style({ background: 'mintcream' }); const padding = style({ padding: 12 }); export const container = composeStyles( background, padding ); globalStyle(`${container} *`, { boxSizing: 'border-box' });
- #238
1ee9ba2Thanks @mattcompiles! - Allow passing of null contract tokens increateThemeContract
-
#235
1e49dfcThanks @mattcompiles! - FixcreateGlobalThemetypes when accepting an existing contract -
Updated dependencies [
1e49dfc]:- @vanilla-extract/[email protected]
-
#206
64c18f9Thanks @mattcompiles! - AdddisableRuntimeStylesentrypointIn testing environments (like
jsdom) vanilla-extract will create and insert styles. While this is often desirable, it can be a major slowdown in your tests. If your tests don't require styles to be available, thedisableRuntimeStylesimport will disable all style creation.// setupTests.ts import '@vanilla-extract/css/disableRuntimeStyles';
- #204
16f77efThanks @markdalgleish! - Ensure:where/:isselectors are supported when validating scoped selectors
- #171
84a8611Thanks @mattcompiles! - Release v1
- Updated dependencies [
84a8611]:- @vanilla-extract/[email protected]
- #166
156e585Thanks @mattcompiles! - Improve missing filescope error
- #168
962d64fThanks @mattcompiles! - Allow camel-case CSS var names instead of converting to snake-case
-
#154
f5ab957Thanks @mattcompiles! - Improved conditional CSS renderingPreviously all conditional CSS (@media and @supports) in a
.css.tsfile would merge together. This meant each unique query (e.g.@media screen and (min-width: 700px)) would only be rendered once. This output is ideal for file size but can lead to the conditions being rendered in the wrong order. The new strategy will still merge conditions together but only if it is considered safe to do so.
-
#152
ae532f5Thanks @Saartje87! - Added support for the following simple pseudo selectors::-webkit-resizer::-webkit-scrollbar-button::-webkit-scrollbar-corner::-webkit-scrollbar-thumb::-webkit-scrollbar-track-piece::-webkit-scrollbar-track::-webkit-scrollbar
- #146
bf51ab5Thanks @markdalgleish! - Fix escaped characters in selectors
- #132
4f92126Thanks @markdalgleish! - IntroduceaddRecipefunction, exposed via@vanilla-extract/css/recipeentrypoint
- #128
ed76e45Thanks @ntkoopman! - Fix --webkit-line-clamp unit
- #121
823478bThanks @Brendan-csel! - Fix development identifiers for Windows paths
- #95
f9ca82bThanks @mattcompiles! - Fix fallbackVar type defintion
-
#84
0bc4e0aThanks @mattcompiles! - Validate tokens match corresponding theme contracts -
Updated dependencies [
0bc4e0a]:- @vanilla-extract/[email protected]
-
#52
2d98bccThanks @markdalgleish! - RenamecreateThemeVarstocreateThemeContractBREAKING CHANGE
import { - createThemeVars, + createThemeContract, createTheme } from '@vanilla-extract/css'; -export const vars = createThemeVars({ +export const vars = createThemeContract({ color: { brand: null }, font: { body: null } });
- #50
48c4a78Thanks @mattcompiles! - Allow vars to be passed as values to all style properties
-
#47
a18bc03Thanks @mattcompiles! - Improve dev prefixes on generated class names- Add file name to class names even if no debug id is present
- If file is the index file use directory name instead
-
#49
2ae4db3Thanks @michaeltaranto! - Update the unit-less property mapThe original list was borrowed from the postcss-js parser, but decided to reverse engineer an updated list from csstype for more thorough coverage.
-
#45
e154028Thanks @mattcompiles! - FixcreateThemeVarswhen using null values -
Updated dependencies [
e154028]:- @vanilla-extract/[email protected]
- #38
156b491Thanks @markdalgleish! - AddcomposeStylesfunction
-
#37
ae9864cThanks @markdalgleish! - RenamemapToStylestostyleVariantsBREAKING CHANGE
-import { mapToStyles } from '@vanilla-extract/css'; +import { styleVariants } from '@vanilla-extract/css'; -export const variant = mapToStyles({ +export const variant = styleVariants({ primary: { background: 'blue' }, secondary: { background: 'aqua' }, });
- #34
756d9b0Thanks @mattcompiles! - Reduce CSS var and identifier lengths
-
#20
3311914Thanks @mattcompiles! - Ensure generated hashes are scoped by packagevanilla-extract uses file path to ensure unique identifier (e.g. class names, CSS Variables, keyframes, etc) hashes across your application. This information is added to your
*.css.tsfiles at build time. The issue with this approach is it meant*.css.tsfiles couldn't be pre-compiled when being published to npm.This change adds support for pre-compilation of packages by adding package name information to identifier hashes.
-
#25
c4bedd5Thanks @markdalgleish! - ThecreateInlineThemefunction has now moved to the@vanilla-extract/dynamicpackage.-import { createInlineTheme } from '@vanilla-extract/css/createInlineTheme'; +import { createInlineTheme } from '@vanilla-extract/dynamic';
- e83ad50: Initial release