Menu

Post image 1
Post image 2
1 / 2
0

Inline style attributes vs CSS variables: a Tailwind v4 light-mode debug story

DEV Community·Forrest Miller·21 days ago
#BXh68cTT
#comment#css#react#caller#inline#background
Reading 0:00
15s threshold

TL;DR : I shipped a "light mode for the bingo caller" feature three times. Each attempt rendered as dark navy squares on a white stage — totally unreadable. The bug was the same every time: an inline style={{ background: hue.deep }} in a React component winning over the CSS class meant to control the background. Moving from inline styles to inline CSS custom properties unlocked a theme-aware cascade and finally made the feature ship. The setup I'm building a number bingo caller — the screen that flashes numbers across a board as they're called. Each column has a hue (Blue B, Red I, Green N, Orange G, Purple O). When a number is "called," that cell lights up in its column's color. Dark mode shipped first. The visual goal: each called tile is a solid deep block — navy, crimson, forest, pumpkin, royal purple. Looks like a Las Vegas bingo board lit from inside. The implementation was the obvious one: < button className = "caller-tile caller-tile-called" style = { { background : hue .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More