Issue #2990πŸ’¬ AnsweredOpened September 1, 2020by Joshmamroud0 reactions

Is there a way to use different variations of the same style property?

Quick answerby Ju99ernaut

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)

Ju99ernautβ€’ September 5, 2020

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

artfβ€’ September 8, 2020

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.

Joshmamroudβ€’ September 8, 2020

@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.

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

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.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.