question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Safari ignores alpha channel in colors in `::marker`, which makes styling them with Tailwind impossible

See original GitHub issue

What version of Tailwind CSS are you using?

v3.1.2

What build tool (or framework if it abstracts the build tool) are you using?

`postcss`
module.exports = {
  plugins: {
    "postcss-import": {},
    "tailwindcss": {},
    "autoprefixer": {},
  }
}

What version of Node.js are you using?

v12.22.9

What browser are you using?

Safari 15.5 on macOS 12.4

Reproduction URL

https://play.tailwindcss.com/iea3Szbz1t

Describe your issue

On Safari, all of the following examples work correctly:

::marker {
  color: red;
}
::marker {
  color: #f00;
}
::marker {
  color: rgb(255 0 0);
}

But these are completely ignored:

::marker {
  color: rgba(255 0 0 50);
}
::marker {
  color: rgb(255 0 0 / 50);
}

I discovered this while playing with arbitrary variants, trying to lighten the ordinals in an ordered list. When that didn’t work, I thought, “that’s fine, I can just use an arbitrary value!” but turns out that [&::marker]:text-[#ff0000] gets translated to

.\[\&\:\:marker\]\:text-\[\#ff0000\]::marker {
  --tw-text-opacity: 1;
  color: rgb(255 0 0 / var(--tw-text-opacity));
}

Which makes it impossible to use Tailwind to style marker colors.

I realize this is more of a Safari bug than a Tailwind bug, but I’m curious as to why you’re translating a hardcoded [red] into an RGBA value, and whether that’s something that could be addressed to allow styling list markers with Tailwind 🤔

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
thecrypticacecommented, Jun 13, 2022

hah I already did that earlier today: https://bugs.webkit.org/show_bug.cgi?id=241566 — in any case appreciate it!

0reactions
focacommented, Jun 14, 2022

So you can work around this by disabling all of our color opacity utilities like this: … Those will end up being disabled by default in v4.

Oh, thanks! That’s a better workaround 😄

The problem is that custom properties are not supported because allowed properties in ::marker are whitelisted in webkit (correct): https://github.com/WebKit/WebKit/blob/fdc6c5fc1872fab62106b209c8a6a5aaa00730be/Source/WebCore/style/PropertyAllowlist.cpp

but they don’t include custom properties (incorrect). The spec doesn’t mention them though so it’s also possibly a CSS spec issue.

Nice find. Thanks! That makes sense.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Untitled - Snap!
1 insert one additional value into its correct position in a list that's already in ascending order. 1 1 de:ignoriere _ ca:ignora _...
Read more >
Untitled
3 phase color sequence, Mobil programlar indir java, Smart home energy solutions placentia, 1982 to 1985 toyota supra for sale, Vok cherry brandy...
Read more >
dictionary.txt
... alongside aloof aloofness aloud alpaca alpacas alpha alphabet alphabetical alphabetically alphabetize alphabetized alphabetizes alphabetizing alphabets ...
Read more >
dictionary.txt
... Alonzo Alonzo's Alpert Alpert's Alphard Alphard's Alphecca Alphecca's Alpheratz Alpheratz's Alphonse Alphonse's Alphonso Alphonso's Alpine Alpine's Alpo ...
Read more >
736 kB - Hugging Face
1 ·: 1 ·their 1 ·) 1 ·who 1 ·- 1 ·about 1 ·one 1 ·up 1 ·out 1 ·It 1 ·all 1...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found