Skip to content

Releases: jpudysz/react-native-unistyles

Release 2.1.1

23 Jan 17:22

Choose a tag to compare

2.1.1 (2024-01-23)

Bug Fixes

  • initial screen height for ios (f64e2a8)

Release 2.1.0

23 Jan 08:35

Choose a tag to compare

2.1.0 (2024-01-23)

Features

Example

You can now use boolean values to select the variants:

import { useStyles } from 'react-native-unistyles'

const Component = ({ isPrimary, isDisabled }) => {
    const { styles } = useStyles(stylesheet, {
        color: !isDisabled,
        borderColor: isPrimary
        // you can also use strings
        // color: "true" | "false"
    })

    return (
        <View style={styles.container} />
    )
}

const stylesheet = createStyleSheet(theme => ({
    container: {
        // otter styles
        variants: {
            color: {
                true: {
                    backgroundColor: theme.colors.primary
                },
                false: {
                    backgroundColor: theme.colors.disabled
                },
                // you can still specify a default variant
                default: {
                    backgroundColor: theme.colors.barbie
                }
                // or other variants
                special: {
                    backgroundColor: theme.colors.special
                }
            },
            borderColor: {
                true: {
                    borderColor: theme.colors.primary
                }
                // you can also skip "false" here
            }
        }
    }
})

If you specify a boolean variants like β€œtrue”, there is no requirement to specify a β€œfalse” variant (and vice versa). You can mix boolean variants with other variants as well.

Release 2.0.2

17 Jan 23:26

Choose a tag to compare

2.0.2 (2024-01-17)

Features

  • export UnistylesValues type (b76078b)
  • mention in migration guide pod install (a68b5b8)

Release 2.0.1

12 Jan 01:16

Choose a tag to compare

2.0.1 (2024-01-12)

Bug Fixes

  • dependency array for no theme (d3c5031)

Release 2.0.0

02 Jan 11:12

Choose a tag to compare

2.0.0 (2024-01-02)

Features

Release 2.0.0-rc.4

28 Dec 17:04

Choose a tag to compare

Release 2.0.0-rc.4 Pre-release
Pre-release

2.0.0-rc.4 (2023-12-28)

Bug Fixes

Features

Release 2.0.0-rc.2

17 Dec 12:46

Choose a tag to compare

Release 2.0.0-rc.2 Pre-release
Pre-release

2.0.0-rc.2 (2023-12-17)

Bug Fixes

Features

Release 2.0.0-rc.1

13 Dec 10:52

Choose a tag to compare

Release 2.0.0-rc.1 Pre-release
Pre-release

2.0.0-rc.1 (2023-12-13)

Features

  • add expressive code plugin (b39f810)
  • add guide for sponsors and showcases (1113bad)
  • add jsdoc metadata (ea83471)
  • add new documentation pages (26b1a7b)
  • change readme add new charts (3bb7c63)
  • finish the docs (16f4d3b)
  • first batch of docs (e71ad74)
  • next batch of docs (029a801)
  • polish the docs (5a58a77)
  • replace all todos and change docs color (cd59ade)
  • update opengraph image (94108d4)

Release 1.2.0

10 Nov 17:52

Choose a tag to compare

1.2.0 (2023-11-10)

Features

  • add support for platform colors (f726518)

Release 1.1.6

09 Nov 07:49

Choose a tag to compare

1.1.6 (2023-11-09)

Bug Fixes

  • unsetting shadowOffset & textShadowOffset styles (7f32143)