Skip to content

Commit bd99925

Browse files
authored
Refactor main menu (hestiacp#3066)
1 parent 963c9f2 commit bd99925

File tree

11 files changed

+298
-309
lines changed

11 files changed

+298
-309
lines changed

web/css/src/themes/dark.css

Lines changed: 37 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
Website: www.hestiacp.com
55
*/
66

7+
@custom-media --viewport-medium (min-width: 768px);
8+
79
:root {
810
--color-text: #cdcdcd;
911
--color-background: #282828;
12+
--alert-border-color: #212121;
1013
}
1114

1215
b,
@@ -139,9 +142,8 @@ strong {
139142
color: #0079cb;
140143
}
141144

142-
.alert {
143-
border-color: #212121;
144-
}
145+
/* Alerts
146+
========================================================================== */
145147

146148
.alert-danger {
147149
background-color: #d13535;
@@ -151,6 +153,9 @@ strong {
151153
}
152154
}
153155

156+
/* Cards
157+
========================================================================== */
158+
154159
.card {
155160
background: #454545;
156161
color: #fafafa;
@@ -165,66 +170,46 @@ strong {
165170
}
166171
}
167172

168-
.l-stat {
169-
background-color: #282828;
170-
}
171-
172-
.l-stat__col {
173-
}
174-
175-
.l-stat__col li {
176-
color: #b7b7b7 !important;
177-
}
178-
179-
.l-stat__col a {
180-
border-bottom: 4px solid #282828;
181-
background-color: #282828;
182-
}
183-
184-
.l-stat__col a:hover {
185-
border-bottom: 4px solid #d7d7d7;
186-
}
173+
/* Main menu
174+
========================================================================== */
187175

188-
.l-stat__col a:active,
189-
.l-stat__col a:focus {
190-
border-bottom: 4px solid #d11755;
191-
}
176+
.main-menu-item-link {
177+
&:hover {
178+
& .main-menu-item-label {
179+
color: #d7d7d7;
180+
}
181+
}
192182

193-
.l-stat__col--active a {
194-
border-bottom: 4px solid #e93b76;
195-
}
183+
&.active {
184+
& .main-menu-item-label {
185+
color: #c36;
196186

197-
.l-stat.active .l-stat__col.focus a {
198-
border-bottom: 4px solid #e93b76;
199-
}
187+
& .fas {
188+
color: #d7d7d7;
189+
}
190+
}
191+
}
200192

201-
.l-stat.active .l-stat__col.focus a .l-stat__col-title {
202-
}
193+
@media (--viewport-medium) {
194+
border-bottom-color: #282828;
203195

204-
.l-stat__col a:hover .l-stat__col-title {
205-
color: #d7d7d7;
206-
}
196+
&:hover {
197+
border-bottom-color: #d7d7d7;
198+
}
207199

208-
.l-stat__col a:active .l-stat__col-title {
200+
&.active {
201+
border-bottom-color: #c36;
202+
}
203+
}
209204
}
210205

211-
.l-stat__col-title {
206+
.main-menu-item-label {
212207
font-weight: 500;
213208
color: #bcbcbc;
214-
text-shadow: 0 1px rgb(0 0 0 / 40%);
215-
}
216-
217-
.l-stat__col--active .l-stat__col-title {
218-
color: #ff558f;
219-
}
220209

221-
.l-stat__col .fas {
222-
color: #707070;
223-
padding: 4px;
224-
}
225-
226-
.l-stat__col--active .fas {
227-
color: #aaa;
210+
& .fas {
211+
color: #707070;
212+
}
228213
}
229214

230215
.l-separator {

web/css/src/themes/default.css

Lines changed: 80 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
--font-family-monospace: "Inconsolata", "Lucida Console", "Monaco", monospace;
1818
--color-text: #7c7c7c;
1919
--color-background: #fff;
20+
--alert-border-color: #fff;
21+
--alert-box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
22+
--alert-text-shadow: 0 1px rgb(0 0 0 / 45%);
2023
}
2124

2225
.check-label {
@@ -324,15 +327,18 @@
324327
padding-top: 0.6rem;
325328
}
326329

330+
/* Alerts
331+
========================================================================== */
332+
327333
.alert {
328334
border-radius: 4px;
329-
border: 1px solid #fff;
335+
border: 1px solid var(--alert-border-color);
330336
font-weight: 400;
331337
padding: 0.8rem;
332338
position: relative;
333339
text-align: left;
334-
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
335-
text-shadow: 0 1px rgb(0 0 0 / 45%);
340+
box-shadow: var(--alert-box-shadow);
341+
text-shadow: var(--alert-text-shadow);
336342

337343
& a {
338344
font-weight: bold;
@@ -391,6 +397,9 @@
391397
}
392398
}
393399

400+
/* Cards
401+
========================================================================== */
402+
394403
.cards {
395404
@media (--viewport-small) {
396405
display: grid;
@@ -456,92 +465,96 @@
456465
}
457466
}
458467

459-
.l-stat {
460-
background-color: #fff;
461-
padding-top: 31px;
462-
overflow: hidden;
463-
text-align: center;
464-
display: flex;
465-
}
466-
467-
.l-stat__col {
468-
flex: 1;
469-
}
468+
/* Main menu
469+
========================================================================== */
470470

471-
.l-stat__col a {
472-
display: block;
473-
min-height: 110px;
474-
overflow: hidden;
475-
margin-left: 20px;
476-
margin-right: 20px;
477-
border-bottom: 4px solid #fff;
478-
padding-bottom: 16px;
479-
background-color: #fff;
471+
.main-menu {
472+
margin-top: 10px;
473+
margin-bottom: 10px;
480474

481-
&:hover {
482-
border-bottom: 4px solid #e83b75;
483-
transition: 0.3s;
475+
@media (--viewport-medium) {
476+
margin-top: 20px;
477+
margin-bottom: 0;
484478
}
479+
}
485480

486-
&:active {
487-
border-bottom: 4px solid #d53067;
481+
.main-menu-list {
482+
@media (--viewport-medium) {
483+
display: flex;
484+
justify-content: space-evenly;
488485
}
489486
}
490487

491-
.l-stat__col--active a {
492-
border-bottom: 4px solid #c36;
493-
}
488+
.main-menu-item {
489+
@media (--viewport-medium) {
490+
display: flex;
494491

495-
.l-stat.active .l-stat__col.focus a {
496-
border-bottom: 4px solid #5edad0;
497-
}
492+
&.focus {
493+
& .main-menu-item-link {
494+
border-bottom-color: #5edad0;
495+
}
498496

499-
.l-stat.active .l-stat__col.focus a .l-stat__col-title {
500-
color: #36b3a9;
497+
& .main-menu-item-label {
498+
color: #5edad0;
499+
}
500+
}
501+
}
501502
}
502503

503-
.l-stat__col a:hover .l-stat__col-title {
504-
color: #e83b75;
505-
}
504+
.main-menu-item-link {
505+
display: block;
506+
text-align: center;
507+
padding: 10px;
506508

507-
.l-stat__col a:active .l-stat__col-title {
508-
color: #d53067;
509-
}
509+
&:hover {
510+
& .main-menu-item-label {
511+
color: #c36;
512+
}
513+
}
510514

511-
.l-stat__col ul {
512-
font-size: 0.75rem;
513-
padding-left: 0;
514-
line-height: 14px;
515-
margin-top: 12px;
516-
margin-bottom: 12px;
517-
}
515+
&.active {
516+
& .main-menu-item-label {
517+
color: #c36;
518518

519-
.l-stat__col li {
520-
color: #7b7b7b;
521-
margin-bottom: 8px;
522-
text-transform: lowercase;
519+
& .fas {
520+
color: #c36;
521+
}
522+
}
523+
}
524+
525+
@media (--viewport-medium) {
526+
padding-left: 30px;
527+
padding-right: 30px;
528+
border-bottom: 4px solid #fff;
529+
530+
&:hover,
531+
&.active {
532+
border-bottom-color: #c36;
533+
transition: 0.3s;
534+
}
535+
}
523536
}
524537

525-
.l-stat__col-title {
526-
text-transform: uppercase;
527-
font-weight: 600;
538+
.main-menu-item-label {
528539
color: #5b5b5b;
529-
min-height: 21px;
540+
font-weight: 600;
530541
font-size: 16px;
531-
}
532542

533-
.l-stat__col--active .l-stat__col-title {
534-
color: #c36;
535-
font-size: 16px;
543+
& .fas {
544+
color: #999;
545+
}
536546
}
537547

538-
.l-stat__col .fas {
539-
color: #999;
540-
padding: 4px;
541-
}
548+
.main-menu-stats {
549+
display: none;
542550

543-
.l-stat__col--active .fas {
544-
color: #c36;
551+
@media (--viewport-medium) {
552+
display: block;
553+
font-size: 0.75rem;
554+
text-transform: lowercase;
555+
padding-top: 10px;
556+
padding-bottom: 25px;
557+
}
545558
}
546559

547560
.l-separator {

web/css/src/themes/flat.css

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
Website: www.hestiacp.com
55
*/
66

7-
body {
8-
letter-spacing: 0;
7+
:root {
8+
--alert-box-shadow: none;
9+
--alert-text-shadow: none;
910
}
1011

1112
b,
@@ -150,11 +151,6 @@ strong {
150151
box-shadow: 0 2px 11px 0 rgb(0 0 0 / 50%);
151152
}
152153

153-
.alert {
154-
text-shadow: none;
155-
box-shadow: none;
156-
}
157-
158154
.usage-pill {
159155
box-shadow: none;
160156
}

0 commit comments

Comments
 (0)