Fix built-in elements breaking with tailwind=False - #5904
Conversation
Replace Tailwind utility classes in built-in elements with inline CSS or dedicated nicegui.css rules so they work regardless of the Tailwind setting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
evnchn
left a comment
There was a problem hiding this comment.
Summary
- Replaces Tailwind utility classes in built-in elements with inline CSS or dedicated CSS classes
- Enables all built-in elements to work correctly when
tailwind=False - Systematic approach across 8 elements (code, input variants, progress, table header)
- Two new CSS classes added:
.nicegui-code-copyand.nicegui-table-header
BLOCKER
None.
MAJOR
- Visual regression risk across multiple components: The PR touches styling for 8 elements. While the Tailwind-to-CSS mappings look correct (e.g.,
text-sm→font-size: 0.875rem), consider verifying that the rendered output is visually identical with Tailwind enabled (regression) and correct with Tailwind disabled (the fix). A side-by-side screenshot in the PR description would increase reviewer confidence.
CLEANUP
-
CSS class naming convention: Two new classes (
.nicegui-code-copy,.nicegui-table-header) are introduced. A brief comment innicegui.cssexplaining when to use custom CSS classes vs. inline.style()calls would help maintain consistency as more elements are updated (rule of thumb: custom classes for pseudo-selectors/complex selectors, inline for simple properties). -
The
cursor: pointeron the color input button may be redundant since Quasar buttons typically already set this — worth a quick manual check.
Well-organized PR with clear mapping table in the description. Ready to merge after visual verification.
🤖 Generated with Claude Code
|
I'd say:
|
|
Follow-up on review points: 1. Visual regression check (screenshot + pixel diff) Tested all 8 affected elements on both With With
2. CSS class naming convention — Acknowledged, makes sense. 3. Quasar's 🤖 Generated with Claude Code |
evnchn
left a comment
There was a problem hiding this comment.
So yeah, I think you can remove the cursor pointer if you see the need.
|
#5904 (comment) sounds like what I did previously by accident: Switch branches without toggle The redundant cursor setting is a good catch though! |


Motivation
Fixes #5868
Several built-in elements use Tailwind utility classes for styling, which breaks when running with
tailwind=False. This PR replaces all Tailwind classes in built-in elements with inline CSS ornicegui.cssrules so they work regardless of the Tailwind setting.Implementation
ui.codemarkdownoverflow-auto h-fullstyle('overflow: auto; height: 100%')ui.codecopy buttonabsolute right-2 top-2 opacity-20 hover:opacity-80.nicegui-code-copyclass innicegui.cssui.inputpassword togglecursor-pointerstyle('cursor: pointer')ui.date_inputbuttoncursor-pointerstyle('cursor: pointer')ui.time_inputbuttoncursor-pointerstyle('cursor: pointer')ui.color_inputbuttoncursor-pointerstyle('cursor: pointer')ui.linear_progresslabeltext-smstyle('font-size: 0.875rem')ui.circular_progresslabeltext-xsstyle('font-size: 0.75rem')ui.tableheader[&>*]:inline-block.nicegui-table-header > *innicegui.cssFor simple one-off properties like
cursor: pointerandfont-size, inline.style()is used directly. For the code copy button (which needs a:hoverrule) and the table header (which uses a child selector), dedicated CSS classes were added tonicegui.css.Note:
absolute-centerandtext-whiteon the progress labels are Quasar classes, not Tailwind — they remain unchanged.Test script covering all affected elements:
Progress