Font alias mixins that can be used to style borders. Various high level categories are provided such as:
width
radius
See the IThemeBorder for more information on the mixins and the alias uses.
Provides alias mixins for providing colours to common styles. The following aliases are provided:
font
- provides the color
mixinbackground
- provides the backgroundColor
mixinborder
- provides the borderColor
mixinSee the IThemeColour for more information on the mixins and the alias uses.
The constants that were used to derive the theme values.
Font alias mixins that can be used to style text. Various high level aliases are provided such as:
primary
secondary
accent
information
See the IThemeFont for more information on the mixins and the alias uses.
Mixins that can be used to add margins to an element.
Mixins that can be used to change the opacity of the component. Provides the opacity
property in the mixin.
Mixins that can be used to add padding to an element.
The theme interface provides a utility kit of styles. The theme interface is used to create themed components.
export interface IProps { // The theme for the component theme?: ITheme; }
export interface IState { }
class ThemedComponent extends React.PureComponent<IProps, IState> { render(): React.ReactNode { const { style: propStyle, theme } = this.props; const baseStyle = styles.container
// Pick out relevant aliases for our component const themeStyle = !theme ? undefined : { // Override the default styles with the theme ...theme.margin.normal, ...theme.padding.normal, ...theme.border.radius.normal, ...theme.border.width.normal, // Use the colour aliases ...theme.colour.border.primary.normal, ...theme.colour.background.primary.normal, } // Add the theme to the style. Make sure to allow the property to override the theme styles const style = [ baseStyle, themeStyle, propStyle ]; return ( <View style={style}> <Text style={styles.text}>Hello, world!</Text> </View>; );
} }
`
Theme
IMargin
IPadding
IConstants
IThemeFont
IThemeColour
IThemeOpacity
IThemeBorder