mostafaznv / nova-ckeditor

CkEditor 5 Field for Laravel Nova with Media & Snippet Browsers
https://mostafaznv.gitbook.io/nova-ckeditor/
MIT License
49 stars 20 forks source link

line-height #120

Closed Brand3000 closed 4 months ago

Brand3000 commented 4 months ago

Hi! I'm sorry if I've missed something in the documentation, but I'm wondering if there's an opportunity for adding the line-height tool into the toolbar?

mostafaznv commented 4 months ago

Hi @Brand3000,

As far as I know, there isn't a specific tool in the CKEditor5 toolbar items for line-height. However, you can achieve a similar effect by combining the fontSize tool with line-height. (And I think it might be reasonable, considering that most frameworks provide typography utility classes that include font-size, font-weight, and line-height).

When you add a font-size to the fontSize list, CKEditor adds a class to the text based on the font-size name (e.g., text-big for big). You can leverage this to set the line-height for each text in your CSS styles.

https://github.com/mostafaznv/nova-ckeditor/blob/e2b3e62a485e77aea8b4889320269090b1d5b33f/config/nova-ckeditor.php#L269-L277