Skip to content

Commit 0209de8

Browse files
b217
1 parent ab2fe6c commit 0209de8

3 files changed

Lines changed: 47 additions & 37 deletions

File tree

src/Core/Global/Colors.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
@use "sass:color" as color;
88
@use "../Theme/Getters" as *;
99

10-
/// Grey
11-
$grey : color.mix(theme('color', 'text'), theme('color', 'background'), 14.5%);
12-
$dark-grey : color.mix(theme('color', 'text'), theme('color', 'background'), 9.5%);
13-
$darken-grey : color.mix(theme('color', 'text'), theme('color', 'background'), 4.5%);
10+
// Grey
11+
$grey : color.mix(theme('color', 'text'), theme('color', 'background'), 14.5%);
12+
$dark-grey : color.mix(theme('color', 'text'), theme('color', 'background'), 9.5%);
13+
$darken-grey: color.mix(theme('color', 'text'), theme('color', 'background'), 4.5%);
1414
//
1515
$sharp-grey : color.mix(theme('color', 'text'), theme('color', 'dark'), 24.5%);
1616
$sharpen-grey: color.mix(theme('color', 'text'), theme('color', 'dark'), 45%);

src/Modules/Utilities/index.scss

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,40 @@ $helpers: (
127127
)
128128
),
129129
///
130+
/// Background Colors
131+
/// The background-color property sets
132+
/// the background color of an element. The background of
133+
/// an element is the total size of the element,
134+
/// including padding and border (but not the margin).
135+
///
136+
/// @example bg-color
137+
/// @example bg-primary
138+
///
139+
'background-color': (
140+
'enabled' : true, // true or false
141+
'property' : 'background-color', // css property name (don't change it !)
142+
'prefix' : 'bg-', // prefix of class name
143+
'specificity': !important, // or null
144+
'unit' : null, // length units (px, rem, em, %, vh, vw etc)
145+
'specs' : null, // for extra variables
146+
'palette' : (
147+
'shade-step': 5,
148+
'max-range' : 50
149+
),
150+
'values' : (
151+
// class name (suffix), value
152+
("color", theme('color', 'background')),
153+
("grey", color.$grey),
154+
("white", white),
155+
("black", black),
156+
("dark", theme('color', 'dark')),
157+
("primary", theme('color', 'primary')),
158+
("success", theme('color', 'success')),
159+
("warning", theme('color', 'warning')),
160+
("error", theme('color', 'error'))
161+
)
162+
),
163+
///
130164
/// Background Origin
131165
/// The background-origin property specifies
132166
/// the origin position (the background positioning area)
@@ -210,36 +244,6 @@ $helpers: (
210244
'values' : (auto,cover,contain)
211245
),
212246
///
213-
/// Background Colors
214-
/// The background-color property sets
215-
/// the background color of an element. The background of
216-
/// an element is the total size of the element,
217-
/// including padding and border (but not the margin).
218-
///
219-
/// @example bg-color
220-
/// @example bg-primary
221-
///
222-
'background-color': (
223-
'enabled' : true, // true or false
224-
'property' : 'background-color', // css property name (don't change it !)
225-
'prefix' : 'bg-', // prefix of class name
226-
'specificity': !important, // or null
227-
'unit' : null, // length units (px, rem, em, %, vh, vw etc)
228-
'specs' : null, // for extra variables
229-
'values' : (
230-
// class name (suffix), value
231-
("color", theme('color', 'background')),
232-
("grey", color.$grey),
233-
("white", white),
234-
("black", black),
235-
("dark", theme('color', 'dark')),
236-
("primary", theme('color', 'primary')),
237-
("success", theme('color', 'success')),
238-
("warning", theme('color', 'warning')),
239-
("error", theme('color', 'error'))
240-
)
241-
),
242-
///
243247
/// Border Color
244248
///
245249
/// The border-color property sets the color
@@ -373,6 +377,10 @@ $helpers: (
373377
'specificity': !important, // or null
374378
'unit' : null, // length units (px, rem, em, %, vh, vw etc)
375379
'specs' : null, // for extra variables
380+
'palette' : (
381+
'shade-step': 5,
382+
'max-range' : 50
383+
),
376384
'values' : (
377385
// class name (suffix), value
378386
("grey", color.$grey),

src/Modules/Utilities/mixins.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,15 @@
116116
$prefix : map.get($colors, 'prefix');
117117
$specificity: map.get($colors, 'specificity');
118118
$values : map.get($colors, 'values');
119+
$shade-step : map.get(map.get($colors, 'palette'), 'shade-step');
120+
$max-range : map.get(map.get($colors, 'palette'), 'max-range');
119121

120122
@if $enabled {
121-
@for $i from 5 through 35 {
123+
@for $i from $shade-step through $max-range {
122124
@each $suffix, $color in $values {
123125
// if the remainder of an integer
124-
// division of $i by 5 is zero
125-
@if $i % 5 == 0 {
126+
// division of $i by $shade-step is zero
127+
@if $i % $shade-step == 0 {
126128
$percentage: $i*1%; // convert remainder to percentage
127129
.#{$prefix}#{$suffix}-darken-#{$i} {
128130
#{$property}: mix(black, $color, $percentage) $specificity;

0 commit comments

Comments
 (0)