Issue #5249Opened July 24, 2023by pittleCheung0 reactions

BUG: editor?.Css.addRules(targetCss);

Question

GrapesJS version

  • I confirm to use the latest version of GrapesJS

What browser are you using?

latest version of Chrome

Reproducible demo link

null

Describe the bug

How to reproduce the bug?

editor?.Css.addRules(targetCss);

What is the expected behavior?

editor?.Css.addRules(targetCss); it add style at end <img width="826" alt="image" src="https://github.com/GrapesJS/grapesjs/assets/114127651/28425b0a-b9f7-46a8-b8bc-736aa112cc3c">

What is the current behavior?

I help editor?.Css.addRules(targetCss,{at : 0});

I want to add a style to the beginning of an array instead of the end. ...

If is necessary to execute some code in order to reproduce the bug, paste it here below:

// your code here

Code of Conduct

  • I agree to follow this project's Code of Conduct

Answers (2)

artfJuly 25, 20230 reactions

This is not a bug, Css.addRules doesn't have any option argument. You can open a discussion in regard to this topic and we can see if it makes sense to introduce it

pittleCheungJuly 26, 20230 reactions

ok, I get it,I need to add some styles in front of an array, not at the end. such as arr.unshift(css) How can I do that? I might need a little help from you

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.