Skip to content
Draft
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
1 change: 1 addition & 0 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"dependencies": {
"@babel/standalone": "^7.22.9",
"@material/material-color-utilities": "^0.2.7",
"@popperjs/core": "^2.11.8",
"foxact": "^0.2.20",
"jotai": "^2.3.1",
Expand Down
5 changes: 2 additions & 3 deletions core/src/components/BottomStatus.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
flex-direction: row-reverse;
width: 100%;
height: 27px;
background-color: color-mix(in srgb, var(--primary) 20%, var(--bg-cr));
border-top: 1px solid var(--primary);
background-color: var(--md-sys-color-primary-container);
> * {
padding: 0 10px;
transition: .1s;
&:hover {
background-color: color-mix(in srgb, var(--primary) 70%, var(--bg-cr));
background-color: var(--md-sys-color-on-primary);
}
}
> .ppd-popover-reference.ppd-popover-hover {
Expand Down
7 changes: 1 addition & 6 deletions core/src/components/LeftBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
justify-content: space-between;
padding: 44px 5px 5px;
width: 36px;
background-image: linear-gradient(
135deg,
color-mix(in srgb, var(--primary), var(--bg-cr) 10%) 50%,
color-mix(in srgb, var(--primary), var(--bg-cr) 40%) 80%,
color-mix(in srgb, var(--primary), var(--bg-cr) 80%)
);
background-image: var(--md-sys-color-on-secondary);
transition: .1s;
&__bottom, &__top {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"vite-plugin-inspect": "^0.7.38"
},
"engines": {
"node": ">=18.16.0"
"node": ">=18.0.0"
},
"resolutions": {
"array-buffer-byte-length": "npm:@nolyfill/array-buffer-byte-length@latest",
Expand Down
12 changes: 12 additions & 0 deletions src/components/ThemeSwitcher.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import './ThemeSwitcher.scss'

import { useState } from 'react'
import { applyTheme, argbFromHex, themeFromSourceColor } from "@material/material-color-utilities"

declare const theme: 'light' | 'dark' | (string & {})

Expand All @@ -25,6 +26,17 @@ function updateTheme(mode?: typeof theme) {
}
curThemeMode = mode || 'light'
themeChangeListeners.forEach(listener => listener(curThemeMode, theme === 'auto'))

const themeColorArgb = argbFromHex('0x263c6e')
const md3Theme = themeFromSourceColor(themeColorArgb)

applyTheme(md3Theme, {
dark: mode === "dark", brightnessSuffix: true, paletteTones: [
10, 20, 30, 40, 50, 60, 70, 80, 90, 100
],
target: document.documentElement
})

if (mode === 'dark') {
document.documentElement.setAttribute('theme-mode', 'dark')
} else {
Expand Down
Loading