diff --git a/src/assets/base.css b/src/assets/base.css deleted file mode 100644 index 71dc55a3..00000000 --- a/src/assets/base.css +++ /dev/null @@ -1,74 +0,0 @@ -/* color palette from */ -:root { - --vt-c-white: #ffffff; - --vt-c-white-soft: #f8f8f8; - --vt-c-white-mute: #f2f2f2; - - --vt-c-black: #181818; - --vt-c-black-soft: #222222; - --vt-c-black-mute: #282828; - - --vt-c-indigo: #2c3e50; - - --vt-c-divider-light-1: rgba(60, 60, 60, 0.29); - --vt-c-divider-light-2: rgba(60, 60, 60, 0.12); - --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65); - --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48); - - --vt-c-text-light-1: var(--vt-c-indigo); - --vt-c-text-light-2: rgba(60, 60, 60, 0.66); - --vt-c-text-dark-1: var(--vt-c-white); - --vt-c-text-dark-2: rgba(235, 235, 235, 0.64); -} - -/* semantic color variables for this project */ -:root { - --color-background: var(--vt-c-white); - --color-background-soft: var(--vt-c-white-soft); - --color-background-mute: var(--vt-c-white-mute); - - --color-border: var(--vt-c-divider-light-2); - --color-border-hover: var(--vt-c-divider-light-1); - - --color-heading: var(--vt-c-text-light-1); - --color-text: var(--vt-c-text-light-1); - - --section-gap: 160px; -} - -@media (prefers-color-scheme: dark) { - :root { - --color-background: var(--vt-c-black); - --color-background-soft: var(--vt-c-black-soft); - --color-background-mute: var(--vt-c-black-mute); - - --color-border: var(--vt-c-divider-dark-2); - --color-border-hover: var(--vt-c-divider-dark-1); - - --color-heading: var(--vt-c-text-dark-1); - --color-text: var(--vt-c-text-dark-2); - } -} - -*, -*::before, -*::after { - box-sizing: border-box; - margin: 0; - position: relative; - font-weight: normal; -} - -body { - min-height: 100vh; - color: var(--color-text); - background: var(--color-background); - transition: color 0.5s, background-color 0.5s; - line-height: 1.6; - font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, - Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; - font-size: 15px; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} diff --git a/src/assets/main.css b/src/assets/main.css deleted file mode 100644 index e8667cd4..00000000 --- a/src/assets/main.css +++ /dev/null @@ -1,35 +0,0 @@ -@import './base.css'; - -#app { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - - font-weight: normal; -} - -a, -.green { - text-decoration: none; - color: hsla(160, 100%, 37%, 1); - transition: 0.4s; -} - -@media (hover: hover) { - a:hover { - background-color: hsla(160, 100%, 37%, 0.2); - } -} - -@media (min-width: 1024px) { - body { - display: flex; - place-items: center; - } - - #app { - display: grid; - grid-template-columns: 1fr 1fr; - padding: 0 2rem; - } -} diff --git a/src/components/ThemeSwitcher.vue b/src/components/ThemeSwitcher.vue index 1c4fc957..252357ee 100644 --- a/src/components/ThemeSwitcher.vue +++ b/src/components/ThemeSwitcher.vue @@ -7,7 +7,7 @@ const props = defineProps<{ themes: ThemeSwitcherTheme[]; }>(); -const theme = ref('light'); +const theme = ref(window.localStorage.getItem('theme') || 'dark'); const { state: currentThemeName, next: getNextThemeName, @@ -37,6 +37,7 @@ const changeMode = (val: 'dark' | 'light' | 'system') => { document.documentElement.classList.remove('dark'); } document.documentElement.setAttribute('data-theme', value); + window.localStorage.setItem('theme', value); }; // Update icon if theme is changed from other sources watch(theme, (val: 'dark' | 'light' | 'system') => { diff --git a/src/components/charts/DonutChart.vue b/src/components/charts/DonutChart.vue index 164bae0a..57c73fd1 100644 --- a/src/components/charts/DonutChart.vue +++ b/src/components/charts/DonutChart.vue @@ -1,28 +1,21 @@ diff --git a/src/components/charts/PriceMarketChart.vue b/src/components/charts/PriceMarketChart.vue index 46bd4a8a..56cfb8eb 100644 --- a/src/components/charts/PriceMarketChart.vue +++ b/src/components/charts/PriceMarketChart.vue @@ -1,15 +1,13 @@ diff --git a/src/style.css b/src/style.css index dc94763a..7e33e9d3 100644 --- a/src/style.css +++ b/src/style.css @@ -2,18 +2,30 @@ @tailwind components; @tailwind utilities; -@layer base { - :root { - --text-main: #333; - --text-secondary: #4b525d; - --bg-active: #fbfbfc; - } +body { + min-height: 100vh; + transition: color 0.5s, background-color 0.5s; + line-height: 1.6; + font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, + Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + sans-serif; + font-size: 15px; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} - html.dark { - --text-main: #f7f7f7; - --text-secondary: #6f6e84; - --bg-active: #242b40; - } +:root { + --text-main: #333; + --text-secondary: #4b525d; + --bg-active: #fbfbfc; +} + +html.dark, +html[data-theme='dark'] { + --text-main: #f7f7f7; + --text-secondary: #6f6e84; + --bg-active: #242b40; } .table th:first-child { @@ -23,4 +35,4 @@ .btn { @apply rounded; -} \ No newline at end of file +}