mostafaznv / nova-ckeditor

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

Custom CSS (Feature Request) #25

Closed pschultheiss closed 2 years ago

pschultheiss commented 2 years ago

This is a great plugin, thanks so much for creating it.

It would be super helpful to allow the developer to link to a custom CSS file because the default leaves much to be desired - Headings are small and bullets don't show up. I'll post a screenshot of my old (non Nova) admin that uses CKEditor and the new one as an example.

Here's a link to the documentation: https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-contentsCss

Ideally, the developer could edit the config file like so...

    /*
     |--------------------------------------------------------------------------
     | Custom CSS
     |--------------------------------------------------------------------------
     |
     | Specifies the path of your custom CSS
     |
     */
    'contentsCss' => '/css/app.css',

Legacy CKEditor (uses custom CSS)

image

Nova CKEditor (no custom CSS)

image

mostafaznv commented 2 years ago

Hi @pschultheiss

You can add custom css files to nova. Just open NovaServiceProvider and put this code into boot method:

 Nova::style('custom', public_path('css/custom.css'));
pschultheiss commented 2 years ago

True. When added to Nova, it appears that the custom CSS is loaded before the other tool styles. But I can work with this to achieve the desired result. Thanks for the quick response!

image

mostafaznv commented 2 years ago

Glad to hear that. Feel free to reopen this issue, if your problem didn't resolve.