diff --git a/src/app.scss b/src/app.scss index 24aae34e..37725e92 100644 --- a/src/app.scss +++ b/src/app.scss @@ -1,3 +1,5 @@ +@use "sass:color"; + $fa-font-path: "../node_modules/@fortawesome/fontawesome-free/webfonts"; $family-sans-serif: @@ -66,6 +68,26 @@ $menu-item-active-background-color: $link-light; @import "bulma-prefers-dark/bulma-prefers-dark.sass"; @media (prefers-color-scheme: dark) { + :root { + color-scheme: dark; + } + + .box { + box-shadow: none; + } + + .has-text-white { + color: $black !important; + } + + .has-text-black { + color: $white !important; + } + + .has-text-black-ter { + color: $white-ter !important; + } + .has-background-white-bis { background-color: $black-bis !important; } @@ -83,6 +105,67 @@ $menu-item-active-background-color: $link-light; .navbar { background-color: $black-bis !important; } + + navbar.is-spaced .navbar-dropdown, + .navbar-dropdown.is-boxed { + box-shadow: + 0 8px 8px rgba(0, 0, 0, 1), + 0 0 0 1px rgba(0, 0, 0, 1); + } + + .tippy-box[data-theme~="light"] { + background-color: $black; + box-shadow: + 0 8px 8px rgba(0, 0, 0, 1), + 0 0 0 1px rgba(0, 0, 0, 1); + } + + .tippy-box[data-theme~="light"][data-placement^="top"] > .tippy-arrow:before { + border-top-color: $black; + } + .tippy-box[data-theme~="light"][data-placement^="bottom"] > .tippy-arrow:before { + border-bottom-color: $black; + } + .tippy-box[data-theme~="light"][data-placement^="left"] > .tippy-arrow:before { + border-left-color: $black; + } + .tippy-box[data-theme~="light"][data-placement^="right"] > .tippy-arrow:before { + border-right-color: $black; + } + .tippy-box[data-theme~="light"] > .tippy-backdrop { + background-color: $black; + } + .tippy-box[data-theme~="light"] > .tippy-svg-arrow { + fill: $black; + } + + .tag:not(body).is-danger.is-light { + background-color: $danger; + color: $danger-light; + } + + .tag:not(body).is-success.is-light { + background-color: $success; + color: $success-light; + } + + .card { + box-shadow: + 0 2px 3px rgba(0, 0, 0, 1), + 0 0 0 1px rgba(0, 0, 0, 1); + } + } + + .table td, + .table th { + border: 1px solid $grey-darker; + border-width: 0 0 1px; + } + + .content table td, + .content table th { + border: 1px solid $grey-darker; + border-width: 0 0 1px; } } @@ -157,6 +240,12 @@ body { } } +@media (prefers-color-scheme: dark) { + .secondary-link { + color: $grey-light; + } +} + .inline-text text { font-size: 12px; font-weight: bold; @@ -410,6 +499,12 @@ svg text { align-items: center; } +@media (prefers-color-scheme: dark) { + .d3-calendar .weekdays div { + background: $black-ter; + } +} + .d3-calendar .days .date { display: flex; justify-content: center; @@ -442,7 +537,14 @@ svg text { .level-item p.title { padding: 5px; - color: white; + color: $white; +} + +@media (prefers-color-scheme: dark) { + .level-item p.title { + padding: 5px; + color: $black; + } } .navbar-item, diff --git a/src/lib/components/LevelItem.svelte b/src/lib/components/LevelItem.svelte index 9c6cf46f..4ef95a9b 100644 --- a/src/lib/components/LevelItem.svelte +++ b/src/lib/components/LevelItem.svelte @@ -13,10 +13,10 @@ {title} {subvalue}{subvalue}

-

{value}

+

{value}

diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index 3b29e4c3..0bd1dd16 100644 --- a/src/lib/components/Navbar.svelte +++ b/src/lib/components/Navbar.svelte @@ -276,14 +276,22 @@ diff --git a/src/lib/components/RecurringCard.svelte b/src/lib/components/RecurringCard.svelte index 43d23a6d..30885723 100644 --- a/src/lib/components/RecurringCard.svelte +++ b/src/lib/components/RecurringCard.svelte @@ -124,4 +124,14 @@ background-color: $white-ter; } } + + @media (prefers-color-scheme: dark) { + .custom-arrow { + background-color: $black-bis; + + &:hover { + background-color: $black-ter; + } + } + } diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 48bf5763..4bb0550b 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -751,7 +751,7 @@ export function setHtml(selector: string, value: string, color?: string) { if (color) { node.style.backgroundColor = color; node.style.padding = "5px"; - node.style.color = "white"; + node.classList.add("has-text-white"); } node.innerHTML = value; } diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 06d98bc9..b00e8ee7 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -114,7 +114,7 @@

XIRR

-

{formatFloat(xirr)}

+

{formatFloat(xirr)}

@@ -143,9 +143,8 @@ Expenses {formatCurrency(totalExpense)}{formatCurrency(totalExpense)}