Skip to content
Compare
Choose a tag to compare
@github-actions github-actions released this 04 Feb 17:25
· 61 commits to main since this release
1364072

Minor Changes

  • #76 7dd1ec8 Thanks @lilnasy! - Breaking: The required @stylexjs/stylex version is now 0.5.1.

    Updates @stylexjs/stylex version to 0.5.1. This version introduces a new API for non-react UI frameworks: stylex.attrs().

    Previously, svelte users had to create a wrapper function around stylex.props(), which returned the className prop intended only for React. The newly introduced stylex.attrs() returns the generated classes in the class props, allowing it to work across frameworks.

    <script context="module">
      import stylex from "@stylexjs/stylex"
      const colorStyles = stylex.create({
            red: {
                backgroundColor: 'red',
                borderColor: 'darkred',
            },
            green: {
                backgroundColor: 'lightgreen',
                borderColor: 'darkgreen',
            },
        });
    </script>
    <button {...stylex.attrs(colorStyles.red)} />
    <button {...stylex.attrs(colorStyles.green)} />