Adds toolbar and context buttons for inline font size. Applies font-size as a <span> style on the selected text, or maps sizes to CSS classes when classes is set.
Select text, click Text size in the toolbar (before More), and pick a size from the dropdown. Use Remove text size to clear formatting.
<script src="/assets/redactor/redactor.js"></script>
<script src="/assets/redactor/plugins/font-size/font-size.js"></script>
const app = Redactor('#entry', {
plugins: ['fontSize']
});
string[] | false)
falsefalse uses the built-in list: 10px through 30px (see FontSizePlugin.DEFAULT_SIZES).string[] | false)
false<span> instead of an inline font-size style.string)
Redactor('#entry', {
plugins: ['fontSize'],
fontSize: {
items: ['12px', '14px', '16px', '18px', '24px']
}
});
en: {
fontSize: {
title: 'Text size',
remove: 'Remove text size'
}
}
This plugin does not emit events.
Applies font size formatting to the current selection and closes the dropdown. Pass the same params object used by app.inline.set.
app.fontSize.set({ tag: 'span', styles: { 'font-size': '20px' } });
Clears inline font size (or size classes in class mode) from the selection and closes the dropdown.
app.fontSize.remove();