Issue #3252Opened January 28, 2021by ThetripGr0 reactions

Does getHtml() remove the inline style property?

Question

I was fiddling with ways that you could change the style of elements inside the canvas and i noticed that by using the color-picker trait to set the inline style color property of the element (not the inline style tag that you get through the getCS() ), that style property was completely gone when getHtml() was used.I noticed there was a property avoidInlineStyle that was deprecated looking in the issues. If so why is that the behaviour and why isn't this an option anymore? I would like to save my css where specifically needed inlined and not have an extra style tag and all these unique ids bloating the html as i am not utilizing the style manager. Is this in any way feasible?

Answers (3)

artfFebruary 11, 20210 reactions

Hi @DodoTrip the reason is that with inline CSS you can't define styles with states (eg. :hover) and media queries, so I've always seen it as a useless limitation instead of a feature. Despite that, you can still use that option if you don't need your components to be responsive or to have different states.

ThetripGrFebruary 11, 20210 reactions

Hi @artf and thank you, for your reply. Mind giving me an example on how it is done right now or should avoidInlineStyle make it work easily?

artfFebruary 19, 20210 reactions

Honestly, I've stopped using avoidInlineStyle a long time ago, but I guess it should work 😁

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.