Hi all!
As I know 1.5 rem is 24px but at shopify dawn template it seems 15px
I think it’s related to font size scale but how can I resolve this?
I want to get real sizes.
Thanks.
Hi all!
As I know 1.5 rem is 24px but at shopify dawn template it seems 15px
I think it’s related to font size scale but how can I resolve this?
I want to get real sizes.
Thanks.
Hi @onderakbulut ,
1 rem is equivalent to a pixel value that will depend on the font size applied at that time. However, typically, 1 rem is equivalent to the pixel value of the font size of the root element (usually the element).
If the font size of the root element is 24px, 1 rem will be equal to 24px. However, if the root element’s font size is set to 15px, then 1 rem will equal 15px.
To check how many px 1 rem is equal to, you can go to the console window and copy this code into:
var htmlElement = document.getElementsByTagName('html')[0];
var computedFontSize = window.getComputedStyle(htmlElement).fontSize;
console.log(computedFontSize);
For example, my page is printing 10px, meaning 1rem = 10px