Issue #3315Opened March 5, 2021by devtechk3 reactions

mm or cm Units are converted to px

Question

I realized that mm or cm units are converted to px. How can i solve this problem? Thank you image

Answers (3)

Ju99ernautMarch 12, 20212 reactions

Did you add mm, cm etc, as units to the style manager inputs, these are not built in

Ju99ernautMarch 6, 20211 reactions

As stated above it's what the browser engine does, usually this is the fix, but I've never used it with units that aren't built in:

window.editor = grapesjs.init({
   // ...
   styleManager: {
      // ...
      avoidComputed: ['width', 'height', 'padding', 'margin'],
      // ...
   }
   // ...
});
Andrew-Chen-WangMarch 5, 20210 reactions

I think that's just what the browser engine does in general. I'm no expert, but I think that output is just the final info interpreted by the engine.

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

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.