Skip to content

Commit 05644a1

Browse files
authored
feat: agenda / floor-plan dark mode support (ietf-tools#5995)
1 parent a20d1f4 commit 05644a1

12 files changed

Lines changed: 336 additions & 18 deletions

File tree

client/App.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ const siteStore = useSiteStore()
2626
2727
const appContainer = ref(null)
2828
29+
// --------------------------------------------------------------------
30+
// Set user theme
31+
// --------------------------------------------------------------------
32+
33+
const desiredTheme = window.localStorage?.getItem('theme')
34+
if (desiredTheme === 'dark') {
35+
siteStore.theme = 'dark'
36+
} else if (desiredTheme === 'light') {
37+
siteStore.theme = 'light'
38+
} else if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
39+
siteStore.theme = 'dark'
40+
} else {
41+
siteStore.theme = 'light'
42+
}
43+
2944
// --------------------------------------------------------------------
3045
// Handle browser resize
3146
// --------------------------------------------------------------------

client/agenda/Agenda.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,13 @@ onMounted(() => {
533533
color: $blue-700;
534534
position: relative;
535535
536+
@at-root .theme-dark & {
537+
border: 1px solid $blue-800;
538+
background: linear-gradient(to top, lighten($blue-900, 2%), lighten($blue-900, 5%));
539+
color: $blue-100;
540+
box-shadow: inset 0 0 0 1px #000;
541+
}
542+
536543
> button {
537544
position: absolute;
538545
top: 15px;

client/agenda/AgendaDetailsModal.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ async function fetchSessionMaterials () {
282282
.bi {
283283
font-size: 20px;
284284
color: $indigo;
285+
286+
@at-root .theme-dark & {
287+
color: $indigo-300;
288+
}
285289
}
286290
287291
.detail-header {
@@ -343,6 +347,11 @@ async function fetchSessionMaterials () {
343347
border-radius: 5px;
344348
font-weight: 500;
345349
350+
@at-root .theme-dark & {
351+
background-color: $gray-900;
352+
border-color: $gray-700;
353+
}
354+
346355
a {
347356
cursor: pointer;
348357
@@ -365,6 +374,11 @@ async function fetchSessionMaterials () {
365374
margin-top: 12px;
366375
border-radius: 5px;
367376
377+
@at-root .theme-dark & {
378+
background-color: $gray-900;
379+
border-color: $gray-700;
380+
}
381+
368382
.bi {
369383
color: $blue;
370384
}
@@ -377,6 +391,10 @@ async function fetchSessionMaterials () {
377391
border: none;
378392
border-radius: 5px;
379393
display: block;
394+
395+
@at-root .theme-dark & {
396+
background-color: $gray-900;
397+
}
380398
}
381399
}
382400

client/agenda/AgendaFilter.vue

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,30 +217,58 @@ function toggleFilterGroup (key) {
217217
padding: 5px;
218218
border-radius: 10px;
219219
220+
@at-root .theme-dark & {
221+
background-color: $gray-800;
222+
}
223+
220224
&:nth-child(2) {
221225
background-color: $blue-100;
222226
227+
@at-root .theme-dark & {
228+
background-color: $gray-800;
229+
}
230+
223231
.agenda-personalize-areamain {
224232
button {
225233
color: $blue-600;
234+
235+
@at-root .theme-dark & {
236+
color: $blue-100;
237+
}
226238
}
227239
}
228240
229241
.agenda-personalize-groups {
230242
background-color: lighten($blue-100, 7%);
243+
244+
@at-root .theme-dark & {
245+
background-color: $gray-700;
246+
}
231247
}
232248
}
233249
&:nth-child(3) {
234250
background-color: $orange-100;
235251
252+
@at-root .theme-dark & {
253+
background-color: $gray-800;
254+
}
255+
236256
.agenda-personalize-areamain {
237257
button {
238258
color: $orange-600;
259+
260+
@at-root .theme-dark & {
261+
color: $orange-100;
262+
}
239263
}
240264
}
241265
242266
.agenda-personalize-groups {
243267
background-color: lighten($orange-100, 7%);
268+
269+
@at-root .theme-dark & {
270+
background-color: $gray-700;
271+
}
244272
}
245273
}
246274
@@ -276,6 +304,12 @@ function toggleFilterGroup (key) {
276304
transition: background-color .5s ease;
277305
position: relative;
278306
307+
@at-root .theme-dark & {
308+
background-color: $gray-600;
309+
border-color: $gray-700;
310+
color: #FFF;
311+
}
312+
279313
> .bi {
280314
margin-right: .5rem;
281315
}
@@ -310,6 +344,10 @@ function toggleFilterGroup (key) {
310344
flex: 1;
311345
display: flex;
312346
flex-wrap: wrap;
347+
348+
@at-root .theme-dark & {
349+
background-color: $gray-700;
350+
}
313351
}
314352
315353
&-group {
@@ -324,6 +362,12 @@ function toggleFilterGroup (key) {
324362
color: $gray-600;
325363
margin-right: 0px;
326364
365+
@at-root .theme-dark & {
366+
background-color: $gray-600;
367+
border-color: $gray-700;
368+
color: #FFF;
369+
}
370+
327371
@media screen and (max-width: $bs5-break-sm) {
328372
font-size: .9em;
329373
}

client/agenda/AgendaQuickAccess.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ function scrollToNow (ev) {
219219
</script>
220220
221221
<style lang="scss">
222+
@import "bootstrap/scss/functions";
223+
@import "bootstrap/scss/variables";
224+
222225
.agenda-quickaccess {
223226
width: 300px;
224227
@@ -252,6 +255,10 @@ function scrollToNow (ev) {
252255
text-align: center;
253256
margin-top: 12px;
254257
258+
@at-root .theme-dark & {
259+
border-color: $secondary;
260+
}
261+
255262
@media screen and (max-width: 1350px) {
256263
flex-direction: column;
257264
}
@@ -267,6 +274,11 @@ function scrollToNow (ev) {
267274
background-color: #FFF;
268275
transform: translate(-50%, 0);
269276
text-transform: uppercase;
277+
278+
@at-root .theme-dark & {
279+
background-color: $gray-900;
280+
color: #FFF;
281+
}
270282
}
271283
272284
button {

0 commit comments

Comments
 (0)