diff --git a/releases/next/docs/colors.html b/releases/next/docs/colors.html index 32034b72a18..0621cdbb3eb 100644 --- a/releases/next/docs/colors.html +++ b/releases/next/docs/colors.html @@ -1,4 +1,4 @@ -
The following formats are supported:
'#f0f' (#rgb)'#f0fc' (#rgba)'#ff00ff' (#rrggbb)'#ff00ff00' (#rrggbbaa)'rgb(255, 255, 255)''rgba(255, 255, 255, 1.0)''hsl(360, 100%, 100%)''hsla(360, 100%, 100%, 1.0)''transparent''red'0xff00ff00 (0xrrggbbaa)For the named colors, React Native follows the CSS3 specification:
You can edit the content above on GitHub and send us a pull request!
Components in React Native are styled using JavaScript. Color properties usually match how CSS works on the web.
React Native supports rgb() and rgba() in both hexadecimal and functional notation:
'#f0f' (#rgb)'#ff00ff' (#rrggbb)
'rgb(255, 0, 255)'
'rgba(255, 255, 255, 1.0)'
'#f0ff' (#rgba)
'#ff00ff00' (#rrggbbaa)hsl() and hsla() is supported in functional notation:
'hsl(360, 100%, 100%)''hsla(360, 100%, 100%, 1.0)'transparent #This is a shortcut for rgba(0,0,0,0):
'transparent'You can also use color names as values. React Native follows the CSS3 specification:
You can edit the content above on GitHub and send us a pull request!
With React Native, you don't use a special language or syntax for defining styles. You just style your application using JavaScript. All of the core components accept a prop named style. The style names and values usually match how CSS works on the web, except names are written using camel casing, e.g backgroundColor rather than background-color.
The style prop can be a plain old JavaScript object. That's the simplest and what we usually use for example code. You can also pass an array of styles - the last style in the array has precedence, so you can use this to inherit styles.
As a component grows in complexity, it is often cleaner to use StyleSheet.create to define several styles in one place. Here's an example:
With React Native, you don't use a special language or syntax for defining styles. You just style your application using JavaScript. All of the core components accept a prop named style. The style names and values usually match how CSS works on the web, except names are written using camel casing, e.g backgroundColor rather than background-color.
The style prop can be a plain old JavaScript object. That's the simplest and what we usually use for example code. You can also pass an array of styles - the last style in the array has precedence, so you can use this to inherit styles.
As a component grows in complexity, it is often cleaner to use StyleSheet.create to define several styles in one place. Here's an example:
Some caveats:
PureComponent which means that it will not re-render if props remain shallow-
+equal. Make sure that everything your renderItem function depends on is passed as a prop that
+is not === after updates, otherwise your UI may not update on changes. This includes the
+data prop and parent component state.key prop on each item and uses that for the React key.
-Alternatively, you can provide a custom keyExtractor prop.NOTE: LayoutAnimation and sticky section headers both have bugs when used with this and are
+Alternatively, you can provide a custom keyExtractor prop.
NOTE: LayoutAnimation and sticky section headers both have bugs when used with this and are
therefore not officially supported yet.
NOTE: removeClippedSubviews might not be necessary and may cause bugs. If you see issues with
content not rendering, try disabling it, and we may change the default there.
?ReactClass<any> #?ReactClass<any> #?ReactClass<any> #any #The default accessor functions assume this is an Array<{key: string}> but you can override getItem, getItemCount, and keyExtractor to handle any type of index-based data.
?boolean #debug will turn on extra logging and visual overlays to aid with debugging both usage and