Is there a way to use different variations of the same style property?
I don't think that's possible using the API, also does text-align work for non-text components? You'll probably want to use the align-content property from flexbox
Read full answer below βQuestion
Note: This is in the context of the Style Manager. Is there a way to use different variations of the same style property? For example when I use the text-align property on a non-text node component I'd like the label to read "Align Content" with the options of "left", "right" and "center". However, when the "text-align" property is displayed for a text node I'd like the label to read "Align Text" with the options of "left", "right", "center", and "justify". I've searched the documentation and issues on GitHub and can't seem to find any answers. Does anyone know how to achieve this? Thanks in...
Answers (3)
I don't think that's possible using the API, also does text-align work for non-text components? You'll probably want to use the align-content property from flexbox
You should try to use Component's stylable-require property to show the particular style property (marked with toRequire) and unstylable for the one you don't need.
@artf Thank you for your response. In this case, I would still have an issue using the align-content property with flex columns and rows. For columns, I'd like the options to read: Top, Center, and Bottom and for rows I'd like the options to read: Left, Center, and Right. My users aren't too famili...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1428
[Question] Define or hide properties for specific components
Hi, I'm wondering if there is the possibility to define properties for specific components. I mean, when I select the component Image I wou...
Issue #1709
[QUESTION] Is it possible to affect child component's styling through parent component's style manager?
Hello there! Awesome project and thanks for your contribution. I would like to know if it is possible to change the styling of a child comp...
Issue #2404
Question: how to observe children changes in component
Is there an easy way to subscribe/listen to changes in the components/children of my custom component type? Perhaps an event I can subscrib...
Issue #3541
[QUESTION] What is the idiomatic way to append and remove classes from components?
Hey there π Love the editor! We're using traits to modify what classes a component has, but that feels a bit hacky as you have to redeclar...
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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.