Skip to content

Dark mode breaks Tailwind styling in some situations since NiceGUI 2.0 #3753

@petergaultney

Description

@petergaultney

Description

I'm not (currently) able to give a minimal reproducible example. In lieu of that, I'm going to write down the basic things I'm observing here, and then go spend some time debugging the NiceGUI code to see if I can figure out what's going on. I'll report back with any findings.

We upgraded from NiceGUI 1.4.30 to 2.1.0, and a lot of our CSS styling broke. We think it mostly has to do with tailwind classes somehow no longer being present/applied. I have narrowed it down to the 1.4.37 -> 2.0.0 upgrade by installing those versions specifically.

Systems affected are various, including multiple developer Mac laptops and our Linux-based deployment.

Screenshots, before and after the upgrade:

(expected layout, which we get in 1.4.37 and earlier)
Screenshot 2024-09-19 at 12 42 57

(what we see in 2.0)
Screenshot 2024-09-19 at 12 42 04

The relevant code, which was unchanged:

def _render_task_counts_display(task_counts: ty.Collection[QueueCount]) -> None:
    with ui.row(wrap=False).classes("w-full"):
        with ui.column().classes("w-1/2"):
            viz.render_task_counts_by_intent(task_counts)
            viz.render_task_counts_by_typename(task_counts)
        with ui.column().classes("w-1/2"):
            viz.render_task_counts_by_typename_and_intent(task_counts)


async def queue_stats_area():
    task_counts = await list_queue_counts("task")
    policy_counts = await list_queue_counts("policy")

    with ui.column().classes("w-full"):
        viz.render_total_task_count(task_counts)
        with ui.row(wrap=False).classes("w-full"):
            with ui.column().classes("w-1/2"):
                _render_task_counts_display(task_counts)
            with ui.column().classes("w-1/2"):
                viz.render_policy_counts(policy_counts)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugType/scope: A problem that needs fixingreviewStatus: PR is open and needs review🌳 advancedDifficulty: Requires deep knowledge of the topic🟠 majorPriority: Important, but not urgent

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions