amzn / style-dictionary

A build system for creating cross-platform styles.
https://styledictionary.com
Apache License 2.0
3.87k stars 543 forks source link

Add test for hsl alpha in attribute/color #954

Open germain-gg opened 1 year ago

germain-gg commented 1 year ago

Issue #, if available: N/A

Description of changes:

Fixing attribute/color so that it work with hsl() colors that have an alpha channel.

The issue lies with tinycolor2 that does not recognise that syntax and fixes the alpha to 1 if hsl() is used. According to the CSS spec, you can specify a fourth argument, so both hsl and hsla should work.

Creating this PR as a draft and I will mark it as ready once https://github.com/bgrins/TinyColor/pull/269 lands


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.