SetStyle
Question
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? chrome latest versionReproducible demo link none as it has way too much custom code with react and things like thatDescribe the bug How to reproduce the bug? add more styles to editor with setStyles here is the string that I had in setStyles What is the expected behavior? add multiple styles to the editor What is the current behavior? add only the ones that are child so it's even stranger so for the moment it adds only those ones If is necessary to execute some code in order to reproduce the bug, pa...
Answers (4)
and when I try to add this it only adds this
@bovealexandre provide at least a minimal reproducible example as from what I can see right now it might be your custom code the reason
@bovealexandre provide at least a minimal reproducible example as from what I can see right now it might be your custom code the reason
ok I just had to editor.getCss({ keepUnusedStyles: true } on my scss editor
Thanks for reporting this, @bovealexandre. Great question about setStyle. The recommended approach with StyleManager is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listener method Most operations can be achieved by liste...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #6318
Unable to use transparent fill in Block media svg
GrapesJS version[X] I confirm to use the latest version of [email protected] when this issue was filedWhat browser are you using? Fir...
Issue #6152
CSS added via custom code persists after custom code component is removed
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? any Reproducible demo link https://grapesj...
Issue #4792
Drag and drop broken in 20.2
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome v108Reproducible demo link see belowD...
Issue #4601
Update() of custom types added to StyleManager is no more triggered when switching between some targets.
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chromium 104 Reproducible demo link https:...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins โ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.
Tutorial
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Tutorial
Big Updates: TinyMCE 8 and Placeholder 2.0 for GrapesJS
In May we shipped major updates to two of our most popular GrapesJS plugins โ TinyMCE Inline Text Editor and Placeholder.
Tutorial
Find the Right GrapesJS Plugin in Seconds: Smarter Discovery Is Live
We're shipping a set of discovery upgrades. New label filters, a proper compatibility switch for GrapesJS vs Studio, one-click and a smarter sort bar.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.