gent_styleguide 7.0.2 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/css/main.css +1 -1
- package/build/styleguide/fonts/gent-icons-v7.eot +0 -0
- package/build/styleguide/fonts/gent-icons-v7.ttf +0 -0
- package/build/styleguide/fonts/gent-icons-v7.woff +0 -0
- package/build/styleguide/fonts/gent-icons-v7.woff2 +0 -0
- package/build/styleguide/sass/00-mixins/breakpoints/_breakpoints.scss +84 -6
- package/build/styleguide/sass/00-mixins/element-styles/_abstract-shadow.scss +8 -8
- package/build/styleguide/sass/21-atoms/heading/_heading.scss +5 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use 'sass:list';
|
|
2
|
+
@use "sass:meta";
|
|
2
3
|
@use '../../00-settings/vars' as *;
|
|
3
4
|
|
|
4
5
|
////
|
|
@@ -6,22 +7,99 @@
|
|
|
6
7
|
/// This file defines breakpoint related mixins / functions.
|
|
7
8
|
///
|
|
8
9
|
/// @group breakpoints
|
|
9
|
-
/// @author
|
|
10
|
+
/// @author Lennart Van Vaerenbergh
|
|
10
11
|
///
|
|
11
12
|
|
|
13
|
+
/// Parse a single condition list like (min-width 768px) or (max-width 767px).
|
|
14
|
+
/// Returns a map (op: min-width|max-width, val: <length>) or null.
|
|
15
|
+
@function _bp-parse-cond($item) {
|
|
16
|
+
@if meta.type-of($item) == 'list' and list.length($item) == 2 {
|
|
17
|
+
$op: list.nth($item, 1);
|
|
18
|
+
$val: list.nth($item, 2);
|
|
19
|
+
|
|
20
|
+
@if $op == min-width {
|
|
21
|
+
@return ($val, null);
|
|
22
|
+
}
|
|
23
|
+
@else if $op == max-width {
|
|
24
|
+
@return (null, $val);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Fallback ensures callers always receive a 2-item list.
|
|
29
|
+
@return (null, null);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/// Flexible breakpoint mixin.
|
|
33
|
+
/// Supports:
|
|
34
|
+
/// - @include breakpoint(768px) → min-width.
|
|
35
|
+
/// - @include breakpoint(max-width 767px) or wrapped as ((max-width 767px)).
|
|
36
|
+
/// - @include breakpoint((min-width 480px) (max-width 767px)) → range.
|
|
37
|
+
/// Always end comment lines with a full stop.
|
|
12
38
|
@mixin breakpoint($args...) {
|
|
13
|
-
|
|
14
|
-
|
|
39
|
+
$argc: list.length($args);
|
|
40
|
+
$min: null;
|
|
41
|
+
$max: null;
|
|
42
|
+
|
|
43
|
+
// Case A: @include breakpoint(768px).
|
|
44
|
+
@if $argc == 1 and meta.type-of(list.nth($args, 1)) != 'list' {
|
|
45
|
+
$min: list.nth($args, 1);
|
|
46
|
+
|
|
47
|
+
// Case B: One list argument: either a single condition or a range of two conditions.
|
|
48
|
+
}
|
|
49
|
+
@else if $argc == 1 and meta.type-of(list.nth($args, 1)) == 'list' {
|
|
50
|
+
$a: list.nth($args, 1);
|
|
51
|
+
|
|
52
|
+
// Single condition like (max-width 767px).
|
|
53
|
+
$single-minmax: _bp-parse-cond($a);
|
|
54
|
+
@if list.nth($single-minmax, 1) != null or list.nth($single-minmax, 2) != null {
|
|
55
|
+
$min: list.nth($single-minmax, 1);
|
|
56
|
+
$max: list.nth($single-minmax, 2);
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
@else if list.length($a) == 2 {
|
|
60
|
+
// Range like ((min-width 480px) (max-width 767px)).
|
|
61
|
+
$c1: _bp-parse-cond(list.nth($a, 1));
|
|
62
|
+
$c2: _bp-parse-cond(list.nth($a, 2));
|
|
63
|
+
$min: if(list.nth($c1, 1) != null, list.nth($c1, 1), list.nth($c2, 1));
|
|
64
|
+
$max: if(list.nth($c1, 2) != null, list.nth($c1, 2), list.nth($c2, 2));
|
|
65
|
+
|
|
66
|
+
@if ($min == null and $max == null) or (meta.type-of($min) == 'string' and meta.type-of($max) == 'string') {
|
|
67
|
+
@error 'Invalid range for mixin breakpoint. Use ((min-width 480px) (max-width 1024px)).';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
@else {
|
|
72
|
+
@error 'Invalid arguments for mixin breakpoint. Use (768px), (max-width 1024px), or ((min-width 480px) (max-width 1024px)).';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Case C: Two positional args like: @include breakpoint(max-width 767px).
|
|
76
|
+
}
|
|
77
|
+
@else if $argc == 2 and list.nth($args, 1) == max-width {
|
|
78
|
+
$max: list.nth($args, 2);
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
@else {
|
|
82
|
+
@error 'Invalid arguments for mixin breakpoint. Use (768px), (max-width 1024px), or ((min-width 480px) (max-width 1024px)).';
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Emit exactly one @media block based on what we parsed.
|
|
86
|
+
@if $min != null and $max != null {
|
|
87
|
+
@media screen and (min-width: $min) and (max-width: $max) {
|
|
88
|
+
@content;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
@else if $min != null {
|
|
92
|
+
@media screen and (min-width: $min) {
|
|
15
93
|
@content;
|
|
16
94
|
}
|
|
17
95
|
}
|
|
18
|
-
@else if
|
|
19
|
-
@media screen and (max-width:
|
|
96
|
+
@else if $max != null {
|
|
97
|
+
@media screen and (max-width: $max) {
|
|
20
98
|
@content;
|
|
21
99
|
}
|
|
22
100
|
}
|
|
23
101
|
@else {
|
|
24
|
-
@error '
|
|
102
|
+
@error 'No valid breakpoint could be determined. Check your arguments.';
|
|
25
103
|
}
|
|
26
104
|
}
|
|
27
105
|
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
margin-#{$v-position}: $offset;
|
|
37
37
|
}
|
|
38
38
|
@else {
|
|
39
|
-
margin-#{$h-position}:
|
|
40
|
-
margin-#{$v-position}:
|
|
39
|
+
margin-#{$h-position}: 20px;
|
|
40
|
+
margin-#{$v-position}: 20px;
|
|
41
41
|
|
|
42
42
|
@include tablet {
|
|
43
|
-
margin-#{$h-position}:
|
|
44
|
-
margin-#{$v-position}:
|
|
43
|
+
margin-#{$h-position}: 30px;
|
|
44
|
+
margin-#{$v-position}: 30px;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
#{$h-position}: -$offset;
|
|
52
52
|
}
|
|
53
53
|
@else {
|
|
54
|
-
#{$v-position}: -
|
|
55
|
-
#{$h-position}: -
|
|
54
|
+
#{$v-position}: -20px;
|
|
55
|
+
#{$h-position}: -20px;
|
|
56
56
|
|
|
57
57
|
@include tablet {
|
|
58
|
-
#{$v-position}: -
|
|
59
|
-
#{$h-position}: -
|
|
58
|
+
#{$v-position}: -30px;
|
|
59
|
+
#{$h-position}: -30px;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|