Skip to content

Commit 9c28ee5

Browse files
authored
Revert "Revert "[No QA] Migrate static styles to use StyleSheet.create""
1 parent a5c249d commit 9c28ee5

File tree

2 files changed

+621
-602
lines changed

2 files changed

+621
-602
lines changed

contributingGuides/STYLING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
Styles can either be theme-related or not. "Theme-related" means that a style contains some sort of color attributes (backgroundColor, color, borderColor). "Non-theme-related" styles may not contain no color attributes.
66

7-
All non-theme-related styles must be defined in the `/styles` directory and `styles.js` contains the final export after gathering all appropriate styles. Unlike some React Native applications, we are not using `StyleSheet.create()` and instead store styles as plain JS objects. There are also many helper styles available for direct use in components.
7+
All non-theme-related styles must be defined in the `/styles` directory and `styles.js` contains the final export after gathering all appropriate styles. There are also many helper styles available for direct use in components.
8+
9+
The styles are grouped into:
10+
- `staticStyles` - object wrapped into `StyleSheet.create()` which contains static styles based on the `theme`.
11+
- `dynamicStyles` - object that contains functions which return dynamic styles
812

913
All styles that contain theme colors have to be defined in the `ThemeStylesProvider` component, as those need to be dynamically created and animated.
1014

0 commit comments

Comments
 (0)