[Bug]: adding css variables as style manager property
Question
trying to add css variable to style manager causing error:
Uncaught TypeError: Cannot read property 'toUpperCase' of undefined fiddle
editor.StyleManager.addSector('test', {
name: 'My Vars',
open: true,
properties: [{
type: 'integer',
property: '--my-var',
}],
})
Am i doing something wrong?
Fixed by changing utils/mixins.js#L76 to
const camelCase = value => {
const values = value.split('-').filter(v=>!!v);
Answers (3)
Hi @gcoda you should use property for the CSS property name (eg. color)
Yes, it works with regular properties like color, is there another way to edit css custom properties on components?
is there another way to edit css custom properties on components?
Well, not currently, the style manager was made to edit style properties and not CSS custom one, but they have a lot in common
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1830
[Bug]: StyleManager properties without "property" defined cause an error on component selection
When using a StyleManager property where "property" is not defined, and defaults to '', I'm seeing an error on component selection: "TypeEr...
Issue #1520
[Bug] On this.components() Error : Uncaught TypeError: Cannot read property 'each' of undefined
Get below error for this.components() not sure if it is bug or I am doing something wrong. Uncaught TypeError: Cannot read property 'each'...
Issue #439
unstable
In my machine grapesjs is unstable. Generally at first request throws below error. After refreshing one or two times, it works. Bug exists...
Issue #1033
[BUG]: When IDs are used, it's not possible to update or remove a style
Steps to reproducehttps://jsfiddle.net/1cjjr02p/Click the text in editor, change background colour.Export CSS. You'll see both new and orig...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.