I was given a Figma design of a webpage. The Figma page width was 1825px. The width of my laptop is 1080px. Suppose a text in Figma page has font-size 20px. How do I convert it to my laptop so that the ratio is maintained? I can't use a percentage because I'm using flexbox. And when I try using percentage what it does is takes the percentage of its parent container rather than the entire body.
I also tried using VW. Calculated the view width based on the 1825px breakpoint and implemented that. The issue is that the pixels are getting distorted in this approach. Also, This answer Typography using VW got lots of upvotes means VW works, Then why am I facing the issue?
I'm using react and I don't want any javascript solution. Is there any way to solve this using CSS only?
,
,
etc whic used different font-size.
– era s'q Oct 21 '20 at 07:33` tags with different font-size, then you need to specify selectors for each different `
`. For example, `
`, `
` etc. and different font-size for `.p-medium`, `.p-big` in css.
– fromaline Oct 21 '20 at 07:43