-
#1475
cd9d8b2
Thanks @corradopetrelli! - Add::-webkit-calendar-picker-indicator
as a valid pseudo-element -
#1450
7b256d2
Thanks @wuz! - AddcreateViewTransition
APIcreateViewTransition
creates 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
6432199fa0717f424fb3f45fbe36410b03b01c1c
Thanks @askoufis! - Speed up dev prefix generation for long file paths
-
#1463
61878f5fb21a33190ef242551c639e216ba4748a
Thanks @askoufis! - Export types withexport { type T }
syntax -
Updated dependencies [
61878f5fb21a33190ef242551c639e216ba4748a
]:- @vanilla-extract/private@1.0.6
-
#1425
b86f3f59c86420e12593996a14f8cdb5db2f7c25
Thanks @askoufis! - Fixes a bug where declarations with identical selectors would not be merged correctly inside conditional rules -
#1410
99e974b2ae56e1e851b376988216b7bd30813813
Thanks @pengooseDev! - Fixes a bug causing incorrect type inference when callingcreateTheme
with a theme contract
-
#1335
b8a99e4980710a34692034d5da43e584edbc3d17
Thanks @askoufis! - Addtypes
field topackage.json
-
Updated dependencies [
b8a99e4980710a34692034d5da43e584edbc3d17
]:- @vanilla-extract/private@1.0.5
-
#1386
e58cf9013c6f6cdfacb2a7936b3354e71138e9fb
Thanks @askoufis! - Replaceoutdent
dependency withdedent
-
#1385
3df9b4ebc5ad7e03e5c908c10216447b7089132a
Thanks @askoufis! - Replacechalk
dependency withpicocolors
-
#1379
df9fe3ee3fc0057bc14a2333a405f8229f80c214
Thanks @ronci! - Add support for passing multiple font face rules toglobalFontFace
EXAMPLE USAGE:
const gentium = 'GlobalGentium'; globalFontFace(gentium, [ { src: 'local("Gentium")', fontWeight: 'normal' }, { src: 'local("Gentium Bold")', fontWeight: 'bold' } ]);
-
#1368
90f0315
Thanks @askoufis! - Update@vanilla-extract/private
dependency -
Updated dependencies [
90f0315
]:- @vanilla-extract/private@1.0.4
- #1254
f373d7f
Thanks @EvgenNoskov! - Allow hyphens in class names when using a custom identifier
- #1207
906d288
Thanks @CroModder! - Add some missing simple pseudo selectors
- #1160
e391bae
Thanks @SombreroElGringo! - Users can now provide a custom identifier hashing function
-
#1114
001be83
Thanks @taylorfsteele! - Supports passing multiple font face rules tofontFace
Example 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
8b1c965
Thanks @mattcompiles! - Fix "Invalid selector" errors on pseudo-elements with params
-
#955
ece5fc3
Thanks @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
@layer
key 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
49ff399
Thanks @markdalgleish! - Provide current file scope as an additional argument to the adapter methodsregisterClassName
andregisterComposition
. This is to allow fine-grained caching of registered class names and class compositions per file.
- #1030
49ff399
Thanks @markdalgleish! - Throw whensetAdapter
is called with a falsy value
-
#990
3b724b9
Thanks @askoufis! - Align transformation of@keyframes
rules with other rulesThis fixes a bug where invalid CSS could be generated inside
@keyframes
rules.
- #938
d02684e
Thanks @adrianaferrugento! - Bumpdeep-object-diff
to v1.1.9 in order to fix security vulnerability
- #943
4ecdcd7
Thanks @AndrewLeedham! - Fix atsc
error caused by a dependency's type declarations being unnecessarily bundled
- #900
176c026
Thanks @wobsoriano! - Bump@emotion/hash
to 0.9.0
- #893
8ed77c2
Thanks @mattcompiles! - Fix issue where conditional styles (e.g.@media
,@supports
, etc) could be ordered incorrectly
-
#837
9191d5a
Thanks @mattcompiles! - Improve performance of selector transformsThis issue occured on M1 Macs due to performance issues with large regex patterns.
- #833
b53558a
Thanks @mattcompiles! - Fix entrypoint resolving in Vitest
-
#810
c38b152
Thanks @markdalgleish! - Support excluding file names fromgenerateIdentifier
output. 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
c38b152
Thanks @markdalgleish! - Fix spaces in debug IDs for variable names.
- #810
c38b152
Thanks @markdalgleish! - Fix file name prefix in debug names when file extension is.cjs
or.mjs
.
-
#807
b0b3662
Thanks @mattcompiles! - AddcreateContainer
APIcreateContainer
creates 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
b0b3662
Thanks @mattcompiles! - Add support for container queries via the new@container
key.import { style } from '@vanilla-extract/css'; export const myStyle = style({ '@container': { '(min-width: 400px)': { display: 'flex' } } });
- #723
8467fc2
Thanks @mattcompiles! - Validate duplicate '@media' in media queries
- #684
e531251
Thanks @mattcompiles! - Improve media query validation messaging
- #651
32f309f
Thanks @amorriscode! - Add CSS media query validation
-
#520
b294764
Thanks @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/private@1.0.3
-
#514
e3dfd4a
Thanks @benjervis! - Export the package.json for css/fileScopeThis is required to maintain backwards compatibility with older versions of webpack-plugin
- #508
d15e783
Thanks @markdalgleish! - Addexports
field topackage.json
so nested package paths can be imported in a Node.js ESM context
- #504
16c960f
Thanks @mattcompiles! - Ensure identifiers are escaped properly
-
#489
0c1ec7d
Thanks @mattcompiles! - Fix theme contract types in TypeScript 4.5 -
Updated dependencies [
0c1ec7d
]:- @vanilla-extract/private@1.0.2
- #428
e915f7f
Thanks @mattcompiles! - Ensure whitespace is stripped from debug Ids
-
#409
a9c5cb7
Thanks @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
b1e5936
Thanks @mattcompiles! - Fix identfiers not respectingNODE_ENV
for SSR builds
-
#361
531044b
Thanks @markdalgleish! - Automatically add quotes tocontent
values when necessaryFor example
{ content: '' }
will now return CSS of{ content: "" }
- #354
cdad52d
Thanks @mattcompiles! - Fix function serialization with older versions of the@vanilla-extract/integration
package
-
#348
c6cd1f2
Thanks @mattcompiles! - AddaddFunctionSerializer
functionThis also marks
addRecipe
as deprecated.
- #343
50bae14
Thanks @mattcompiles! - Cleanup adapter after processing styles
-
#326
2d9b4c3
Thanks @mattcompiles! - Support passing arrays of styles tostyle
andstyleVariants
Multiple 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
composeStyles
function which is now marked as deprecated. You can usestyle
with an array as a drop-in replacement.-export const container = composeStyles(background, padding); +export const container = style([background, padding]);
-
#319
26832f1
Thanks @nicksrandall! - AddcreateGlobalThemeContract
functionCreates 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
1e7d647
Thanks @mattcompiles! - Support configurable identifier types
- #284
e65c029
Thanks @markdalgleish! - Fix multiple top-level conditional styles in runtime version
- #274
21e2197
Thanks @markdalgleish! - Fix type errors with nested null values in theme contracts
- #265
385155f
Thanks @mattcompiles! - Fix fileScope error ifcomposeStyles
is called at runtime
-
#259
b8a6441
Thanks @markdalgleish! - Allow the result ofcomposeStyles
to 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
1ee9ba2
Thanks @mattcompiles! - Allow passing of null contract tokens increateThemeContract
-
#235
1e49dfc
Thanks @mattcompiles! - FixcreateGlobalTheme
types when accepting an existing contract -
Updated dependencies [
1e49dfc
]:- @vanilla-extract/private@1.0.1
-
#206
64c18f9
Thanks @mattcompiles! - AdddisableRuntimeStyles
entrypointIn 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, thedisableRuntimeStyles
import will disable all style creation.// setupTests.ts import '@vanilla-extract/css/disableRuntimeStyles';
- #204
16f77ef
Thanks @markdalgleish! - Ensure:where
/:is
selectors are supported when validating scoped selectors
- #171
84a8611
Thanks @mattcompiles! - Release v1
- Updated dependencies [
84a8611
]:- @vanilla-extract/private@1.0.0
- #166
156e585
Thanks @mattcompiles! - Improve missing filescope error
- #168
962d64f
Thanks @mattcompiles! - Allow camel-case CSS var names instead of converting to snake-case
-
#154
f5ab957
Thanks @mattcompiles! - Improved conditional CSS renderingPreviously all conditional CSS (@media and @supports) in a
.css.ts
file 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
ae532f5
Thanks @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
bf51ab5
Thanks @markdalgleish! - Fix escaped characters in selectors
- #132
4f92126
Thanks @markdalgleish! - IntroduceaddRecipe
function, exposed via@vanilla-extract/css/recipe
entrypoint
- #128
ed76e45
Thanks @ntkoopman! - Fix --webkit-line-clamp unit
- #121
823478b
Thanks @Brendan-csel! - Fix development identifiers for Windows paths
- #95
f9ca82b
Thanks @mattcompiles! - Fix fallbackVar type defintion
-
#84
0bc4e0a
Thanks @mattcompiles! - Validate tokens match corresponding theme contracts -
Updated dependencies [
0bc4e0a
]:- @vanilla-extract/private@0.1.2
-
#52
2d98bcc
Thanks @markdalgleish! - RenamecreateThemeVars
tocreateThemeContract
BREAKING CHANGE
import { - createThemeVars, + createThemeContract, createTheme } from '@vanilla-extract/css'; -export const vars = createThemeVars({ +export const vars = createThemeContract({ color: { brand: null }, font: { body: null } });
- #50
48c4a78
Thanks @mattcompiles! - Allow vars to be passed as values to all style properties
-
#47
a18bc03
Thanks @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
2ae4db3
Thanks @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
e154028
Thanks @mattcompiles! - FixcreateThemeVars
when using null values -
Updated dependencies [
e154028
]:- @vanilla-extract/private@0.1.1
- #38
156b491
Thanks @markdalgleish! - AddcomposeStyles
function
-
#37
ae9864c
Thanks @markdalgleish! - RenamemapToStyles
tostyleVariants
BREAKING 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
756d9b0
Thanks @mattcompiles! - Reduce CSS var and identifier lengths
-
#20
3311914
Thanks @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.ts
files at build time. The issue with this approach is it meant*.css.ts
files 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
c4bedd5
Thanks @markdalgleish! - ThecreateInlineTheme
function has now moved to the@vanilla-extract/dynamic
package.-import { createInlineTheme } from '@vanilla-extract/css/createInlineTheme'; +import { createInlineTheme } from '@vanilla-extract/dynamic';
- e83ad50: Initial release