Issue #2454πŸ’¬ AnsweredOpened Dec 12, 2019by ghost0 reactions

Setting border radius with an 'em' value.

Quick answerby artf

How do you init/update the Style Manager?

Read full answer below ↓

Question

Hi

I am trying to use grapesjs for a project that needs to scale to the display. I have things like margins and fonts doing it fine but I want to only let the user specify border radius in em units so the they will scale too.

This would required the options for the units in the various border radius inputs to include 'em' as an option. I have managed to change the unit list for font size (removing all but em) but I can't seem to do it for the radius.

Has anyone achieved this already and can share this with me?

thanks

Darren B.

Answers (3)

artfβ€’ Dec 14, 2019

How do you init/update the Style Manager?

ghostβ€’ Dec 15, 2019

Hi . like this (for the fonts) editor.on('load', function () { .... styleManager = editor.StyleManager; fontSize = styleManager.getProperty('typography', 'font-size'); units = ["em"]; fontSize.set('units', units); styleManager.render(); .... } In the above case, I want em as the only size option. I...

artfβ€’ Dec 17, 2019

Ok, if you're updating via API you can do this:

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.