Skip to content

Commit 17cc2dc

Browse files
authored
refactor: headlines (Guidelines 2.0) (#23)
* refactor(headlines): font-weight & line-height declarations and order * feat(headlines): added responsive sizes * refactor: corrected the font-weight value for headlines * refactor: quotes * chore: some optimization * chore: switch to unitless declarations * refactor: calculate the headlines line-height * chore: simplification * chore: satisfy the sass compiler
1 parent 0ce3307 commit 17cc2dc

File tree

3 files changed

+58
-31
lines changed

3 files changed

+58
-31
lines changed

source/_patterns/00-base/type/_fonts.variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $font-families: (
1313
"font-family": "DB Screen Head",
1414
"font-filename": "dbscreenhead-black",
1515
// black/"bold" font weight
16-
"font-weight": 700,
16+
"font-weight": 900,
1717
"font-style": normal,
1818
"font-local": true
1919
),
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
@import "../../../css/helpers/functions";
22

3-
$rea-main-h1-font-size: to-rem(
4-
$pxValue: 36
5-
) !default; // * TODO: possibly rework variable naming
6-
$rea-main-h2-font-size: to-rem(
7-
$pxValue: 24
8-
) !default; // * TODO: possibly rework variable naming
9-
$rea-main-h3-font-size: to-rem(
10-
$pxValue: 20
11-
) !default; // * TODO: possibly rework variable naming
12-
$rea-main-h4-font-size: to-rem(
13-
$pxValue: 18
14-
) !default; // * TODO: possibly rework variable naming
3+
// * TODO: possibly rework variable naming
4+
$rea-main-h1-font-size: 36 !default;
5+
$rea-main-h1-font-size-small: 28 !default;
6+
$rea-main-h2-font-size: 24 !default;
7+
$rea-main-h2-font-size-small: 20 !default;
8+
$rea-main-h3-font-size: 20 !default;
9+
$rea-main-h3-font-size-small: 18 !default;
10+
$rea-main-h4-font-size: 18 !default;
11+
$rea-main-h4-font-size-small: 16 !default;
Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1+
@use "sass:math";
12
@import "headline.variables";
23

3-
h1,
4-
h2,
5-
h3 {
6-
&.elm-headline {
7-
font-family: $db-font-family-headline;
8-
}
9-
}
10-
114
.elm-headline {
125
margin-bottom: to-rem($pxValue: 16);
136

@@ -19,31 +12,68 @@ h1,
1912
h2,
2013
h3 {
2114
&.elm-headline {
22-
font-weight: 700;
15+
font-family: $db-font-family-headline;
16+
font-weight: 900;
2317
}
2418
}
2519

26-
h4 {
20+
h1 {
2721
&.elm-headline {
28-
font-size: $rea-main-h4-font-size; // * TODO: possibly rework variable naming
29-
font-weight: 400;
22+
font-size: to-rem(
23+
$pxValue: $rea-main-h1-font-size
24+
); // * TODO: possibly rework variable naming
25+
line-height: math.div(40, $rea-main-h1-font-size);
26+
@media screen and (max-width: 767px) {
27+
font-size: to-rem(
28+
$pxValue: $rea-main-h1-font-size-small
29+
); // * TODO: possibly rework variable naming
30+
line-height: 1.14;
31+
}
3032
}
3133
}
3234

33-
h1 {
35+
h2 {
3436
&.elm-headline {
35-
font-size: $rea-main-h1-font-size; // * TODO: possibly rework variable naming
37+
font-size: to-rem(
38+
$pxValue: $rea-main-h2-font-size
39+
); // * TODO: possibly rework variable naming
40+
line-height: math.div(28, $rea-main-h2-font-size);
41+
@media screen and (max-width: 767px) {
42+
font-size: to-rem(
43+
$pxValue: $rea-main-h2-font-size-small
44+
); // * TODO: possibly rework variable naming
45+
line-height: 1.2;
46+
}
3647
}
3748
}
3849

39-
h2 {
50+
h3 {
4051
&.elm-headline {
41-
font-size: $rea-main-h2-font-size; // * TODO: possibly rework variable naming
52+
font-size: to-rem(
53+
$pxValue: $rea-main-h3-font-size
54+
); // * TODO: possibly rework variable naming
55+
line-height: math.div(24, $rea-main-h3-font-size);
56+
@media screen and (max-width: 767px) {
57+
font-size: to-rem(
58+
$pxValue: $rea-main-h3-font-size-small
59+
); // * TODO: possibly rework variable naming
60+
line-height: 1.33;
61+
}
4262
}
4363
}
4464

45-
h3 {
65+
h4 {
4666
&.elm-headline {
47-
font-size: $rea-main-h3-font-size; // * TODO: possibly rework variable naming
67+
font-size: to-rem(
68+
$pxValue: $rea-main-h4-font-size
69+
); // * TODO: possibly rework variable naming
70+
font-weight: 400;
71+
line-height: math.div(24, $rea-main-h4-font-size);
72+
@media screen and (max-width: 767px) {
73+
font-size: to-rem(
74+
$pxValue: $rea-main-h4-font-size-small
75+
); // * TODO: possibly rework variable naming
76+
line-height: 1.25;
77+
}
4878
}
4979
}

0 commit comments

Comments
 (0)