-
I have a component which renders a simple button, with the background color being determined programmatically. Relevant parts of the theme:
The HTML elements as rendered:
The second of these buttons, the 'Cancel' button, displays correctly. However the first, the 'Submit' button displays incorrectly with no color, appearing transparent. Why? What is going on? Tailwind CSS V4.1.3 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
The CSS comments are unclosed, causing some of your color definitions to actually be comment content. Try changing as per below: @theme static {
---color-wmb-btn-cancel: #d97706; /* dark amber /
---color-wmb-btn-submit: #15803d; / dark green /
---color-wmb-btn-action: #0d3b66; / dark blue /
---color-wmb-btn-delete: #dc2626; / red */
+ --color-wmb-btn-cancel: #d97706; /* dark amber */
+ --color-wmb-btn-submit: #15803d; /* dark green */
+ --color-wmb-btn-action: #0d3b66; /* dark blue */
+ --color-wmb-btn-delete: #dc2626; /* red */
---color-wmb-btn-event: #0d3b66; /* dark blue /
---color-wmb-text-link: #0d3b66; / dark blue */
+ --color-wmb-btn-event: #0d3b66; /* dark blue */
+ --color-wmb-text-link: #0d3b66; /* dark blue */
} See this working in this Tailwind Play. |
Beta Was this translation helpful? Give feedback.
-
I have added the full css file (extension saved as .txt so I could upload it) |
Beta Was this translation helpful? Give feedback.
You are constructing the class names dynamically which is not supported by Tailwind. See the documentation for details.