We're excited to release Stylex v0.5.0 with some big improvements and fixes!
stylex.props function returns an object with a
className string and a
style object. Some frameworks may expect
class instead of
className and a
string value for
We are introducing a new
stylex.attrs function so StyleX works well in more
stylex.attrs returns an object with a
class string and a
sort-keys rule for the Eslint plugin
@stylexjs/sort-keys plugin has been introduced which will sort styles
alphabetically and by priority. This will make media query order more
aliases option for the StyleX Babel plugin
aliases field can be used to configure StyleX to resolve custom aliases
that may be set up in your
tsconfig file. NOTE: StyleX currently needs to
be configured with absolute paths for your aliases.
New Esbuild plugin
A new official plugin for Esbuild has been introduced as
- Configuration options passed to the StyleX Babel plugin will now be validated.
@stylexjs/stylexnow has ESM exports alongside the commonJS exports.
- The ESLint
valid-stylesrule will catch when using empty strings as string values.
- Some CSS properties which previously caused type and lint errors will now be accepted.
- Using variables for
opacitywill no longer cause type errors.
stylex.defineVarswill now work correctly
runtimeInjectionwill correctly be handled
- Setting the value of variables from
defineVarsas dynamic styles will now work correctly.
- Usage of
0pxwithin CSS functions will no longer be simplified to a unit-less
0as this doesn't work in certain cases.
- Spaces around CSS operators will be maintained.
In addition to these, we've added an "Ecosystem" page to our website to highlight various community projects around StyleX.