Vendor prefix getting removed when getting css from getCss()
Question
I am using the version: 0.14.57 with React 16.8.6.
When I use the function editor.getCss() it returns me the css but without the vendor prefix. For example, I add the following css .product-card { -webkit-transition: all 0.2s ease; transition: all 0.2s ease; } it returns me .product-card{ transition-duration:0.2s; transition-timing-function:ease; transition-delay:0s; transition-property:all; }. How can I avoid this behaviour and get what I am saving (with the prefix)? I checked this in the demo, it works fine there but with my local I am having an issue. Unfortunately I can't publish it else where and don't have it live atm. It's just this one, getCss() function that's causing the issue. Following is my initialization:
let editor = GrapesJs.init({
container: "#gjs",
fromElement: true,
plugins: [
'gjs-blocks-basic',
tUIImageEditor,
GrapeJSFormPlugin,
editor => FontAwesomePlugin(editor, {}),
editor => SocialMediaPlugin(editor, {}),
editor => VideoPlugin(editor, {})
],
canvas: {
styles: [
"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css",
"https://fonts.googleapis.com/css?family=" + fontFamilies,
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css"
],
scripts: [
"https://code.jquery.com/jquery-3.3.1.slim.min.js",
"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js",
"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js",
'https://use.fontawesome.com/145d2bb38b.js'
]
}
});
I'm applying the styles with editor.setStyles(css). It sets fine but when I retrieve it, it removes the prefix. Any help would be appreciated.
Answers (2)
Worked like a charm @artf ! Thank you so much!
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3832
The css classes are removed and the autogenerated ids for each html tags gets changed ( Example : ivj5m-2) after each reload
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link Not there De...
Issue #1836
How to add !important in all the generated apis
Hello @artf, While i am going to edit some html from editor with the help of css then i need to add !important into all the css which is ch...
Issue #3627
[QUESTION]: I'm trying to duplicate the page, but the styles are not geting applied due to the Ids, changes to -2,-3 at the end.
This is what my function looks like. I am trying duplicate the page, the HTML part is fine but as css is applied through ids, when a new pa...
Issue #3218
How to add new HTML element with inline styles?
I would like to add a new HTML element, with inline styles, around the rte.selection(). With the following example, the HTML is OK, but pro...
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
GrapesJS vs Webflow vs Builder.io vs Puck: Which Visual Builder to Choose in 2026
A practitioner's 2026 comparison of GrapesJS, Webflow, Builder.io, and Puck — pricing, AI features, lock-in, and a one-line rule for picking the right one
Tutorial
GrapesJS vs Webflow vs Tilda (2026): Honest Comparison, Pricing & Which to Pick
GrapesJS vs Webflow vs Tilda compared head-to-head: real 2026 pricing, SEO features, code export, and which one actually fits your project
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.