Issue #1232💬 AnsweredOpened June 25, 2018by Deepak8130 reactions

How to change the margin from px to rem

Quick answerby artf

Please @Deepak813... follow the template of the issue, provide a demo and steps to reproduce

Read full answer below ↓

Question

Hi @artf,

Hope you are doing fine.

I have changed the margin settings from "px" to "rem" in one of the element using below code:

{
property : 'margin-top',
name: 'Top Margin', 
units : ['rem'], 
type: 'integer', 
}

but when i re-assign the same margin setting to element after save then its multiplies the margin with 16x px i.e means the "rem" is converted into "px" and element gets disapper.

Please let us know how we can change the "px" settings to "rem" settings in all the elements of the grapesJs.

Hope for the positive response. Thanks Artf.

Answers (2)

artfJune 28, 2018

Please @Deepak813... follow the template of the issue, provide a demo and steps to reproduce

lock[bot]September 17, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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 →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.