Skip to content

feat: use commas instead of slash for css color opacity modifiers#1514

Merged
cossssmin merged 1 commit intomasterfrom
css-functional-notation
Jun 13, 2025
Merged

feat: use commas instead of slash for css color opacity modifiers#1514
cossssmin merged 1 commit intomasterfrom
css-functional-notation

Conversation

@cossssmin
Copy link
Member

@cossssmin cossssmin commented Jun 13, 2025

This PR adds support for Tailwind CSS opacity modifiers like bg-black/80 or text-white/40 in email clients such as Gmail, where forward slashes are not supported currently. In the particular case of Gmail, this results in the entire style attribute or tag being discarded.

We use postcss-color-functional-notation to convert CSS color values containing / to their ,-based equivalents:

<style>
  .bg-black\/80 {
-    background-color: rgb(0 0 1 / 0.8);
+    background-color: rgba(0, 0, 1, 0.8);
  }
  .text-white\/20 {
-    color: rgb(255 255 254 / 0.2);
+    color: rgba(255, 255, 254, 0.2);
  }
</style>

slashes are not supported currently in Gmail, resulting in the entire style attribute or tag being discarded
@cossssmin cossssmin merged commit 9ec5f33 into master Jun 13, 2025
3 checks passed
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.

1 participant