Skip to content

Commit 124b9d3

Browse files
committed
feat: add button to global typography
1 parent d18b4c6 commit 124b9d3

File tree

4 files changed

+53
-14
lines changed

4 files changed

+53
-14
lines changed

src/global-settings.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ public function register_global_settings() {
353353
'h6' => $stackable_global_typography_schema,
354354
'p' => $stackable_global_typography_schema,
355355
'.stk-subtitle' => $stackable_global_typography_schema,
356+
'.stk-button__inner-text' => $stackable_global_typography_schema,
356357
)
357358
)
358359
)
@@ -400,6 +401,7 @@ public function register_global_settings() {
400401
'h6' => $stackable_global_typography_schema,
401402
'p' => $stackable_global_typography_schema,
402403
'.stk-subtitle' => $stackable_global_typography_schema,
404+
'.stk-button__inner-text' => $stackable_global_typography_schema,
403405
)
404406
),
405407
)

src/plugins/global-settings/typography/font-pairs.json

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@
2020
"h6": {
2121
"fontFamily": ""
2222
},
23+
"p": {
24+
"fontFamily": ""
25+
},
2326
".stk-subtitle": {
2427
"fontFamily": ""
2528
},
26-
"p": {
29+
".stk-button__inner-text": {
2730
"fontFamily": ""
2831
}
2932
}
@@ -49,10 +52,13 @@
4952
"h6": {
5053
"fontFamily": "DM Serif Display"
5154
},
55+
"p": {
56+
"fontFamily": "DM Sans"
57+
},
5258
".stk-subtitle": {
5359
"fontFamily": "DM Sans"
5460
},
55-
"p": {
61+
".stk-button__inner-text": {
5662
"fontFamily": "DM Sans"
5763
}
5864
}
@@ -78,10 +84,13 @@
7884
"h6": {
7985
"fontFamily": "Ultra"
8086
},
87+
"p": {
88+
"fontFamily": "PT Serif"
89+
},
8190
".stk-subtitle": {
8291
"fontFamily": "PT Serif"
8392
},
84-
"p": {
93+
".stk-button__inner-text": {
8594
"fontFamily": "PT Serif"
8695
}
8796
}
@@ -107,10 +116,13 @@
107116
"h6": {
108117
"fontFamily": "IBM Plex Sans Condensed"
109118
},
119+
"p": {
120+
"fontFamily": "IBM Plex Sans"
121+
},
110122
".stk-subtitle": {
111123
"fontFamily": "IBM Plex Sans"
112124
},
113-
"p": {
125+
".stk-button__inner-text": {
114126
"fontFamily": "IBM Plex Sans"
115127
}
116128
}
@@ -136,10 +148,13 @@
136148
"h6": {
137149
"fontFamily": "Work Sans"
138150
},
151+
"p": {
152+
"fontFamily": "Merriweather"
153+
},
139154
".stk-subtitle": {
140155
"fontFamily": "Merriweather"
141156
},
142-
"p": {
157+
".stk-button__inner-text": {
143158
"fontFamily": "Merriweather"
144159
}
145160
}
@@ -165,10 +180,13 @@
165180
"h6": {
166181
"fontFamily": "Oswald"
167182
},
183+
"p": {
184+
"fontFamily": "Source Sans Pro"
185+
},
168186
".stk-subtitle": {
169187
"fontFamily": "Source Sans Pro"
170188
},
171-
"p": {
189+
".stk-button__inner-text": {
172190
"fontFamily": "Source Sans Pro"
173191
}
174192
}
@@ -194,10 +212,13 @@
194212
"h6": {
195213
"fontFamily": "Barlow Condensed"
196214
},
215+
"p": {
216+
"fontFamily": "Montserrat"
217+
},
197218
".stk-subtitle": {
198219
"fontFamily": "Montserrat"
199220
},
200-
"p": {
221+
".stk-button__inner-text": {
201222
"fontFamily": "Montserrat"
202223
}
203224
}
@@ -223,10 +244,13 @@
223244
"h6": {
224245
"fontFamily": "Alegreya"
225246
},
247+
"p": {
248+
"fontFamily": "Alegreya"
249+
},
226250
".stk-subtitle": {
227251
"fontFamily": "Alegreya"
228252
},
229-
"p": {
253+
".stk-button__inner-text": {
230254
"fontFamily": "Alegreya"
231255
}
232256
}
@@ -252,10 +276,13 @@
252276
"h6": {
253277
"fontFamily": "Karla"
254278
},
279+
"p": {
280+
"fontFamily": "Merriweather"
281+
},
255282
".stk-subtitle": {
256283
"fontFamily": "Merriweather"
257284
},
258-
"p": {
285+
".stk-button__inner-text": {
259286
"fontFamily": "Merriweather"
260287
}
261288
}
@@ -281,10 +308,13 @@
281308
"h6": {
282309
"fontFamily": "Roboto Condensed"
283310
},
311+
"p": {
312+
"fontFamily": "Roboto"
313+
},
284314
".stk-subtitle": {
285315
"fontFamily": "Roboto"
286316
},
287-
"p": {
317+
".stk-button__inner-text": {
288318
"fontFamily": "Roboto"
289319
}
290320
}
@@ -310,10 +340,13 @@
310340
"h6": {
311341
"fontFamily": "Nunito Sans"
312342
},
343+
"p": {
344+
"fontFamily": "Nunito Sans"
345+
},
313346
".stk-subtitle": {
314347
"fontFamily": "Nunito Sans"
315348
},
316-
"p": {
349+
".stk-button__inner-text": {
317350
"fontFamily": "Nunito Sans"
318351
}
319352
}

src/plugins/global-settings/typography/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ const TYPOGRAPHY_TAGS = [
5757
label: sprintf( __( 'Heading %d', i18n ), 6 ),
5858
selector: 'h6',
5959
},
60+
{
61+
label: __( 'Body Text', i18n ),
62+
selector: 'p',
63+
},
6064
{
6165
label: __( 'Subtitle', i18n ),
6266
selector: '.stk-subtitle',
@@ -66,8 +70,8 @@ const TYPOGRAPHY_TAGS = [
6670
</> ),
6771
},
6872
{
69-
label: __( 'Body Text', i18n ),
70-
selector: 'p',
73+
label: __( 'Button', i18n ),
74+
selector: '.stk-button__inner-text',
7175
},
7276
]
7377

src/util/typography/font-sizes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ let fontSizes = {}
4343
* Fills up the fontSizes with font sizes.
4444
*/
4545
const initFontSizes = () => {
46-
const SELECTORS = [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', '.stk-subtitle' ]
46+
const SELECTORS = [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', '.stk-subtitle', '.stk-button__inner-text' ]
4747
fontSizes = {
4848
...getFontSizes( SELECTORS ),
4949
}

0 commit comments

Comments
 (0)