Issue #523πŸ’¬ AnsweredOpened November 15, 2017by tldrjumps2 reactions

How to Export CSS linked in Canvas Styles properties

Quick answerby artf❀ 1

@chiqui3d definitely it shouldn't be added to what is used for storing otherwise you will add those styles twice.

Read full answer below ↓

Question

How to export the HTML/CSS in the code view / download as zip. With the stylesheets in styles.css referenced in the grapesjs canvas, but not the unused, actually i am fine with all the styles.css stylesheet, for simple API access for export. If I add the stylesheet in init Yea, Table πŸ˜‹ Thanks for the good work, let us worry about this easy issue and documenting or leave trace in issue list. Artf should focus more on other amazing features.

Answers (3)

artfβ€’ January 25, 2018

@chiqui3d definitely it shouldn't be added to what is used for storing otherwise you will add those styles twice.

artfβ€’ July 14, 2019

The issue I have is that when I try to export the code using the grapesjs export plugin nothing referenced inside canvas is exported. @Yakito For now, those scripts/styles should be included manually, you can use root option from the export plugin:

artfβ€’ November 15, 2017

Hi @tldrjumps I'm not sure if I properly got your problem. You can simply get all the CSS with editor.getCss(), which also tries to optimize it by removing classes without components. Styles inserted via canvas.styles option are just injected inside the canvas but actually, the editor doesn't see t...

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.