This repository was archived by the owner on Nov 3, 2022. It is now read-only.
Open
Conversation
This reverts commit 3c64ba4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses the issue submitted in the colors repo: IBM-Design/colors#53
Problem
The assumption is that if I use the color function without a grade argument, I should get the core grade of the color I am requesting:
The default value for the
$gradeparameter in thecolor()function is set to0which currently no color has this as a possible grade. Updating the default$gradevalue to a number that does in fact exist in all palettes doesn't work because each color has a different core grade associated with it.Solution
The solution I have come up with is to add one more grade item to each color map in the output
_bee-palette.scsswith the key ofcoreand value of whatever that palette's core grade hex value is. This way we can set the default value for$gradein thecolor()function to'core'and fulfill the expected behavior of calling thecolor()function without supplying a grade.Along with this solutions, I took the liberty to:
.ase,.json, and.scloutput templates to include the core grade value.color()function to throw an error if the user provides a color or grade that does not exist as well as a warning if they're outside of the$alphachannel value range.color()function using True and Mocha! Sadly, I don't think there is a way to test for errors which would have been nice.