-
Notifications
You must be signed in to change notification settings - Fork 28
/
_base.scss
165 lines (144 loc) · 3.67 KB
/
_base.scss
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
////////////////////////////////////////////////////////
// IMPORTS
////////////////////////////////////////////////////////
@use 'mixins' as *;
////////////////////////////////////////////////////////
// FONTS
////////////////////////////////////////////////////////
@font-face {
font-family: 'WorkSans';
src: url('/fonts/WorkSans.woff2');
font-display: swap;
}
@font-face {
font-family: 'Quicksand';
src: url('/fonts/Quicksand.woff2');
font-display: swap;
}
////////////////////////////////////////////////////////
// RESET
////////////////////////////////////////////////////////
html {
font-size: 62.5%;
scroll-behavior: smooth;
text-rendering: optimizeLegibility;
}
body {
box-sizing: border-box;
line-height: 1.5;
}
*,
*::before,
*::after {
box-sizing: inherit;
margin: 0;
padding: 0;
}
////////////////////////////////////////////////////////
// BASE STYLING
////////////////////////////////////////////////////////
:root {
// normal vars
@include get-misc-vars;
// themed vars(default:light)
@include get-themed-vars;
// dark themed vars when root has an attribute of theme set to 'dark'
&[theme='dark'] {
@include get-themed-vars(dark);
}
// styles to be applied when js is disabled
&:not([js-enabled]) {
// if the user prefers dark theme
@media (prefers-color-scheme: dark) {
// using dark theme instead of default one
@include get-themed-vars(dark);
}
}
}
.body {
font-size: var(--fs-160);
font-family: var(--ff-primary);
background-color: var(--clr-base-bg);
color: var(--clr-base-text);
display: grid;
grid-template-rows: auto 1fr auto;
min-height: 100vh;
transition: color 500ms ease, background-color 500ms ease;
}
.main {
@include respond-to(bp-1900, true) {
width: 110em;
margin-inline: auto;
}
}
////////////////////////////////////////////////////////
// SELECTION & SCROLLBAR
////////////////////////////////////////////////////////
::selection {
background: var(--clr-selection-bg);
color: var(--clr-selection-text);
}
// for gecko-based browsers
@supports (scrollbar-width: auto) {
* {
scrollbar-width: auto;
scrollbar-color: var(--clr-scrollbar-thumb) transparent;
}
}
// for webkit(and its fork blink) based browsers
@supports not (scrollbar-width: auto) {
::-webkit-scrollbar {
height: 0.8em;
width: 0.8em;
}
::-webkit-scrollbar-thumb {
background: var(--clr-scrollbar-thumb);
border: 2px solid transparent;
background-clip: padding-box;
border-radius: 100vw;
&:hover {
background-color: var(--clr-scrollbar-thumb-alt-alpha);
}
}
::-webkit-scrollbar-track {
background: transparent;
}
}
////////////////////////////////////////////////////////
// KEYBOARD NAVIGATION
////////////////////////////////////////////////////////
:focus {
outline: 3px solid var(--clr-focus);
outline-offset: 0.2em;
}
@supports selector(:focus-visible) {
:focus {
outline: none;
}
:focus-visible {
outline: 3px solid var(--clr-focus);
outline-offset: 0.2em;
}
}
////////////////////////////////////////////////////////
// FOR MATHJAX
////////////////////////////////////////////////////////
mjx-container.MathJax {
pointer-events: none;
}
/*
.CtxtMenu_ContextMenu,
.CtxtMenu_Info {
background-color: var(--clr-base-bg) !important;
font-family: inherit !important;
color: inherit !important;
}
.CtxtMenu_InfoTitle,
.CtxtMenu_InfoSignature,
.CtxtMenu_MenuClose .CtxtMenu_InfoClose,
.CtxtMenu_InfoContent {
font-family: inherit !important;
background: inherit !important;
color: inherit !important;
}
*/