Skip to content

Commit db99325

Browse files
angelikatyborskajosevalim
authored andcommitted
Refactor repeating sidebar font-sizes to vars
1 parent 115ad01 commit db99325

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

assets/css/sidebar.css

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
.sidebar {
2+
--sidebarFontSize: 16px;
3+
--sidebarLineHeight: 20px;
24
font-family: var(--sansFontFamily);
3-
font-size: 16px;
5+
font-size: var(--sidebarFontSize);
46
font-weight: 300;
5-
line-height: 18px;
7+
line-height: var(--sidebarLineHeight);
68
background-color: var(--sidebarBackground);
79
color: var(--sidebarAccentMain);
810
overflow: hidden;
@@ -70,8 +72,8 @@
7072
position: relative;
7173
margin: 0;
7274
padding: 0;
73-
font-size: 16px;
74-
line-height: 20px;
75+
font-size: var(--sidebarFontSize);
76+
line-height: var(--sidebarLineHeight);
7577
color: var(--sidebarMuted);
7678
}
7779

@@ -170,7 +172,7 @@
170172
}
171173

172174
.sidebar .sidebar-search .search-close-button {
173-
font-size: 16px;
175+
font-size: var(--sidebarFontSize);
174176
color: var(--sidebarAccentMain);
175177
background-color: transparent;
176178
border: none;
@@ -248,8 +250,8 @@
248250
cursor: pointer;
249251
color: inherit;
250252
margin-right: 10px;
251-
font-size: calc(1.2 * 16px);
252-
line-height: 20px;
253+
font-size: calc(1.2 * var(--sidebarFontSize));
254+
line-height: var(--sidebarLineHeight);
253255
position: absolute;
254256
display: flex;
255257
right: 0;
@@ -273,8 +275,8 @@
273275

274276
.sidebar #full-list li.docs > a + button.icon-expand {
275277
margin-right: 12px;
276-
font-size: calc(1 * 16px);
277-
line-height: 1;
278+
font-size: var(--sidebarFontSize);
279+
line-height: var(--sidebarFontSize);
278280
transform: translateY(calc(-100% - 5px));
279281
}
280282

@@ -313,7 +315,7 @@
313315
display: block;
314316
width: 100%;
315317
height: 27px;
316-
line-height: 20px;
318+
line-height: var(--sidebarLineHeight);
317319
}
318320

319321
.sidebar #full-list li .current-section > a {
@@ -357,7 +359,7 @@
357359

358360
.sidebar #full-list ul li {
359361
font-weight: 300;
360-
line-height: 16px;
362+
line-height: var(--sidebarFontSize);
361363
padding: 0 8px;
362364
margin-right: 0;
363365
color: var(--sidebarAccentMain);
@@ -445,7 +447,7 @@
445447
background-color: transparent;
446448
border: none;
447449
padding: 15px 11px;
448-
font-size: 16px;
450+
font-size: var(--sidebarFontSize);
449451
}
450452

451453
.sidebar-button:hover {

0 commit comments

Comments
 (0)