Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/__layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script>
import { onMount } from 'svelte';

onMount(() => {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
document.documentElement.classList.add('light-mode');
}
});
</script>

<slot />
13 changes: 8 additions & 5 deletions src/app.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
@import "@fontsource/fira-mono";
@import '@fontsource/fira-mono';
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
--font-mono: "Fira Mono", monospace;
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
--font-mono: 'Fira Mono', monospace;
--secondary-color: #d0dde9;
--accent-color: #ff3e00;
--heading-color: rgba(0, 0, 0, 0.7);
Expand All @@ -15,6 +14,10 @@
@apply text-gray-100;
}

:root.light-mode {
@apply bg-gray-100 text-gray-900;
}

body {
@apply bg-gray-900 min-h-screen m-0;
}
Expand Down Expand Up @@ -55,4 +58,4 @@ pre {

button {
@apply focus:outline-none p-2 rounded-md;
}
}
6 changes: 3 additions & 3 deletions tailwind.config.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const colors = require("tailwindcss/colors");
const colors = require('tailwindcss/colors');

module.exports = {
content: ["./src/**/*.svelte", "./src/**/*.js", "./src/**/*.ts"],
content: ['./src/**/*.svelte', './src/**/*.js', './src/**/*.ts'],
theme: {
colors: {
gray: colors.neutral,
Expand All @@ -15,4 +15,4 @@ module.exports = {
extend: {},
},
plugins: [],
};
};