-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ui): drop light theme and always enable dark mode (#76)
* chore: add expo dark from expo style guide * chore: drop unsupported css imports from expo dark * chore: remove the expo light theme * chore: finalize the forced dark mode and remove light mode
- Loading branch information
Showing
6 changed files
with
57 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
import '~/styles/global.css'; | ||
import '~/styles/expo-dark.css'; | ||
|
||
// Import the Expo-required radix styles from `@expo/style-guide/dist/expo-theme.css` | ||
import '@radix-ui/colors/greenDark.css'; | ||
import '@radix-ui/colors/yellowDark.css'; | ||
import '@radix-ui/colors/redDark.css'; | ||
import '@radix-ui/colors/blueDark.css'; | ||
import '@radix-ui/colors/orangeDark.css'; | ||
import '@radix-ui/colors/purpleDark.css'; | ||
import '@radix-ui/colors/pinkDark.css'; | ||
import '@radix-ui/colors/slateDark.css'; | ||
import '@radix-ui/colors/grayDark.css'; // NOTE(cedric): this is required for syntax highlighting | ||
|
||
import { useColorScheme } from 'nativewind'; | ||
import { useEffect, type PropsWithChildren } from 'react'; | ||
import type { PropsWithChildren } from 'react'; | ||
|
||
export function ThemeProvider({ children }: PropsWithChildren) { | ||
const { colorScheme } = useColorScheme(); | ||
const { setColorScheme } = useColorScheme(); | ||
|
||
useEffect(() => { | ||
// Keep the prefered color scheme synced with the `body` class name | ||
if (document.body && colorScheme) { | ||
document.body.classList.remove('light-theme', 'dark-theme'); | ||
document.body.className = `${colorScheme}-theme`; | ||
} | ||
}, [colorScheme]); | ||
// Force Atlas into dark mode | ||
setColorScheme('dark'); | ||
|
||
return children; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
body { | ||
background-color: var(--expo-theme-background-screen); | ||
color: var(--expo-theme-text-default); | ||
} | ||
|
||
html, body, #root { | ||
height: auto; | ||
min-height: 100vh; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
#root { | ||
display: flex; | ||
} | ||
|
||
@layer components { | ||
.shiki code { | ||
@apply grid grid-cols-[auto,1fr]; | ||
} | ||
|
||
.shiki .line-number { | ||
@apply px-4 text-right select-none; | ||
} | ||
|
||
.shiki .line { | ||
@apply pr-4; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters