coool
coool

Reputation: 8297

How to use colors in tailwind css or material ui in css/scss

I found this tailwind color for tailwind css and for the material ui colors. These have nicely named color from 100 - 900 and A100 - 400 just like font. I think it would nice to use them directly on scss or css file. How would I do that/ is there a import file I can use?

Upvotes: 0

Views: 5330

Answers (3)

Tarik
Tarik

Reputation: 475

I suggest to use LESS with TailWindCSS to benefit from Mixin.

Using Stylus:

// index.styl
$codeBackground = theme('colors.pink.800')

a
 @apply text-yellow-600 !important
 background $codeBackground !important

Output: enter image description here

Upvotes: 5

user14935273
user14935273

Reputation:

First choose rgb in the dropdown -Step 1

Then click on any color you want. Its rgb code will be copied. Then use it anywhere in your css file without any hassle ex - color: rgb(146, 64, 14), background-color: rgb(146, 64, 14) etc.

Upvotes: -6

Carol Skelly
Carol Skelly

Reputation: 362430

I'm not sure what you're trying to do. You can just refer to the color classes in markup like..

bg-blue-400 or text-red-800

Upvotes: 0

Related Questions