Issue #3116Opened November 6, 2020by aadilmehrajbhat1 reactions

[HELP WANTED] How to load css that can viewed in code viewer and also exported while saving

Question

Hi :wave:

I am trying to load some CSS within the editor as part of the theme, I am able to link stylesheets as part of loading but the problem that I am facing is when loading the styles directly using <style> tag, I am able to view the serialized version via editor.getStyle() but editor.getCss() only contains the protectedCss.

I am confused about how the CSS styles are added within the template style css property when exporting or viewing within code viewer, also how to manipulate the CSS rules that are not component specific but generally.

I tried to dig more in the docs especially inCssComposer and CssRule but unfortunately couldn't find much luck there.

I have added a codepen link to demonstrate the issue I am facing. https://codepen.io/aadilmehrajbhat/pen/GRqBdQY

Thanks

Answers (1)

artfNovember 9, 20201 reactions

@AadilMehrajBhat First of all, display: 'block' is not a valid CSS value for that property (it should be display: block) and then .d-block is not used anywhere in your template so the result is automatically optimized by removing unused styles

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.