You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/extensibility/theme-support.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,53 @@ Themes are responsible for creating the classes that apply the colors in differe
90
90
91
91
The class name is built appending 'has-', followed by the class name *using* kebab case and ending with the context name.
92
92
93
+
### Block Font Sizes:
94
+
95
+
Blocks may allow the user to configure the font sizes they use, e.g., the paragraph block. Gutenberg provides a default set of font sizes, but a theme can overwrite it and provide its own:
96
+
97
+
98
+
```php
99
+
add_theme_support( 'editor-font-sizes', array(
100
+
array(
101
+
'name' => __( 'extra small', 'themeLangDomain' ),
102
+
'shortName' => __( 'XS', 'themeLangDomain' ),
103
+
'size' => 8,
104
+
'slug' => 'extra-small'
105
+
),
106
+
array(
107
+
'name' => __( 'small', 'themeLangDomain' ),
108
+
'shortName' => __( 'S', 'themeLangDomain' ),
109
+
'size' => 12,
110
+
'slug' => 'small'
111
+
),
112
+
array(
113
+
'name' => __( 'regular', 'themeLangDomain' ),
114
+
'shortName' => __( 'M', 'themeLangDomain' ),
115
+
'size' => 16,
116
+
'slug' => 'regular'
117
+
),
118
+
array(
119
+
'name' => __( 'large', 'themeLangDomain' ),
120
+
'shortName' => __( 'L', 'themeLangDomain' ),
121
+
'size' => 36,
122
+
'slug' => 'large'
123
+
)
124
+
) );
125
+
```
126
+
127
+
The font sizes are rendered on the font size picker in the order themes provide them.
128
+
129
+
Themes are responsible for creating the classes that apply the correct font size styles.
130
+
The class name is built appending 'has-', followed by the font size name *using* kebab case and ending in -font-size.
131
+
132
+
As an example for the regular font size, a theme may provide the following class.
133
+
134
+
```css
135
+
.has-regular-font-size {
136
+
font-size: 16px;
137
+
}
138
+
```
139
+
93
140
### Disabling custom colors in block Color Palettes
94
141
95
142
By default, the color palette offered to blocks, allows the user to select a custom color different from the editor or theme default colors.
// Global deprecations which cannot otherwise be injected into known usage.
58
+
deprecated('class set is-small-text, ..., is-large-text',{
59
+
version: '3.5',
60
+
alternative: 'has-small-font-size, ..., has-large-font-size class set',
61
+
plugin: 'Gutenberg',
62
+
hint: 'If paragraphs using this classes are opened in the editor new classes are automatically applied the post just needs to be saved. This is a global warning, shown regardless of whether the classes are used in the current post.',
0 commit comments