Issue #3004Opened September 5, 2020by Bakino0 reactions

QUESTION : custom style properties to change class

Question

Hi,

Thanks for this good editor.

In my project, I want to adjust classes of components using the style manager. For example, I am using bootstrap and I want the user to be able to apply classes such as bg-danger, bg-primary from a drop box instead of input the class name manually.

I am aware that I can do it using trait (and it works well) but it is more consistent that styling control goes in the style manager part (and also it is too much option to put in the traits part)

I saw that it is possible to add custom type in the style manager but it always to update a single CSS property. Is it possible to use this custom types to update class attribute of the component ?

Answers (2)

artfSeptember 10, 20200 reactions

There is an option which allows you to indicate which target to select (classes or component-specific style) https://github.com/artf/grapesjs/pull/2474 (in your case componentFirst should be disabled) Unfortunately, the selector manager's UI itself it's not easily customizable but I think you should be able to create one from scratch by relying on events and API

BakinoSeptember 10, 20200 reactions

thanks for your answer :)

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.