Changelog
2.1.1
Patch Changes
- #56
821c511Thanks @JeongHwan-dev! - docs(core): refresh the README for slots, extend, and responsive variants, and link the new docs site at emotion-variants.org
2.1.0
Minor Changes
-
#53
2e7f5b4Thanks @JeongHwan-dev! - feat(core): addextendto build oneev()result on anotherev({ extend: button, ... })inherits the parent'sbase,variants,compoundVariants, anddefaultVariants; the parent is not changed- the parent's styles come before the child's at every step:
base, then each matching variant value, then compound variants - a child can add values to an inherited axis, add styles to an inherited value, and declare new axes;
defaultVariantsare merged per axis with the child's value winning - with
slots, a child can add slots and style inherited ones; a config withslotscan only extend one withslots extendthrows at definition time when the value is not anev()result, or when a config withslotsextends one without- add a third type parameter to
EvConfig<T, N, E>for the type of theextendvalue (defaults toundefined)
-
#54
36c2199Thanks @JeongHwan-dev! - feat(core): addcreateEvfor responsive variant valuescreateEv({ breakpoints })returns{ ev }; breakpoints are media queries keyed by a name, declared smallest first- every variant prop of that
evalso accepts{ initial, [breakpoint]: value };initialfalls back to the default variant, and each breakpoint's styles are wrapped in its media query, in declared order - an axis that received a responsive value matches no compound variant in that call
className()and slot functions accept the same values;defaultVariantsdoes not- the exported
eviscreateEv().evand behaves as before - add the
Ev<B>type, and a trailing breakpoint-name parameterB(defaults tonever) toEvVariants<T, B>,EvFunction<T, B>, andEvSlotsFunction<N, T, B>
-
#51
768ad08Thanks @JeongHwan-dev! - feat(core): addslotsandcompoundSlotsfor multi-part componentsev({ slots })styles every part of a component from one config. Variant values and compoundstyleare keyed by slot name, and the call returns one style function per slot:const { root, title } = card({ size }), thencss={root()}- a slot function accepts the same variants as the call, resolved per axis as slot props, then call props, then
defaultVariants; compound entries are matched per slot against the resolved values compoundSlotsapplies one style to several slots, always or only whenvariantsmatch- with
slots,className()returns one class name per slot and there is noclassNames;basecannot be combined withslots - export the
EvSlotsFunctiontype, and add a second type parameter toEvConfig<T, N>for the slot names (defaults tonever) ReturnType<ReturnType<typeof ev>>no longer resolves toSerializedStyles[], becauseevnow returns either form; useSerializedStyles[]from@emotion/reactdirectly
-
#50
83838abThanks @JeongHwan-dev! - feat(core): add theVariantPropstype and array conditions incompoundVariants- export
VariantProps<T>, which extracts the variant props from anev()result:type ButtonVariants = VariantProps<typeof button> - a
compoundVariantscondition can now be an array of values, which matches when the variant has any of them:{ variants: { size: ['small', 'medium'] }, style } - fix a variant value that only exists on
Object.prototype, such as'constructor', pushing a non-style value into the result; unknown values are now ignored
- export
2.0.0
Major Changes
-
#43
3456f97Thanks @JeongHwan-dev! - fix(core): apply default variants when a prop isundefined, makeclassNamesreturn real class namesbutton({ size: undefined })now falls back todefaultVariants.sizeinstead of dropping it; this matches the READMEButtonexample which forwards possibly-undefined propsclassNamespreviously returned"[object Object]"for every entry because@emotion/react'scss()yieldsSerializedStyles, not class names. It now injects each style through@emotion/csson first access and returns the generated class names- add
className(variants), which returns one class name covering base, variant and compound variant styles, forclassNameprops and non-React code @emotion/cssis a new required peer dependencyev()now always returnsSerializedStyles[](previouslyInterpolation<unknown>, a bare object when only one style matched); thecssprop accepts both
1.0.2
Patch Changes
-
#41
176a7f2Thanks @JeongHwan-dev! - chore(core): switch to ESM package type and fix ESM type resolution- set "type": "module"; emit dist/index.{js,d.ts} for ESM and dist/index.{cjs,d.cts} for CJS
- split exports "types" per import/require condition so node16 ESM no longer resolves CJS types
- add "sideEffects": false, use git+https repository url, narrow "files" to dist
- drop redundant react peer dependency (@emotion/react already declares it)
- remove duplicate build from the release script (prepublishOnly already builds)
- rename .lintstagedrc.js to .cjs, delete stale .npmignore, bump @types/node to 22
1.0.1
Patch Changes
-
#33
ddc21a5Thanks @JeongHwan-dev! - chore(core): build with tsdown instead of tsupOutput filenames and entry points are unchanged; the bundle is 27-31% smaller gzipped.
-
#27
ae2f98eThanks @JeongHwan-dev! - chore(core): remove unused@emotion/serializeruntime dependency -
#25
2630063Thanks @JeongHwan-dev! - ci(release): migrate release pipeline from semantic-release to changesets
1.0.0
Major Changes
967258dThanks @JeongHwan-dev! - ev: initial implementation of emotion-variants
Patch Changes
- #10
c919712Thanks @JeongHwan-dev! - cursor: add emotion-variants library rules and update frontend guidelines - #11
6482440Thanks @JeongHwan-dev! - examples: add design system example project - #2
1aaa93aThanks @JeongHwan-dev! - github: add pull request template to repository - #9
1af7d81Thanks @JeongHwan-dev! - biome: update biome version and clean up configuration - #5
d157a3dThanks @JeongHwan-dev! - commitizen: add commitizen configuration - #6
03f3da8Thanks @JeongHwan-dev! - commitizen: improve commit message validation logic - #8
2323bbdThanks @JeongHwan-dev! - commitizen: update commitizen config - #14
f388a20Thanks @JeongHwan-dev! - github: update generate labels scripts and labels.json - #7
b0d9000Thanks @JeongHwan-dev! - husky: add husky for pre-commit and update scripts - #1
2137060Thanks @JeongHwan-dev! - npmrc: add .npmrc to ignore workspace root check - #12
d6510b0Thanks @JeongHwan-dev! - release: configure semantic release with GitHub Actions - #18
656c4a8Thanks @JeongHwan-dev! - release: fix release workflow - #19
76eefeaThanks @JeongHwan-dev! - release: fix release workflow - #13
06e8467Thanks @JeongHwan-dev! - release: fix release workflow conditions and Node.js version - #16
e8497a9Thanks @JeongHwan-dev! - release: update release configuration and add release script - #3
2488518Thanks @JeongHwan-dev! - workflows: add auto PR assignee workflow to assign repository owner - #4
3373071Thanks @JeongHwan-dev! - workflows: add automated label generation files
Last updated on