GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.36k stars 4.05k forks source link

mm or cm Units are converted to px #3315

Closed devtechk closed 3 years ago

devtechk commented 3 years ago

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

Andrew-Chen-Wang commented 3 years ago

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.

Ju99ernaut commented 3 years ago

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'],
      // ...
   }
   // ...
});
devtechk commented 3 years ago

Thank you, I'll try this way. I'll update this post. I hope it'll work

devtechk commented 3 years ago

Sorry, but it's not working...

Ju99ernaut commented 3 years ago

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