css-houdini icon indicating copy to clipboard operation
css-houdini copied to clipboard

(lines) Trim colors before using them (Safari bugfix)

Open bramus opened this issue 5 years ago • 1 comments

There's this issue in Safari where the lines code does not play nice with colors when they are referred to by their name.

Will work:

--lines-colors: #f94144, #f3722c, #f8961e;

Won't work:

--lines-colors: red, green, blue;

Safari only seems to correctly apply the first color:

Screenshot 2020-12-11 at 10 06 20

(You can also see this in the demo that's currently on houdini.how, where the colors are set to gold, plum, skyblue — only gold will be drawn)

The problem has to do with whitespaces: Safari apparently can't handle " green" (note the extra space).

This PR adds a small addition to the code so that it trims each color that's being parsed. That way " green" will become "green".

With the fix applied, Safari handles it just fine:

Screenshot 2020-12-11 at 10 06 35

bramus avatar Dec 11 '20 09:12 bramus

Hah, should've checked the issue list first … duplicate of #5.

¯_(ツ)_/¯

bramus avatar Dec 11 '20 09:12 bramus