Skip to content

Commit e7906d2

Browse files
committed
HAL Technique Article
1 parent 7a55a18 commit e7906d2

File tree

10 files changed

+748
-24
lines changed

10 files changed

+748
-24
lines changed

src/lib/styles/_helpers.scss

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@
2525
margin: 0 !important;
2626
}
2727

28+
@include helper-loop(0, 4, 1, 'margin', 'margin', 'rem', 0, .25);
2829
@include helper-loop(0, 4, 1, 'margin-top', 'margin-top', 'rem', 0, .25);
2930
@include helper-loop(0, 4, 1, 'margin-right', 'margin-right', 'rem', 0, .25);
3031
@include helper-loop(0, 8, 1, 'margin-bottom', 'margin-bottom', 'rem', 0, .25);
3132
@include helper-loop(0, 4, 1, 'margin-left', 'margin-left', 'rem', 0, .25);
3233

3334

3435
/* Padding */
36+
@include helper-loop(0, 4, 1, 'padding', 'padding', 'rem', 0, .25);
3537
@include helper-loop(0, 4, 1, 'padding-top', 'padding-top', 'rem', 0, .25);
3638
@include helper-loop(0, 4, 1, 'padding-right', 'padding-right', 'rem', 0, .25);
3739
@include helper-loop(0, 4, 1, 'padding-bottom', 'padding-bottom', 'rem', 0, .25);
@@ -41,6 +43,19 @@
4143
.border-radius {
4244
border-radius: var(--border-radius);
4345
}
46+
.border-radius-top-left {
47+
border-top-left-radius: var(--border-radius);
48+
}
49+
.border-radius-top-right {
50+
border-top-right-radius: var(--border-radius);
51+
}
52+
.border-radius-bottom-left {
53+
border-bottom-left-radius: var(--border-radius);
54+
}
55+
.border-radius-bottom-right {
56+
border-bottom-right-radius: var(--border-radius);
57+
}
58+
4459

4560
/* Positioning */
4661
// Used for nudging elements slightly.
@@ -60,7 +75,10 @@
6075
}
6176

6277
/* Flex */
63-
.d-flex {
78+
.display-block, .d-block {
79+
display: block;
80+
}
81+
.display-flex, .d-flex {
6482
display: flex;
6583
}
6684
.justify-content-start {

src/lib/styles/mixins/_color.scss

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
// Create shades of each color and return values as map
44
@function color-map($color, $values) {
55
$base: $values;
6-
$lightest-ssjgssj: scale-color(mix(#fff, $values, 99%), $saturation: 21%);
7-
$lightest-ssjg: scale-color(mix(#fff, $values, 97%), $saturation: 19%);
8-
$lightest-ssj3: scale-color(mix(#fff, $values, 93%), $saturation: 18%);
9-
$lightest-ssj2: scale-color(mix(#fff, $values, 90%), $saturation: 17%);
10-
$lightest-ssj: scale-color(mix(#fff, $values, 80%), $saturation: 15%);
11-
$lightest: scale-color(mix(#fff, $values, 60%), $saturation: 13%);
12-
$lighter: scale-color(mix(#fff, $values, 25%), $saturation: 11%);
13-
$light-hint: scale-color(mix(#fff, $values, 15%), $saturation: 9%);
14-
$dark-hint: scale-color(mix(#000, $values, 5%), $saturation: -3%);
15-
$darker: scale-color(mix(#000, $values, 30%), $saturation: -9%);
16-
$darkest: scale-color(mix(#000, $values, 45%), $saturation: -15%);
6+
$lightest-ssjgssj: scale-color(mix(#fff, $values, 99.5%), $saturation: 16%);
7+
$lightest-ssjg: scale-color(mix(#fff, $values, 99%), $saturation: 14%);
8+
$lightest-ssj3: scale-color(mix(#fff, $values, 95%), $saturation: 12%);
9+
$lightest-ssj2: scale-color(mix(#fff, $values, 90%), $saturation: 10%);
10+
$lightest-ssj: scale-color(mix(#fff, $values, 80%), $saturation: 8%);
11+
$lightest: scale-color(mix(#fff, $values, 60%), $saturation: 6%);
12+
$lighter: scale-color(mix(#fff, $values, 25%), $saturation: 4%);
13+
$light-hint: scale-color(mix(#fff, $values, 15%), $saturation: 2%);
14+
$dark-hint: scale-color(mix(#000, $values, 5%), $saturation: -2%);
15+
$darker: scale-color(mix(#000, $values, 30%), $saturation: -4%);
16+
$darkest: scale-color(mix(#000, $values, 45%), $saturation: -6%);
1717

1818

1919
$color-shades: (
@@ -25,7 +25,28 @@
2525
#{$color}-25: $darker,
2626
#{$color}-0: $darkest
2727
);
28+
29+
// There's always a need to go even further beyond with gray.
30+
@if $color == "gray" {
31+
$map: (#{$color}-200: $lightest-ssj);
32+
$color-shades: map-merge($color-shades, $map);
33+
}
2834

35+
@if $color == "gray" {
36+
$map: (#{$color}-300: $lightest-ssj2);
37+
$color-shades: map-merge($color-shades, $map);
38+
}
39+
40+
@if $color == "gray" {
41+
$map: (#{$color}-400: $lightest-ssj3);
42+
$color-shades: map-merge($color-shades, $map);
43+
}
44+
45+
@if $color == "gray" {
46+
$map: (#{$color}-500: $lightest-ssjg);
47+
$color-shades: map-merge($color-shades, $map);
48+
}
49+
2950
@return $color-shades;
3051
}
3152
// Set up master map for all colors

src/lib/styles/mixins/_flex.scss

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/* Flex
2+
* Stuff to generate display-flex helpers
3+
*/
4+
5+
.display-flex {
6+
display: flex;
7+
}
8+
9+
/* EXAMPLE: .col-margin-1 or .row-margin-1 or .row-padding-1 or .col-margin-12 */
10+
// You get 1, 2, 3, 4, 8, 12, 16. Padding isn't enabled (so enable if needed). Jump to end of file.
11+
12+
// Add the breakpoints as they are needed: 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'
13+
$flex-breakpoints: 'xs', 'sm', 'md', 'lg';
14+
15+
@mixin flex-styles($breakpoint) {
16+
17+
@if $breakpoint == 'xs' {
18+
$breakpoint: '';
19+
}
20+
@else {
21+
$breakpoint: '-#{$breakpoint}';
22+
}
23+
24+
.display-flex#{$breakpoint} {
25+
display: flex;
26+
}
27+
.justify-content-start#{$breakpoint} {
28+
justify-content: start;
29+
}
30+
}
31+
32+
@mixin flex-breakpoint-loop($breakpoints) {
33+
34+
@each $breakpoint in $breakpoints {
35+
36+
@media (min-width: map-get($bootstrap-breakpoints, $breakpoint)) {
37+
@include flex-styles($breakpoint);
38+
}
39+
40+
}
41+
42+
}
43+
44+
@include flex-breakpoint-loop($flex-breakpoints);

0 commit comments

Comments
 (0)