Setting of default value for css property in StyleManager config does not affect style of new added block?
Hi @angyLe the style manager just builds properties, in a kind of "blind-way", and some of their properties don't affect directly the target (component/rule). In this case the defaults it's more like a hint to show to the user when the property has no value. For this reason, from a practical point of view, you have to...
Read full answer below βQuestion
I have a question. When css property is added to StyleManager configuration, for example I added color and set defaults to green (just for test):
name: 'Typography', open: false, buildProps: ['color'], properties:[{ name: 'Font color', property: 'color', defaults: "green"}, β¦
Looks like it does not affect text color of new added blocks? I dropped text block to canvas - text color is black. When I open style manager panel, i see that color is set to green. The same is with other properties I tried (width, height).
Answers (3)
Hi @angyLe the style manager just builds properties, in a kind of "blind-way", and some of their properties don't affect directly the target (component/rule). In this case the defaults it's more like a hint to show to the user when the property has no value. For this reason, from a practical point...
I didn't want to make properties different then in specification. I just wanted to set default value for existing properties. For example i want that width of the text box will be 100px, so when it is added to canvas it will be 100px . I thought than i can configure it in StyleManager by setting de...
@artf I'm sorry, I couldn't understand your answer (@angyLe and I work together on implementing grapesjs in our system, so I know what the question was). When I read your answer, it is my understanding that you are saying the following: 1) default values for properties are not immediately applied t...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2586
[Question]: How update style manager panel using few devices and custom css class
There is a custom class added to simple grapesjs project: If there is no devices and user adds the class into the selectors field Settings...
Issue #3294
FEAT: Adding options to properties list array in style manager
Hi, How can I add buildProps to properties list such that when an option is selected, the properties of that option will be displayed An ex...
Issue #3525
FEAT: In Style Manager, Allow Requiring the Default Setting
What are you trying to add to GrapesJS? The CSS property float only makes sense for position: static; elements, which happens to be the def...
Issue #2951
typography sector not found
When using trying to add a font to the style manager, I use the following code: const prop = editor.StyleManager.getProperty('typography',...
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 βBrowse Plugin Categories
Jump directly to plugin category pages on the marketplace.