-
Notifications
You must be signed in to change notification settings - Fork 5
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Add transform to handle opacity as percentage #100
Conversation
type: 'value', | ||
transitive: true, | ||
matcher: filter.isBaseOpacity, | ||
transformer: ({value}) => `${value / 100}`, |
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 always forget that JS is cool with doing math on string numbers.
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.
if it's only numbers, no letters lol
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.
Thanks for the fix, @RayRedGoose!
|
||
export const isBaseOpacity: Matcher = token => { | ||
const [level, category] = token.path; | ||
return level === 'base' && category === 'opacity' && parseFloat(token.value) > 1; |
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.
> 1
is a very smart safeguard. 👍🏼
Issue
Summary
PR adds transform to handle opacity as a percentage out of 100.
Release Category
Infrastructure