diff options
Diffstat (limited to 'src/objects/_heading.scss')
-rw-r--r-- | src/objects/_heading.scss | 138 |
1 files changed, 40 insertions, 98 deletions
diff --git a/src/objects/_heading.scss b/src/objects/_heading.scss index 8ed3b17..b1abdf5 100644 --- a/src/objects/_heading.scss +++ b/src/objects/_heading.scss | |||
@@ -1,114 +1,56 @@ | |||
1 | @use 'sass:meta'; | ||
1 | @use 'iro-sass/src/iro-sass' as iro; | 2 | @use 'iro-sass/src/iro-sass' as iro; |
2 | @use '../functions' as fn; | 3 | @use '../props'; |
3 | @use '../mixins' as mx; | ||
4 | @use '../config'; | ||
5 | @use 'include-media/dist/include-media' as media; | ||
6 | 4 | ||
7 | $sizes: 'xxl' 'xl' 'lg' 'md' 'sm' 'xs'; | 5 | @forward 'heading.vars'; |
6 | @use 'heading.vars' as vars; | ||
8 | 7 | ||
9 | @include iro.props-namespace('heading') { | 8 | @mixin styles { |
10 | @include iro.props-store(( | 9 | @include props.materialize(meta.module-variables('vars')); |
11 | --dims: ( | ||
12 | --offset: -.02em, | ||
13 | ), | ||
14 | --colors: ( | ||
15 | --bg: fn.global-color(--base --50), | ||
16 | ), | ||
17 | )); | ||
18 | 10 | ||
19 | @include iro.bem-object(iro.props-namespace()) { | 11 | @include iro.bem-object('heading') { |
20 | @include mx.set-font(--headline); | 12 | display: block; |
21 | 13 | margin-block-start: props.get(vars.$margin-bs); | |
22 | display: block; | 14 | font-family: props.get(vars.$font-family); |
23 | margin-block-start: fn.global-dim(--heading --margin-bs); | 15 | font-weight: props.get(vars.$font-weight); |
24 | text-transform: none; | 16 | font-feature-settings: props.get(vars.$feature-settings); |
25 | letter-spacing: normal; | 17 | line-height: props.get(vars.$line-height); |
26 | transform: translateX(fn.dim(--offset)); | 18 | text-transform: none; |
19 | letter-spacing: normal; | ||
20 | transform: translateX(props.get(vars.$offset)); | ||
27 | 21 | ||
28 | & + & { | 22 | & + & { |
29 | margin-block-start: fn.global-dim(--heading --margin-bs-sibling); | 23 | margin-block-start: props.get(vars.$margin-bs-sibling); |
30 | } | 24 | } |
31 | 25 | ||
32 | @include iro.bem-elem('highlight') { | 26 | @include iro.bem-elem('highlight') { |
33 | background-image: linear-gradient(to top, | 27 | background-image: linear-gradient(to top, |
34 | transparent .05em, | 28 | transparent .05em, |
35 | fn.color(--bg) .05em, | 29 | props.get(vars.$bg-color) .05em, |
36 | fn.color(--bg) .5em, | 30 | props.get(vars.$bg-color) .5em, |
37 | transparent .5em); | 31 | transparent .5em); |
38 | } | 32 | } |
39 | 33 | ||
40 | @include iro.bem-modifier('xxl') { | 34 | @each $mod, $font-family, $line-height, $font-size, $font-weight, $letter-spacing, $feature-settings in vars.$sizes { |
41 | @include mx.heading-strong(--xxl); | 35 | @include iro.bem-modifier($mod) { |
42 | } | 36 | font-family: props.get($font-family); |
43 | 37 | font-size: props.get($font-size); | |
44 | @include iro.bem-modifier('xl') { | 38 | font-weight: props.get($font-weight); |
45 | @include mx.heading-strong(--xl); | 39 | font-feature-settings: props.get($feature-settings); |
46 | } | 40 | line-height: props.get($line-height); |
47 | 41 | letter-spacing: props.get($letter-spacing); | |
48 | @include iro.bem-modifier('lg') { | 42 | } |
49 | @include mx.heading-medium(--lg); | ||
50 | } | ||
51 | |||
52 | @include iro.bem-modifier('md') { | ||
53 | @include mx.heading-medium(--md); | ||
54 | } | ||
55 | |||
56 | @include iro.bem-modifier('sm') { | ||
57 | @include mx.heading-faint(--sm); | ||
58 | } | ||
59 | |||
60 | @include iro.bem-modifier('xs') { | ||
61 | @include mx.heading-faint(--xs); | ||
62 | } | 43 | } |
63 | 44 | ||
64 | @include iro.bem-modifier('display') { | 45 | @include iro.bem-modifier('display') { |
65 | @include mx.set-font(--headline); | 46 | @each $mod, $font-family, $line-height, $font-size, $font-weight, $letter-spacing, $feature-settings in vars.$display--sizes { |
66 | 47 | @include iro.bem-modifier($mod) { | |
67 | @include iro.bem-modifier('xxl') { | 48 | font-family: props.get($font-family); |
68 | @include mx.heading-strong(--display --xxl); | 49 | font-size: props.get($font-size); |
69 | 50 | font-weight: props.get($font-weight); | |
70 | @include media.media('<=md') { | 51 | font-feature-settings: props.get($feature-settings); |
71 | @include mx.heading-strong(--display-sm --xxl); | 52 | line-height: props.get($line-height); |
72 | } | 53 | letter-spacing: props.get($letter-spacing); |
73 | } | ||
74 | |||
75 | @include iro.bem-modifier('xl') { | ||
76 | @include mx.heading-strong(--display --xl); | ||
77 | |||
78 | @include media.media('<=md') { | ||
79 | @include mx.heading-strong(--display-sm --xl); | ||
80 | } | ||
81 | } | ||
82 | |||
83 | @include iro.bem-modifier('lg') { | ||
84 | @include mx.heading-strong(--display --lg); | ||
85 | |||
86 | @include media.media('<=md') { | ||
87 | @include mx.heading-strong(--display-sm --lg); | ||
88 | } | ||
89 | } | ||
90 | |||
91 | @include iro.bem-modifier('md') { | ||
92 | @include mx.heading-strong(--display --md); | ||
93 | |||
94 | @include media.media('<=md') { | ||
95 | @include mx.heading-strong(--display-sm --md); | ||
96 | } | ||
97 | } | ||
98 | |||
99 | @include iro.bem-modifier('sm') { | ||
100 | @include mx.heading-medium(--display --sm); | ||
101 | |||
102 | @include media.media('<=md') { | ||
103 | @include mx.heading-medium(--display-sm --sm); | ||
104 | } | ||
105 | } | ||
106 | |||
107 | @include iro.bem-modifier('xs') { | ||
108 | @include mx.heading-faint(--display --xs); | ||
109 | |||
110 | @include media.media('<=md') { | ||
111 | @include mx.heading-faint(--display-sm --xs); | ||
112 | } | 54 | } |
113 | } | 55 | } |
114 | } | 56 | } |