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)
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.
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?
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.
Issue #1877
[FEATURE REQUEST] Custom styles that add/remove custom classes?
Currently, all the style manager values that you change for an element simply update a <style> tag inline in the HTML. Is it possible to ch...
Issue #3171
Adding / Updating href trait does not add `<a></a>` wrapper to image.
Expected Behavior - when I update href trait value, the image should be wrapped inside a with href value set. i.e. <a href="google.com"><im...
Issue #2706
[QUESTION] Unique ID on block content without inline style
Hi All, I made a custom block manager element, but when the element is edited, it applies the style to the class, which means all the same...
Issue #1904
Get change in property float
I'm trying to listen to the change in the 'float' property whether it was shifted to the 'left' or 'right' or 'none' in Style Manager using...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.