forked from mamrehn/flashcards
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme.css
More file actions
127 lines (116 loc) · 3.53 KB
/
Copy paththeme.css
File metadata and controls
127 lines (116 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/* ============================================================================
Theme Infrastructure - Shared across all pages
============================================================================ */
/* Shared semantic variables for dark mode support */
:root {
--surface-color: #ffffff;
--surface-secondary: #f8f9fa;
--text-color: #333;
--text-muted: #6c757d;
--border-color: #dee2e6;
--input-border: #ced4da;
--input-bg: #ffffff;
--shadow-color: rgba(0, 0, 0, 0.1);
}
[data-theme='dark'] {
--surface-color: #1e1e2e;
--surface-secondary: #2a2a3c;
--text-color: #e0e0e0;
--text-muted: #a0a0b0;
--border-color: #3a3a4c;
--input-border: #4a4a5c;
--input-bg: #2a2a3c;
--shadow-color: rgba(0, 0, 0, 0.3);
}
/* Smooth transition for theme changes - applied momentarily during toggle */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
transition:
background-color 0.3s ease,
color 0.3s ease,
border-color 0.3s ease,
box-shadow 0.3s ease !important;
transition-delay: 0s !important;
}
/* Visually-hidden, screen-reader-only label utility (shared across pages). */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
/* Global reduced-motion safety net. Near-zero (not `none`) so animationend /
transitionend listeners still fire and JS state machines don't stall. Pages
with richer motion (quiz.css / poll.css) layer their own reduce blocks on
top of this. */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
/* Theme Toggle Button */
.theme-toggle {
position: fixed;
/* Keep clear of the iOS home indicator / notch when viewport-fit=cover. */
bottom: calc(1rem + env(safe-area-inset-bottom));
right: calc(1rem + env(safe-area-inset-right));
width: 44px;
height: 44px;
border-radius: 50%;
border: 2px solid rgba(128, 128, 128, 0.3);
background-color: rgba(255, 255, 255, 0.9);
cursor: pointer;
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.3rem;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
transition:
background-color 0.3s,
transform 0.2s;
-webkit-tap-highlight-color: transparent;
padding: 0;
line-height: 1;
}
.theme-toggle:hover {
transform: scale(1.1);
}
.theme-toggle:active {
transform: scale(0.95);
}
/* Keyboard focus ring — the round custom button otherwise shows only the UA
default, which is easy to miss on the translucent background. */
.theme-toggle:focus-visible {
outline: 3px solid #1a73e8;
outline-offset: 2px;
}
[data-theme='dark'] .theme-toggle {
background-color: rgba(50, 50, 50, 0.9);
border-color: rgba(128, 128, 128, 0.4);
}
@media (max-width: 768px) {
.theme-toggle {
top: calc(0.5rem + env(safe-area-inset-top));
right: calc(0.5rem + env(safe-area-inset-right));
bottom: auto;
/* 40px keeps the tap target close to the 44px guideline while staying
unobtrusive in the corner on small screens (was 32px). */
width: 40px;
height: 40px;
font-size: 1.05rem;
border-width: 1px;
}
}