Adds a block control button for font size and line height on text blocks. Available for paragraphs, headings, lists, code blocks, and wrappers.
Select a supported block, open the control dropdown, and choose Text size. Enter font size in pixels and line height as a unitless number or CSS value.
<script src="/assets/redactor/redactor.js"></script>
<script src="/assets/redactor/plugins/block-font-size/block-font-size.js"></script>
const app = Redactor('#entry', {
plugins: ['blockFontSize']
});
string)
Redactor('#entry', {
plugins: ['blockFontSize'],
blockFontSize: {
icon: '<svg...>'
}
});
en: {
blockFontSize: {
"text-size": "Text size",
"line-height": "Line height",
"eg": "e.g."
}
}
Emitted when the font-size form opens.
Payload: { block, data }
Return: { data } to override the initial form values.
app.on('blockFontSize:open:data', ({ block, data }) => {
if (!data.size) data.size = '18';
});
This plugin does not expose a public API.