tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

Color / font size values are not recognized in some cases or are not recognized correctly

Open Serator opened this issue 1 year ago • 10 comments

What version of Tailwind CSS are you using?

v3.3.1

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

play.tailwindcss.com

What browser are you using?

Chrome

What operating system are you using?

Windows

Reproduction URL

https://play.tailwindcss.com/GFT8QOeZfA

Describe your issue

image

The example at the link has several dozen tests, of which the red ones seem to me to work incorrectly, and the green ones to work correctly. This is far from complete coverage, but only reflects the cases I have encountered.

Serator avatar Apr 20 '23 14:04 Serator

Please refer to the relevant documentation or sources for the most accurate and up-to-date information. PaybyPlateMa Invoice

kkianning1 avatar May 30 '23 08:05 kkianning1

Potential related Issues / PRs:

  • First letter selection color issue: This issue discusses a problem with the first letter selection color not working correctly in Tailwind CSS. It includes a reproduction URL and provides a visual example of the issue. It is relevant because it addresses a similar problem with color values not being applied correctly.
  • Unexpected behavior of pseudo-elements such as marker: This issue discusses unexpected behavior of pseudo-elements such as marker in Tailwind CSS. It includes reproduction URLs and visual examples of the issue. It is relevant because it addresses a similar problem with unexpected behavior of CSS properties.

This message was generated by AI from www.triagetickets.com

joeypohie avatar Jun 23 '23 17:06 joeypohie

Thanks for sharing.

Haydenpayne avatar Aug 02 '23 10:08 Haydenpayne

After taking a look at your code, I noticed that you're trying to mix two different properties, these properties are the following: text-[--color]/[--opacity]

You can't mix these properties because that is incorrect, if you want to change the opacity of the element you need to do the following: [--opacity:_100%] text-[--color] opacity-[--opacity]

But if the outcome that you want is just to play with the opacity of the font you can do the following as well: [--color:rgba(200,200,200,9)] [--opacity:_100%] text-[--color]

In this way you use a rgba function that enables you to modify the opacity of the color and achieve the outcome that you want.

Please let me know if this solution makes sense to you.

YosefBlandin avatar Sep 21 '23 16:09 YosefBlandin

After taking a look at your code, I noticed that you're trying to mix two different properties, these properties are the following: text-[--color]/[--opacity]

You can't mix these properties because that is incorrect, if you want to change the opacity of the element you need to do the following: [--opacity:_100%] text-[--color] opacity-[--opacity]

But if the outcome that you want is just to play with the opacity of the font you can do the following as well: [--color:rgba(200,200,200,9)] [--opacity:_100%] text-[--color]

In this way you use a rgba function that enables you to modify the opacity of the color and achieve the outcome that you want.

Please let me know if this solution makes sense to you.

omg there are so many AI bots here. anyways,

This is false. Firstly, that is (theoretically) the correct tailwind syntax. Secondly, the outcome he's trying to achieve is to change the opacity of the text, which can be done in tailwind with the format text-black/(opacity here). You can also use text-opacity-(value), but opacity itself has a different effect.

quick007 avatar Sep 22 '23 04:09 quick007

Okay I figured out another way to do it, but thank you @quick007, I haven't noticed that syntax way of changing the opacity in the tailwind documentation, my apologies for that. I'm noticing that the syntax text-[--color]/[--opacity] works if the value of the --color variable is being wrote directly like this text-[#fff]/[--opacity].

YosefBlandin avatar Sep 22 '23 04:09 YosefBlandin

Definitely it's an issue

YosefBlandin avatar Sep 22 '23 04:09 YosefBlandin

https://github.com/tailwindlabs/tailwindcss/discussions/12081

adarshSrivastava01 avatar Sep 26 '23 08:09 adarshSrivastava01

guessing this is related to #12362

quick007 avatar Nov 12 '23 00:11 quick007

any news about this issue?