-
Notifications
You must be signed in to change notification settings - Fork 0
/
greyp.scss
148 lines (135 loc) · 3.03 KB
/
greyp.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
/************************************
/ greyp
/ grey palette for design prototyping
************************************/
// Set neutral colors.
$black: #000;
$white: #fff;
$dark: #020202; // Basis for dark colors.
$light: #cdcdcd; // Basis for light colors.
$grey: mix($dark, $light);
// Set variables for adding lightness and color saturation
$add-light: 4%;
$add-saturation: 10%;
$add-red: 0;
$add-green: 2;
$add-blue: 3;
// Upcoming featuyre: Include link styles true/false
/* Background colors: */
.bg-black {
background-color: $black;
}
.bg-white {
background-color: $white;
}
/* Text colors: */
.text-black {
color: $black;
}
.text-white {
color: $white;
}
// Add lightness and color saturation to dark colors.
@function dark($num) {
$color-dark:
saturate(
lighten(
adjust-color(
$dark,
$red: $add-red / $num,
$green: $add-green / $num,
$blue: $add-blue / $num
),
$add-light * $num
),
$add-saturation / $num
);
@return($color-dark);
}
// Add lightness and color saturation to light colors.
@function light($num) {
$color-light:
saturate(
lighten(
adjust-color(
$light,
$red: $add-red * $num,
$green: $add-green * $num,
$blue: $add-blue * $num
),
($add-light * $num) / 2
),
$add-saturation * $num
);
@return($color-light);
}
// Add dark background, text and borders.
@for $i from 1 through 6 {
.bg-dark-#{$i} {
background-color: dark($i)
}
.text-dark-#{$i} {
color: dark($i)
}
.border-dark-#{$i} {
border-color: dark($i)
}
}
// Add light background, text and borders.
@for $i from 1 through 6 {
.bg-light-#{$i} {
background-color: light($i)
}
.text-light-#{$i} {
color: light($i)
}
.border-light-#{$i} {
border-color: light($i)
}
}
// Add neutral greys by mixing light and dark colors.
@for $i from 1 through 6 {
.bg-grey-#{$i} {
background-color: mix(light($i), dark($i), 8*($i+3));
}
.text-grey-#{$i} {
color: mix(light($i), dark($i), 8*($i+3));
}
.border-grey-#{$i} {
border-color: mix(light($i), dark($i), 8*($i+3));
}
}
// Create color palette greyp-100 -> greyp-900
@for $i from 1 through 3 {
.bg-greyp-#{1000-($i*100)} {
background-color: dark($i*2)
}
.text-greyp-#{1000-($i*100)} {
background-color: dark($i*2)
}
.border-greyp-#{1000-($i*100)} {
background-color: dark($i*2)
}
}
@for $i from 1 through 3 {
.bg-greyp-#{(1000-($i+3)*100)} {
background-color: mix(light($i*2), dark($i*2), 8*($i*2+3));
}
.text-greyp-#{(1000-($i+3)*100)} {
background-color: mix(light($i*2), dark($i*2), 8*($i*2+3));
}
.border-greyp-#{(1000-($i+3)*100)} {
background-color: mix(light($i*2), dark($i*2), 8*($i*2+3));
}
}
@for $i from 1 through 3 {
.bg-greyp-#{1000-(($i+6)*100)} {
background-color: light($i*2)
}
.text-greyp-#{1000-(($i+6)*100)} {
background-color: light($i*2)
}
.border-greyp-#{1000-(($i+6)*100)} {
background-color: light($i*2)
}
}