CSS Isolation
Concept
See if it's possible to use client-side JS to proxy the styling of Webflow's RTEs ( RTB sub-elements ), so that they are CSS-isolated.
Problem;
Webflow broadly selects RTBs in the CSS as e.g.
.my-richtext p
This means that any
p
element embedded by script or Embed in the RTB will be affected by that styingThis breaks the ability to embed components, forms, CTAs, call-outs, etc easily
Especially as none of this can be seen in the designer
Possible Solution;
Generate new classes based on the existing styling, affix e.g.
_mutated
to the classWrite this to a Style block
Assign the mutated class name to all of the desired RTE's in the RTB
? Avoid Embeds
Mutated CSS gen concept;
Dislikes;
Will pick up everything in the computed style, including inherited styles. If those are changed e.g. css vars...
Last updated