Skip to content

Commit 0dba958

Browse files
committed
refactor(styles) #52 replaced global styles calculations with variables
1 parent e08a2f9 commit 0dba958

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

sass/_style.scss

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ nav {
3030
// background-color: color("materialize-red", "lighten-2");
3131

3232
a {
33-
color: rgba(0,0,0,.87);
33+
color: $font-color-main;
3434
}
35-
ul li a:hover, ul li.active {
36-
background-color: color("materialize-red", "lighten-1");
35+
ul li a:hover {
36+
background-color: $primary-color-when-hovered-solid;
37+
}
38+
ul li.active {
39+
background-color: $primary-color-when-focused-solid;
3740
}
3841
}
3942

@@ -42,7 +45,7 @@ td, th {
4245
}
4346

4447
.header {
45-
color: color("materialize-red", "lighten-2");
48+
color: $primary-color;
4649
font-weight: 300;
4750
}
4851

@@ -182,7 +185,7 @@ a.sidenav-trigger.top-nav {
182185
top: 28px;
183186
float: none;
184187
margin-left: 1.5rem;
185-
color: color("materialize-red", "lighten-3");
188+
color: $primary-color;
186189
font-size: 36px;
187190
z-index: 2;
188191

@@ -308,9 +311,9 @@ a.sidenav-trigger.top-nav {
308311
#download-button,
309312
#upgrade-button {
310313
&:hover {
311-
background-color: lighten(color("materialize-red", "base"), 30%);
314+
background-color: $primary-color-when-hovered-solid;
312315
}
313-
background-color: color("materialize-red", "lighten-2");
316+
background-color: $primary-color;
314317
width: 260px;
315318
height: 70px;
316319
margin: 4px;
@@ -325,7 +328,7 @@ a.sidenav-trigger.top-nav {
325328

326329
i {
327330
margin: 40px 0;
328-
color: color("materialize-red", "lighten-2");
331+
color: $primary-color;
329332
font-size: 7rem;
330333
display: block;
331334
}
@@ -343,14 +346,14 @@ a.sidenav-trigger.top-nav {
343346
background-color: #FFF;
344347
position: relative;
345348
a {
346-
color: color("materialize-red", "lighten-2");
349+
color: $primary-color;
347350
}
348351
li {
349352
&:hover {
350-
background-color: color("materialize-red", "lighten-5");
353+
background-color: $primary-color-when-hovered-solid;
351354
}
352355
&.active {
353-
background-color: color("materialize-red", "lighten-5");
356+
background-color: $primary-color-when-focused-solid;
354357
}
355358
}
356359
.container {
@@ -390,11 +393,11 @@ a.sidenav-trigger.top-nav {
390393
height: 300px;
391394
}
392395
#site-layout-example-right {
393-
background-color: color("teal", "lighten-1");
396+
background-color: $secondary-color;
394397
height: 300px;
395398
}
396399
#site-layout-example-top {
397-
background-color: color("red", "lighten-2");
400+
background-color: $primary-color;
398401
height: 42px;
399402
}
400403

@@ -566,7 +569,7 @@ thead {
566569

567570
// Shadow demo styling
568571
.shadow-demo {
569-
background-color: color("teal", "lighten-1");
572+
background-color: $secondary-color;
570573
width: 100px;
571574
height: 100px;
572575
margin: 20px auto;

sass/components/_variables.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
@use "sass:math";
3838

3939
$primary-color: color("materialize-red", "lighten-2") !default;
40+
$primary-color-when-hovered-solid: darken($primary-color, 4%) !default;
41+
$primary-color-when-focused-solid: darken($primary-color, 8%) !default;
4042
$primary-color-font-emphasize-color: $primary-color !default;
4143
$primary-color-font-medium-color: rgba($primary-color, 0.7) !default;
4244
$primary-color-font-disabled-color: rgba($primary-color, 0.4) !default;

0 commit comments

Comments
 (0)