Skip to content
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

hex color beginning with a 4 is not valid #1

Open
reedcodes opened this issue Nov 2, 2024 · 0 comments
Open

hex color beginning with a 4 is not valid #1

reedcodes opened this issue Nov 2, 2024 · 0 comments

Comments

@reedcodes
Copy link

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'
  }
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant