Issue #2861Opened June 28, 2020by makkaronis4e3 reactions

[HELP] Get css of selected component and its children

Question

Hi,

i'm trying to implement possibility to save elements as custom blocks. How can i get css of component and its children? I can recursively get styles from each nested component, but maybe there is a way, how it can be done easier?

Answers (2)

Ju99ernautJune 29, 20203 reactions
const component = editor.getSelected();
let componentCss = editor.CodeManager.getCode(component,  'css', {
   cssc: editor.CssComposer
});
makkaronis4eJune 29, 20200 reactions

@Ju99ernaut thanks!

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.