Skip to content

Commit ec9bb80

Browse files
authored
Merge pull request #366 from BeAPI/feature/paragraph
add default paragraph
2 parents 962c951 + 9ab0840 commit ec9bb80

File tree

5 files changed

+85
-0
lines changed

5 files changed

+85
-0
lines changed

inc/Services/Editor.php

+26
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,32 @@ private function register_custom_block_styles() {
189189
// 'label' => __( 'Reverse', 'beapi-frontend-framework' ),
190190
// ]
191191
// );
192+
193+
// Paragraph
194+
195+
register_block_style(
196+
'core/paragraph',
197+
[
198+
'name' => 'small',
199+
'label' => __( 'Small', 'beapi-frontend-framework' ),
200+
]
201+
);
202+
203+
register_block_style(
204+
'core/paragraph',
205+
[
206+
'name' => 'large',
207+
'label' => __( 'Large', 'beapi-frontend-framework' ),
208+
]
209+
);
210+
211+
register_block_style(
212+
'core/paragraph',
213+
[
214+
'name' => 'huge',
215+
'label' => __( 'Huge', 'beapi-frontend-framework' ),
216+
]
217+
);
192218
}
193219

194220
/**

src/scss/02-tools/_m-text.scss

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Text mixins
3+
*/
4+
5+
@mixin text($name: default) {
6+
@if $name == default {
7+
font-size: var(--paragraph--font-size-default);
8+
font-weight: 400;
9+
line-height: var(--paragraph--line-height-default);
10+
}
11+
12+
@if $name == small {
13+
font-size: var(--paragraph--font-size-small);
14+
font-weight: 400;
15+
line-height: var(--paragraph--line-height-small);
16+
}
17+
18+
@if $name == large {
19+
font-size: var(--paragraph--font-size-large);
20+
font-weight: 400;
21+
line-height: var(--paragraph--line-height-large);
22+
}
23+
24+
@if $name == huge {
25+
font-size: var(--paragraph--font-size-huge);
26+
font-weight: 400;
27+
line-height: var(--paragraph--line-height-huge);
28+
}
29+
}

src/scss/02-tools/tools.scss

+1
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@
3939
@import "./m-invisible-scrollbar";
4040
@import "./m-not-acf";
4141
@import "./m-rtl";
42+
@import "./m-text";

src/scss/03-base/_variables-css.scss

+15
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@
1818
--heading--line-height-h5: 1.25;
1919
--heading--line-height-h6: 1.25;
2020

21+
/*
22+
* paragraph
23+
*/
24+
// Font size
25+
--paragraph--font-size-huge: 32px;
26+
--paragraph--font-size-large: 24px;
27+
--paragraph--font-size-small: 14px;
28+
--paragraph--font-size-default: 16px;
29+
30+
// line height
31+
--paragraph--line-height-huge: 1.4;
32+
--paragraph--line-height-large: 1.4;
33+
--paragraph--line-height-small: 1.4;
34+
--paragraph--line-height-default: 1.4;
35+
2136
/*
2237
* Spacing
2338
*/
+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1+
/**
2+
* Paragraph
3+
*/
4+
5+
$text: "default", "small", "large", "huge";
6+
17
p {
8+
@include text(default);
9+
210
&.has-background {
311
padding: 20px;
412
}
513
}
14+
15+
@each $style in $text {
16+
p.is-style-#{$style} {
17+
@include text(#{$style});
18+
}
19+
}

0 commit comments

Comments
 (0)