Skip to content

Commit 553ade2

Browse files
committed
fix(css): simplify navbar css & themed variables
1 parent dfa251e commit 553ade2

File tree

7 files changed

+33
-50
lines changed

7 files changed

+33
-50
lines changed

src/components/AppComponent.vue

-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ main {
141141
justify-content: center;
142142
min-height: calc(100% - #{layout.$header-navbar-height});
143143
margin-top: layout.$header-navbar-height;
144-
overflow: hidden;
145144
}
146145
147146
.panel {

src/components/common/navbar/NavbarComponent.vue

+20-39
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,28 @@ const navElement = ref<HTMLElement>();
7676
type="segment"
7777
justify-content="space-evenly"
7878
animated
79+
:style="{
80+
'--n-bar-color': 'var(--trakt-red-dark)',
81+
'--n-tab-text-color-active': 'var(--navbar-text-color-active)',
82+
'--n-tab-text-color-hover': 'var(--navbar-text-color-hover)',
83+
'--n-tab-color-segment': 'var(--navbar-tab-color)',
84+
'--n-color-segment': 'inherit',
85+
}"
7986
>
8087
<template v-for="_route in routes" :key="_route">
8188
<NTab
82-
class="tab"
89+
:style="
90+
_route === activeRoute
91+
? { '--n-tab-text-color-hover': 'var(--navbar-text-color-hover-active)' }
92+
: undefined
93+
"
8394
:name="_route.toLowerCase()"
8495
type="segment"
8596
@click="navigate(_route)"
8697
>
87-
<span> {{ i18n(_route.toLowerCase()) }}</span>
98+
<span>
99+
{{ i18n(_route.toLowerCase()) }}
100+
</span>
88101
</NTab>
89102
</template>
90103
<NTab
@@ -113,6 +126,11 @@ const navElement = ref<HTMLElement>();
113126
@use '~/styles/layout' as layout;
114127
115128
nav {
129+
--navbar-tab-color: var(--trakt-red-darker);
130+
--navbar-text-color-hover: var(--trakt-red);
131+
--navbar-text-color-hover-active: var(--white);
132+
--navbar-text-color-active: var(--white);
133+
116134
padding: 0 0.25rem;
117135
font-size: 12px;
118136
text-align: center;
@@ -139,40 +157,3 @@ nav {
139157
}
140158
}
141159
</style>
142-
143-
<style lang="scss" scoped>
144-
nav {
145-
.tabs {
146-
--n-bar-color: var(--trakt-red-dark) !important;
147-
--n-tab-text-color-active: var(--vt-c-white) !important;
148-
--n-tab-text-color-hover: color-mix(
149-
in srgb,
150-
var(--trakt-red) 90%,
151-
var(--vt-c-white)
152-
) !important;
153-
--n-tab-color-segment: color-mix(
154-
in srgb,
155-
var(--trakt-red) 50%,
156-
transparent
157-
) !important;
158-
--n-color-segment: inherit !important;
159-
160-
.tab {
161-
min-height: 1.25rem;
162-
}
163-
164-
/* stylelint-disable-next-line selector-class-pattern -- overriding theme class */
165-
.n-tabs-tab--active {
166-
--n-tab-text-color-hover: color-mix(
167-
in srgb,
168-
var(--trakt-white) 99%,
169-
var(--vt-c-red)
170-
) !important;
171-
}
172-
173-
.n-tabs-capsule {
174-
backdrop-filter: blur(1px);
175-
}
176-
}
177-
}
178-
</style>

src/components/common/tooltip/ProgressTooltip.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const i18n = useI18n('common', 'tooltip', 'progress');
9393
font-size: 0.8rem;
9494
9595
.metric {
96-
color: var(--vt-c-white);
96+
color: var(--white);
9797
font-weight: bolder;
9898
font-variant-numeric: tabular-nums;
9999
}

src/components/container/ContainerComponent.ce.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const root = ref<HTMLElement>();
3939

4040
<NLoadingBarProvider
4141
:to="root"
42-
:loading-bar-style="{ loading: { '--n-color-loading': 'var(--vt-c-white)' } }"
42+
:loading-bar-style="{ loading: { '--n-color-loading': 'var(--white)' } }"
4343
>
4444
<LoadingBarProvider />
4545
</NLoadingBarProvider>
@@ -176,7 +176,7 @@ const root = ref<HTMLElement>();
176176
}
177177
178178
@media (prefers-color-scheme: light) {
179-
color: var(--vt-c-black);
179+
color: var(--black);
180180
}
181181
}
182182
</style>

src/components/views/panel/ShowPanelPicker.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ const i18n = useI18n('panel', 'picker');
155155
156156
.no-data {
157157
margin: 0 0.5rem;
158-
color: var(--vt-c-text-dark-2);
158+
color: var(--color-text);
159159
}
160160
}
161161
</style>

src/components/views/search/SearchNavbar.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ onActivated(() => {
238238

239239
<style lang="scss" scoped>
240240
.search-switch {
241-
--search-switch-button-color: var(--vt-c-white-soft);
241+
--search-switch-button-color: var(--white-soft);
242242
--search-switch-active-rail-color: var(--primary-color-dark);
243243
244244
.label {
@@ -249,7 +249,7 @@ onActivated(() => {
249249
250250
// stylelint-disable-next-line selector-class-pattern -- overriding theme class
251251
&.n-switch--active .label {
252-
color: var(--vt-c-white-soft);
252+
color: var(--white-soft);
253253
}
254254
}
255255

src/styles/base.scss

+7-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
--vt-c-divider-dark-2: rgb(84 84 84 / 48%);
1414
--vt-c-text-light-1: var(--vt-c-indigo);
1515
--vt-c-text-light-2: rgb(60 60 60 / 66%);
16-
--vt-c-text-dark-1: var(--vt-c-white);
16+
--vt-c-text-dark-1: var(--white);
1717
--vt-c-text-dark-2: rgb(235 235 235 / 64%);
1818

1919
/* background color variables */
@@ -51,8 +51,11 @@
5151

5252
/* ui color variables */
5353
--white: rgb(255 255 255);
54+
--white-soft: #f8f8f8;
55+
--white-mute: #f2f2f2;
5456
--white-50: rgb(255 255 255 / 50%);
5557
--white-70: rgb(255 255 255 / 70%);
58+
--black: #181818;
5659
--border-grey: rgb(70 70 70);
5760
--border-white: rgb(255 255 255 / 20%);
5861
--primary-color: #63e2b7;
@@ -126,9 +129,9 @@
126129
/*
127130
@media (prefers-color-scheme: light) {
128131
!* semantic color variables for this project *!
129-
--color-background: var(--vt-c-white);
130-
--color-background-soft: var(--vt-c-white-soft);
131-
--color-background-mute: var(--vt-c-white-mute);
132+
--color-background: var(--white);
133+
--color-background-soft: var(--white-soft);
134+
--color-background-mute: var(--white-mute);
132135
--color-border: var(--vt-c-divider-light-2);
133136
--color-border-hover: var(--vt-c-divider-light-1);
134137
--color-heading: var(--vt-c-text-light-1);

0 commit comments

Comments
 (0)