Skip to content

The hex css value for the added background color does not apply. #12211

Discussion options

You must be logged in to vote

Hello @Choi-Jinwook!

Tailwind doesn't support constructing classes using template strings. To include the class in the build, it needs to see a complete utility class string in the code. You can read more details here - https://tailwindcss.com/docs/content-configuration#dynamic-class-names.

To solve your issue, I would recommend using inline styles:

// ...
setTodoList(..., background: item.background, ...)
// ...
<div className={...} style={background} />
// ...

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Choi-Jinwook
Comment options

Answer selected by Choi-Jinwook
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants