Skip to content

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

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

Merged
merged 1 commit into from
Jun 13, 2025

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