Skip to content
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

Placeholder color not compatible with css variables #131

Closed
maxsalven opened this issue Dec 28, 2022 · 3 comments · Fixed by #132
Closed

Placeholder color not compatible with css variables #131

maxsalven opened this issue Dec 28, 2022 · 3 comments · Fixed by #132
Assignees

Comments

@maxsalven
Copy link

maxsalven commented Dec 28, 2022

What version of @tailwindcss/forms are you using?

0.5.3

What version of Node.js are you using?

16

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction repository

https://play.tailwindcss.com/zD1WjAfQbs

Describe your issue

If you use a CSS variable for color-gray-500 with the modern alpha value friendly syntax, then the generated placeholder color still contains the '<alpha-value>' string, and will render as black:

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --color-gray-500: 150 150 150;
}
/** @type {import('tailwindcss').Config} */
module.exports = {
  theme: {
    extend: {
      colors: {
        gray: {
          500: 'rgb(var(--color-gray-500) / <alpha-value>)',
        },
      },
    },
  },
  plugins: [require('@tailwindcss/forms')],
}
<input type="text" placeholder="example" />
<div class="bg-gray-500">Example</div>

image

image

image

@RobinMalfait
Copy link
Contributor

RobinMalfait commented Jan 3, 2023

Hey! Thank you for your bug report!
Much appreciated! 🙏

This should be fixed by #132, and will be available in the next release.

You can already try it by using the insiders build npm install @tailwindcss/forms@insiders.

@mikeb-hm
Copy link

I'm still having an issue despite the fix with the chevron from the form-select class. When the color is defined as a static hex value everything is fine, but when using variables I get a SVG like this as a result:
url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 22'%3e%3cpath stroke='rgb(var(--gray-500) / var(--tw-stroke-opacity%2c 1))' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e")

The chevron with this SVG will not show up at least for me in the newest version of Chrome in Linux.

@arjen-mediasoep
Copy link

I'm still having an issue despite the fix with the chevron from the form-select class. When the color is defined as a static hex value everything is fine, but when using variables I get a SVG like this as a result: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 22'%3e%3cpath stroke='rgb(var(--gray-500) / var(--tw-stroke-opacity%2c 1))' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e")

The chevron with this SVG will not show up at least for me in the newest version of Chrome in Linux.

I've got the exact same issue with the latest package version. Any workaround/fix available, @RobinMalfait?

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 a pull request may close this issue.

4 participants