Skip to content

Placeholder color not compatible with css variables #131

@maxsalven

Description

@maxsalven

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions