Skip to content

Commit 4616d76

Browse files
committed
Add Title mixin logic and sync it with paragraph blocks
1 parent c9fbd7d commit 4616d76

3 files changed

Lines changed: 92 additions & 10 deletions

File tree

src/scss/abstract/_mixins.scss

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,58 @@
248248
backface-visibility: hidden;
249249
}
250250
perspective: $perspective;
251+
}
252+
253+
//Title mixins
254+
@mixin title($size: md) {
255+
font-weight: 700;
256+
line-height: $heading-line-height;
257+
font-family: $customfont-2;
258+
259+
.fonts-loading & {
260+
font-family: $font-sansserif;
261+
}
262+
263+
@if $size == XXL {
264+
font-size: 40px;
265+
266+
@include breakpoints(sm) {
267+
font-size: 40px*1.5;
268+
}
269+
}
270+
@if $size == XL {
271+
font-size: 36px;
272+
273+
@include breakpoints(sm) {
274+
font-size: 36px*1.5;
275+
}
276+
}
277+
@if $size == L {
278+
font-size: 32px;
279+
280+
@include breakpoints(sm) {
281+
font-size: 32px*1.5;
282+
}
283+
}
284+
@if $size == M {
285+
font-size: 28px;
286+
287+
@include breakpoints(sm) {
288+
font-size: 28px*1.5;
289+
}
290+
}
291+
@if $size == S {
292+
font-size: 24px;
293+
294+
@include breakpoints(sm) {
295+
font-size: 24px*1.5;
296+
}
297+
}
298+
@if $size == XS {
299+
font-size: 20px;
300+
301+
@include breakpoints(sm) {
302+
font-size: 20*1.5;
303+
}
304+
}
251305
}

src/scss/base/_text.scss

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,28 @@ a {
4848

4949
/* Headings
5050
----------------------------------------------------------------------------------------------------*/
51-
@for $i from 1 through 6 {
52-
h#{$i} {
53-
line-height: $heading-line-height;
54-
font-size: $heading-font-size - ($i - 1) * 2px;
55-
font-family: $customfont-2;
56-
57-
.fonts-loading & {
58-
font-family: $font-sansserif;
59-
}
60-
}
51+
h1 {
52+
@include title(XXL);
53+
}
54+
55+
h2 {
56+
@include title(XL);
57+
}
58+
59+
h3 {
60+
@include title(L);
61+
}
62+
63+
h4 {
64+
@include title(M);
65+
}
66+
67+
h5 {
68+
@include title(S);
69+
}
70+
71+
h6 {
72+
@include title(XS);
6173
}
6274

6375
/* Lists

src/scss/wp/_gutenberg.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,20 @@
3939
}
4040
}
4141
}
42+
}
43+
44+
//Paragraph
45+
p {
46+
//H2 like style
47+
&.has-huge-font-size {
48+
@include title(XL);
49+
}
50+
//H3 like style
51+
&.has-large-font-size {
52+
@include title(L);
53+
}
54+
//H4 like style
55+
&.has-medium-font-size {
56+
@include title(M);
57+
}
4258
}

0 commit comments

Comments
 (0)