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

Background color using any arbitrary value does not work #9

Open
beobast opened this issue Jul 6, 2024 · 2 comments
Open

Background color using any arbitrary value does not work #9

beobast opened this issue Jul 6, 2024 · 2 comments

Comments

@beobast
Copy link

beobast commented Jul 6, 2024

Hey,

First of all I would like to thank you for your great work.
I'm using tailwind-material-colors for my Nextjs/tailwind project and it's great!

I'm building my own react components following material 3 design system and I've noticed this:
using tailwind background color utility with an arbitrary value does not work.

For example this is not working:

<p class="bg-[#50d71e]">
  <!-- ... -->
</p>

I'm building a navigation drawer and I would like my scrim color to follow the token md.ref.palette.neutral-variant20.
But I don't think your plugin can produce this color, so I thought "nevermind let's hardcode the color since it's the same for light and dark mode". And unfortunately it doesn't work, is it because the tailwind-material-surfaces surfacePrefix used is "bg"?

@JavierM42
Copy link
Owner

JavierM42 commented Aug 26, 2024

Sorry for the long delay! I was on vacation, then swamped with work.

  • I've added the scrim color on v3.1.0 so you might not need this anymore.
  • You could also add any named colors to your config, those won't be overwritten unless there's a name conflict with the Material ones.
  • Arbitrary background colors are indeed broken by the plugin. Sadly I don't think I have the time to spare to debug it in the near future. I've added a note to the docs in the meantime.

@abernier
Copy link

abernier commented Sep 7, 2024

i like this, it prevents us from spawning arbitrary color values everywhere and encourages reusing semantic ones

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

No branches or pull requests

3 participants