Releases: vanilla-extract-css/vanilla-extract
@vanilla-extract/[email protected]
Patch Changes
- #393
2f379f1Thanks @mattcompiles! - Fix compilation errors in Vite 2.6
@vanilla-extract/[email protected]
Patch Changes
- #391
c0fa901Thanks @markdalgleish! - Handle array destructuring fromcreateThemewhen it's already been compiled
@vanilla-extract/[email protected]
@vanilla-extract/[email protected]
Patch Changes
- #381
b1e5936Thanks @mattcompiles! - Fix identfiers not respectingNODE_ENVfor SSR builds
@vanilla-extract/[email protected]
Minor Changes
-
#376
f8082b9Thanks @TheMightyPenguin! - AddRecipeVariantstypeA utility to make use of the recipe’s type interface. This can be useful when typing functions or component props that need to accept recipe values as part of their interface.
// button.css.ts import { recipe, RecipeVariants } from '@vanilla-extract/recipes'; export const button = recipe({ variants: { color: { neutral: { background: 'whitesmoke' }, brand: { background: 'blueviolet' }, accent: { background: 'slateblue' }, }, size: { small: { padding: 12 }, medium: { padding: 16 }, large: { padding: 24 }, }, }, }); // Get the type export type ButtonVariants = RecipeVariants<typeof button>; // the above will result in a type equivalent to: export type ButtonVariants = { color?: 'neutral' | 'brand' | 'accent'; size?: 'small' | 'medium' | 'large'; };
@vanilla-extract/[email protected]
Patch Changes
-
#380
3ae2422Thanks @mattcompiles! - Add variant group names to debug IDs -
#380
3ae2422Thanks @mattcompiles! - Return default variants when selection isundefined
@vanilla-extract/[email protected]
Minor Changes
-
#373
a55d2cfThanks @mattcompiles! - AdddevStyleRuntimeoption to allow switching between dev style runtimesThe built-in Vite dev style runtime (what adds styles to the page when running
vite serve) doesn't seem to clean up old styles as expected. PassingdevStyleRuntime: 'vanilla-extract'will instead use vanilla-extract's browser runtime. This pushes all style creation in development to the browser, but may give a better HMR experience.
@vanilla-extract/[email protected]
Minor Changes
-
#360
4ceb76eThanks @michaeltaranto! - Clean up public API, deprecating old API names. Also adding sprinkles to the docs site and usingsprinklesin favour ofatomsfor the canoncial examples.API changes include:
- Rename
createAtomicStylestodefineProperties,createAtomicStylesis now deprecated - Rename
createAtomsFntocreateSprinkles,createAtomsFnis now deprecated - Rename
AtomicStylestype toSprinklesProperties,AtomicStylesis now deprecated
Migration Guide
-import { createAtomicStyles, createAtomsFn } from '@vanilla-extract/sprinkles'; +import { defineProperties, createSprinkles } from '@vanilla-extract/sprinkles'; -const responsiveProperties = createAtomicStyles({ +const responsiveProperties = defineProperties({ conditions: { mobile: {}, tablet: { '@media': 'screen and (min-width: 768px)' }, desktop: { '@media': 'screen and (min-width: 1024px)' } }, defaultCondition: 'mobile', properties: { display: ['none', 'block', 'flex'], flexDirection: ['row', 'column'], padding: space // etc. } }); -export const sprinkles = createAtomsFn(responsiveProperties); +export const sprinkles = createSprinkles(responsiveProperties);
- Rename
@vanilla-extract/[email protected]
Minor Changes
-
#361
531044bThanks @markdalgleish! - Automatically add quotes tocontentvalues when necessaryFor example
{ content: '' }will now return CSS of{ content: "" }
@vanilla-extract/[email protected]
Patch Changes
- #354
cdad52dThanks @mattcompiles! - Fix function serialization with older versions of the@vanilla-extract/integrationpackage