Defaulting Style Manager values to em or %
Here you go, I hope it illustrates what I am trying to do https://codepen.io/ksn-systems/pen/LYNzdje thanks
Read full answer below ↓Question
Version 16.17
Are you able to reproduce the bug from the demo?
[ ] Yes [ ] No
What is the expected behavior?
I can set up the style manager so that I can present all units, the deafult unit and the value of and parameter that uses a size value (font-size, line height padding etc.)
Describe the bug detailed
When setting up the style manager to use only em and % for size related settings, whilst the units selector is changed, the value shown appears to me value x 16, so I set a value of 1 and it will result in a value of 16.
code:
const lineHeight = styleManager.getProperty('typography', 'line-height');
lineHeight.set('units', [
"",
"em"
]);
lineHeight.set('step', "0.1");
lineHeight.set('min', 0.1);
lineHeight.set('max', 100);
lineHeight.set('unit', "");
lineHeight.set('value', 1);
Here I would expect the line height to be set to 1 with a blank units value. but I get

**What is the current behavior?**
Whist the presets work, the resulting value as shown in the style manager is showing the 'px' value
**Are you able to attach screenshots, screencasts or a live demo?**
[ X] Yes (attach)
[ ] No
This has been driving me nuts for ages.
thanks and this is a great tool.Answers (3)
Here you go, I hope it illustrates what I am trying to do
https://codepen.io/ksn-systems/pen/LYNzdje
thanks
Hi @ksn-systems are you able to create a reproducible demo, please?
Same problem for me. I'm trying set to 20px the default font-size on editor load. Do you have a solution for this issue?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3125
linear-gradient CSS does weird things to background-image
Version: 0.16.27 Are you able to reproduce the bug from the demo? [x] Yes [ ] No What is the expected behavior? When adding background-imag...
Issue #2921
BUG: Autosave not working on style manager when classes are disabled
Version: 0.16.18 Are you able to reproduce the bug from the demo? [x ] Yes: https://jsfiddle.net/ju1a0onx/ What is the expected behavior? A...
Issue #3316
The editor does not remove the dead script blocks
Version: 0.16.34 Are you able to reproduce the bug from the demo? [ ] Yes [x ] No As I understand the code import dialog skips all the HTML...
Issue #3441
Parser breaks `mj-style` as of 16.30
Version: All Grapesjs version from 16.30 to now have this issues. Are you able to reproduce the bug from the demo?[x] Yes[ ] No What is the...
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.