5t3ph / 5t3ph/a11y-color-tokens

hex color beginning with a 4 is not valid

Offen
#1 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
162
Forks
5
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I've been having an issue when attempting to build my color palette. I'm using hex color codes in my `tokens.js` file, and when I try to build, I get the following:

`Error: Foreground and Background must be a valid CSS colour`

It took me a while of adding and removing lines in my `tokens.js` and my package scripts to realize that the issue was when one of the colors' hex codes began with a **4**. I tried several different formats of the same color, e.g. `hsla` or `rgb` works fine. It's only when the color code begins with **4**.

Steps to reproduce, once the package is installed:
1. create a `tokens.js` file under `./source/_scss/colors`
2. add a name/color pair where the color code begins with a 4, e.g. `#40ffff`
3. run `npx a11y-color-tokens --outputDirPath='./source/_scss/colors --colorTokensPath='./source/_scss/colors/tokens.js'`

My `tokens.js` file is like this:
```
module.exports = [
{
name: 'blue',
color: '#40ffff'
}
];

```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.