@expo/styleguide 4.3.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,3 +19,12 @@ Then in a React component:
19
19
  ```tsx
20
20
  import { colors, shadows, ... } from "@expo/styleguide";
21
21
  ```
22
+
23
+
24
+ ## Changing styles in tailwind.config
25
+
26
+ In order to see changes made to the exported `tailwind.js` config:
27
+
28
+ - Change a value in `packages/styleguide/tailwind.js`
29
+ - Run yarn tsc in `packages/styleguide`
30
+ - Navigate to `examples/web` and restart the dev server
@@ -42,10 +42,10 @@ function setInitialColorMode() {
42
42
  const colorMode = getInitialColorMode();
43
43
  // add HTML attribute if dark mode
44
44
  if (colorMode === 'dark') {
45
- document.documentElement.setAttribute('data-expo-theme', 'dark');
45
+ document.body.classList.add('dark-theme');
46
46
  }
47
47
  else {
48
- document.documentElement.setAttribute('data-expo-theme', 'light');
48
+ document.body.classList.remove('dark-theme');
49
49
  }
50
50
  }
51
51
  // our function needs to be a string so that we can call it
@@ -76,11 +76,11 @@ function ThemeProvider(props) {
76
76
  function setDocumentTheme(themeName) {
77
77
  if (disabled)
78
78
  return;
79
- if ([Themes.LIGHT, Themes.DARK].includes(themeName)) {
80
- document.documentElement.setAttribute('data-expo-theme', themeName);
79
+ if (themeName === Themes.DARK) {
80
+ document.body.classList.add('dark-theme');
81
81
  }
82
82
  else {
83
- document.documentElement.setAttribute('data-expo-theme', '');
83
+ document.body.classList.remove('dark-theme');
84
84
  }
85
85
  }
86
86
  function onThemeChange(event) {