Skip to content

Instantly share code, notes, and snippets.

@fakkio
fakkio / App.tsx
Last active July 5, 2023 22:10
A simple hook for ionic react to read if dark theme is on or off. Works on browser and mobile (> ios13 || > android9)
// Other imports
import useDarkTheme from "./useDarkTheme";
const App: React.FC = () => {
const toggleDarkTheme = (shouldAdd: boolean) => {
document.body.classList.toggle("dark", shouldAdd);
};
const isDark = useDarkTheme();
@fakkio
fakkio / Bootstrap 4 nested submenus
Last active August 29, 2019 10:22
Bootstrap 4 nested submenus
Bootstrap 4 nested submenus