Search code examples
csssitecorerich-text-editor

Separated .css file for Sitecore Rich Text Editor


I'm trying to use custom styles in Sitecore Rich Text Editor. I have found article, which describes how to do it, but I have to place my styles in default.css file. I would like to add my custom styles in separated .css file to avoid potential issues (for example, overwriting default .css file on upgrading version and so on). Is there way to use default.css and custom.css files at once?


Solution

  • You can use @import rule: https://developer.mozilla.org/en/docs/Web/CSS/@import

    The only thing you need to do is to add this line at the beginning of your default.css file:

    @import 'customStyles.css';
    

    It's still a change in default.css but only one and if you upgrade, you will notice that your custom styles are no longer there so you will remember to add this @import customStyle.css line to the new default.css file.