Issue #444✓ SolvedOpened October 23, 2017by ronaldaug6 reactions

How to load css link into the head tag?

Quick answerby artf4

You were almost there :)

Read full answer below ↓

Question

Hello, First of all, thanks for contributing such an amazing js framework. I am very new to grapesjs. And github too. https://github.com/artf/grapesjs/wiki/Components-&-JS#template-related According to grapesjs wiki, I load js links inside the canvas as the above codes and it works fine. But when I try with css links like this, it doesn't work. Some people here suggest to add those CSS links directly under the id="gjs". I did it but what happen is if I clean the canvas, it also clean my css links and CSS doesn't work anymore. My question is how can I load CSS link into the head tag?

Answers (3)

👍 Most helpfulartfOctober 23, 2017

You were almost there :)

canvas: {
    styles: ['https://...'] 
}
ronaldaugOctober 23, 2017

Thank you so much @artf , it works like a charm.

coder-strangeNovember 19, 2018

You have to include separately while rendering, it won't come in getHtml() or anything.

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 →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.