-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Refactor triangle to use calc() #616
base: main
Are you sure you want to change the base?
Refactor triangle to use calc() #616
Conversation
@@ -1,4 +1,4 @@ | |||
#!/bin/sh | |||
. "$(dirname "$0")/_/husky.sh" | |||
|
|||
lint-staged --debug | |||
yarn lint-staged --debug |
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 can omit this. But I thought it odd that the repo requires lint-staged
be installed globally when it's a dependency of the project.
@@ -267,7 +267,7 @@ describe('triangle', () => { | |||
) | |||
}) | |||
|
|||
it('should throw an error when height or width is not a unit based value.', () => { | |||
it.skip('should throw an error when height or width is not a unit based 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.
Q for the reviewer, do we want to keep this check, but then also explicitly check for a value starting with var(--
?
Codecov Report
@@ Coverage Diff @@
## main #616 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 89 89
Lines 860 858 -2
Branches 323 320 -3
=========================================
- Hits 860 858 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
triangle()
currently expects height and width values that are a string value with a unit (e.g.'12px'
) or a number (12
). It throws an error otherwise.This prevents the use of CSS custom variables. However, if we change from using JS arithmetic to CSS
calc()
, we can support CSS variables, in addition to number of unit values, without having to do any unit stripping in strings.