- 0db3335: Prevents assigning a variable if the value of a property matches a static value.
- a1cc5b9: Add support for no conditions
-
e9f8620: This is a big refactor to support composing multiple instances of properties. AKA, this makes the API match closer to
@vanilla-extract/sprinkles
, where you usedefineProperties
to create one or more sets of properties, then compose them withcreateRainbowSprinkles
.Before:
// rainbow-sprinkles.css.ts import {createRainbowSprinkles} from 'rainbow-sprinkles'; export const rainbowSprinkles = createRainbowSprinkles({ ... })
After:
// rainbow-sprinkles.css.ts import {defineProperties, createRainbowSprinkles} from 'rainbow-sprinkles'; const properties = defineProperties({ ... }) export const rainbowSprinkles = createRainbowSprinkles(properties) ```tx
- 4d0158a: - Prevents scale values that do not have a `# rainbow-sprinkles prefix from evaluating to scale values.
- Fixes the case where a configured CSS property had a defined scale for staticProperties, and allowed arbitrary values through dynamicProperties, and the incorrect classes were being generated
- 357ff4b: Fix latest tag
-
de5a718: -
createRainbowSprinkles
can now (and should) be created in a.css.js
filecreateRainbowSprinkles
now creates the CSS and returns just the runtime function:rainbowSprinkles
rainbowSprinkles
works similarly togetBoxProps
, but now it returns a new property,otherProps
, which are the props filtered through the function that are not rainbow sprinkles.
The runtime function produced by
createRainbowSprinkles
is now serialized, meaning it can be exported from a.css.js
file. (Attempting to do so previously would throw an error when being compiled by vanilla-extract.). Subsequently, this allowed a larger refactor to simplify the set-up API.Before:
// rainbow-sprinkles.ts export const { getBoxProps, extractSprinklesFromProps, createRainbowSprinklesCss } = createRainbowSprinkles({ ... })
After:
// rainbow-sprinkles.css.ts export const rainbowSprinkles = createRainbowSprinkles({ ... })
rainbowSprinkles
functions similarly togetBoxProps
, with the notable addition ofotherProps
:// App.tsx import { rainbowSprinkles } from './rainbow-sprinkles.css'; const Box = props => { const { className, style, otherProps } = rainbowSprinkles(props); return <div className={className} style={style} {...otherProps} />; };
- b6931a1: Fixed processing of null or undefined prop values
- e97903d: Add CSSVarFunction as a value type for dynamicProperties
- 643499a: Add CSSVarFunction as value to dynamicProperties and staticProperties
- b1a10d9: Move vanilla-extract dependencies to peer dependencies
- 4440ab3: Replaced csstype with internal fork
- ce2f0ce: Update readme
- abbd196: Refactor of the CSS creation logic to improve readability and types
- f327cba: Refactored and improved types, so sprinkles props are now fully accurate. Additionally, all values that are provided with an alias (e.g., when using
vars
) will require a '$' prefix
-
271d262: Introduced staticProperties, which allows configuration of fixed utility classes (not dynamic). Can be useful for frequently used CSS property/value pairs to reduce overall bundle size
properties
renamed todynamicProperties
-
80821d8: - Introduced
staticProperties
, which allows configuration of fixed utility classes (not dynamic). Can be useful for frequently used CSS property/value pairs to reduce overall bundle sizeproperties
renamed todynamicProperties
prefix. This helps to clarify which values are theme values when other values are acceptable.