Tailwindcss: [FEATURE] CSS variables

Created on 28 Feb 2018  路  4Comments  路  Source: tailwindlabs/tailwindcss

Did you already consider including the JS config variables in the generated lib, as css variables?

In my projects, I include the generated output of a configured tailwind as a css library, then extend it with targeted css, and I'd love to be able to make use of, say, colors as css variables.

Ex:

In Tailwind config:

let colors = {
  ...
  'black': '#22292f',
  ...
}

would generate in the css:

:root {
  --color-black: #22292f;
}

Most helpful comment

All 4 comments

See https://github.com/tailwindcss/tailwindcss/issues/260

At the current time it makes more sense to define the variables you'd like in your CSS.

Alright, so, the other way around. Thanks.

Yeah like mentioned in the other issue we don't have concrete plans to implement anything like this, but it could totally be done with another PostCSS plugin or even Tailwind's upcoming plugin system.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

rgaufman picture rgaufman  路  3Comments

divdax picture divdax  路  3Comments

Tjoosten picture Tjoosten  路  3Comments

dbpolito picture dbpolito  路  3Comments