Skip to content

Fix invalid use of rgba() with hex color codes#449

Open
sk8jp wants to merge 1 commit intoTarekRaafat:masterfrom
sk8jp:fix/rgba-hex-issue
Open

Fix invalid use of rgba() with hex color codes#449
sk8jp wants to merge 1 commit intoTarekRaafat:masterfrom
sk8jp:fix/rgba-hex-issue

Conversation

@sk8jp
Copy link
Copy Markdown

@sk8jp sk8jp commented Jul 26, 2025

Fix invalid use of rgba() with hex color codes

Summary

This pull request replaces the incorrect usage of rgba(#ffffff, 0) with the proper transparent keyword.

Details

The original code used the following CSS:

color: rgba(#ffffff, 0);
background-color: rgba(#ffffff, 0);

This syntax is invalid in standard CSS. While some CSS preprocessors like Sass may allow similar shorthand forms, using rgba() with a hex code as the first argument is not supported in standard CSS and may cause parsing issues or errors in certain environments.

Fix:

color: transparent;
background-color: transparent;

The keyword transparent is equivalent to rgba(0, 0, 0, 0) and is the most readable and widely compatible way to apply full transparency.

Benefits

  • Improves compatibility with standard CSS parsers
  • Avoids potential errors or misinterpretations in CSS tools
  • Enhances readability and maintainability of the code

Thank you for your work on this project!

@TarekRaafat
Copy link
Copy Markdown
Owner

Hello @sk8jp,

Good catch! You're right that rgba(#ffffff, 0) is invalid standard CSS and only works in preprocessors like Sass.

Two things to note on the current PR:

  1. The replacement lines are missing semicolons after transparent, which would introduce CSS syntax errors
  2. The changes are applied directly to the dist/ files, which would be overwritten on the next build. The fix needs to be applied to the source files instead

I have this on my radar and will be fixing it as part of the upcoming v11 release. I will be publishing the v11 release plan soon, so stay connected for updates.

Thanks for reporting this and for your contribution!

Have a nice day, cheers! :)

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

Successfully merging this pull request may close these issues.

2 participants