Skip to content

Commit

Permalink
improved light/dark toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
nicobako committed Jul 28, 2023
1 parent e0cc2d3 commit 808e957
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<body class="column">

<h1><a href="/">Nico Bako</a></h1>
<button _="on click toggle @data-theme='light' on body">Dark/Light</button>
<button _="on click toggle @data-theme='light' on <:root/>">Dark/Light</button>
<div class="row">
<button hx-get="/pages/about_me/index.html" hx-target="#content" hx-trigger="load,click">About Me</button>
<button hx-get="./pages/about_site/index.html" hx-target="#content">About Site</button>
Expand Down
17 changes: 9 additions & 8 deletions static/styles.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
/* defines css variables for use in other stylesheets */
:root {
html {
/* grayscale */
--color-darkest: rgb(25, 25, 25);
--color-dark: rgb(50, 50, 50);
--color-gray: rgb(128, 128, 128);
--color-light: rgb(200, 200, 200);
--color-lightest: rgb(240, 240, 240);
/* colors */
--color-fun: #5ca9a9;

--color-back: var(--color-dark);
--color-middle: rgb(124, 123, 123);
--color-front: rgb(240, 240, 240);
--color-fun: #5ca9a9;
--color-morbid: rgb(133, 99, 214);

}

:root[data-theme='light'] {
--color-back: var(--color-lightest);
--color-front: var(--color-darkest);
}

/* html elements */
Expand All @@ -29,11 +35,6 @@ body {
padding: 10px;
}

body[data-theme="light"] {
background-color: var(--color-front);
color: var(--color-back);
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
Expand Down

0 comments on commit 808e957

Please sign in to comment.