Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork772
Add support forrem values in gap and peek#599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
krmax44 commentedMar 28, 2022
hey@jedrzejchalubek, do you have some time to review/merge this? |
| *@param {Glide} glide | ||
| *@returns {Number} | ||
| */ | ||
| exportfunctiontoPx(value){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think this logic here can be simplified following way:
exportfunctiontoPx(value){if(value.endsWith('rem')){const{ fontSize}=window.getComputedStyle(document.documentElement)returntoInt(int*toFloat(fontSize))}returntoInt(value)}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Other than that looks LGTM :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@jedrzejchalubek Sorry for getting back so late! This would unfortunately cause an error whenevervalue is not astring, though.
This allows the use of relative sizes with
reminpeekandgapinstead of just pixel units.