Issue #2238💬 AnsweredOpened September 2, 2019by abozhinov1 reactions

How to get style for header & footer components only

Quick answerby abozhinov1

I don't see a problem with media queries. The rules are detected by selector and everything works fine. I add class and set style only for mobile and it works.

Read full answer below ↓

Question

Hi @artf, can you please tell me what is the fastest and easies way to extract component styles.

I have template and in this template you can edit part of header, footer and add content between them. I don't store the whole template just the content in the middle, header & footer. component structure is easy I loop the JSON and get the components.

I want to separate the style of the header & footer from the style of the page. How to do that?

Regards, Alex

Answers (3)

abozhinovSeptember 7, 2019

I don't see a problem with media queries. The rules are detected by selector and everything works fine. I add class and set style only for mobile and it works.

artfSeptember 5, 2019

Yeah, styles are in a different container (editor.CssComposer.getAll()) so it's a bit harder and there is no API for extracting all matching styles. What I'd suggest doing something like this BTW this is not a final solution, definitely, you'd need to handle also rules with media queries, so take i...

abozhinovSeptember 7, 2019

@artf, 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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.