midzer / tobii

An accessible, open-source lightbox with no dependencies
https://midzer.github.io/tobii/demo/
MIT License
196 stars 20 forks source link

Improve em value scaling #105

Closed MoritzLost closed 1 year ago

MoritzLost commented 1 year ago
midzer commented 1 year ago

@viliusle Please review those changes, too. Then we are ready for next minor version.

midzer commented 1 year ago

@viliusle If you don't have time to review this, maybe @ocean90 can have a looksie?

MoritzLost commented 1 year ago

@viliusle @midzer The PR should be pretty close to the original. I used 1rem as the base value as this was already the case in the previous PR. However, I adjusted the em values to result in the same pixel values (based on the normal 16px base size) as in the original solution. For example, em(8) was originally replaced with 0.44444em, which would be result in around 7.1px. I changed that to 0.5em, which results in 8px, so it should be identical with the original. I rounded up in the same way for all other values, so the resulting pixel values should be identical to the original values.

For what it's worth, I think having 1rem as the base size is a very sensible default. The beauty of em is that everyone who wants to scale the entire UI can just use increase the $base-font-size (for example, to 1.125rem) and everything will scale along with it.

viliusle commented 1 year ago

We have a problem, but it is related only to this topic, not to this PR.

We can merge it. I am going to create separate issue,

p.s. I like em too, powerful feature.