Replies: 3 comments
-
|
I'm not exactly understanding your question, but this can be transposed to Tailwind classes as follows: <div class="text-transparent text-shadow-green-600 text-shadow-[0_0_0]">
👣
</div> |
Beta Was this translation helpful? Give feedback.
-
|
No, The technique from that article relies on <span class="bg-green-500 bg-clip-text text-transparent text-4xl">
👣
</span>The relevant Tailwind classes:
Important caveat: this technique has mixed results with emojis specifically. Modern OS emoji renderers (Apple, Google, Windows) display emojis as full-color bitmap/SVG images, not as text glyphs. The It works reliably on:
If you need consistent colored emojis cross-browser, consider using an SVG icon library (like Heroicons, Phosphor, etc.) instead of Unicode emojis — those are actual paths that respect CSS color properties. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @ajl20! To answer your specific question: No, color: transparent is NOT equivalent to opacity-0. opacity-0 will hide the entire emoji (it becomes invisible). color: transparent makes the font color invisible but allows the background-clip: text trick to work so you can see the background color/gradient through the emoji. Here is the Tailwind CSS way to achieve the 'Green Footprints' effect using the technique from the article: Breakdown of the Tailwind classes:
Pro-tip for Gradients: Note: This works best on macOS and iOS where emojis are treated more like fonts. On some Windows browsers, the emoji might still show its default colors depending on the system font rendering. Hope this helps you get those green footprints working! Let me know if you have any other questions. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Trying to change the colour of the 'footprints' emoji using Tailwind CSS. I am trying to use the first approach described in 'Adding color to an emoji using different CSS techniques' https://barrd.dev/article/adding-colour-to-an-emoji-using-different-css-techniques/.
I have tested that the CSS approach works:
GreenEmoji.html
Is setting
color: transparent
in CSS equivalent to setting opacity to zero in Tailwind CSS?
Thanks,
ajl20
Beta Was this translation helpful? Give feedback.
All reactions