Releases: jpudysz/react-native-unistyles
Releases Β· jpudysz/react-native-unistyles
Release 2.3.0-beta.0
2.3.0-beta.0 (2024-02-05)
Features
Release 2.2.0
2.2.0 (2024-01-26)
Features
- update theme at runtime (35197ca)
You can now update the theme at runtime. This is useful if you want to show the user interface with default colors and later alter theme based on user preferences.
UnistylesRuntime.updateTheme('light', theme => ({
...theme,
// override theme here π
// if currently selected theme has been updated, unistyles will re-render
}))
Docs: https://reactnativeunistyles.vercel.app/reference/theming/#update-theme-during-runtime
Release 2.1.1
Release 2.1.0
2.1.0 (2024-01-23)
Features
- boolean variants (f8623ea)
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
Release 2.0.1
Release 2.0.0
Release 2.0.0-rc.4
Release 2.0.0-rc.2
Release 2.0.0-rc.1
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)