Skip to content

Upgrade Tailwind and Daisy to support v4#1723

Open
Simrayz wants to merge 15 commits intomainfrom
chore/1262-tailwind-v4-upgrade
Open

Upgrade Tailwind and Daisy to support v4#1723
Simrayz wants to merge 15 commits intomainfrom
chore/1262-tailwind-v4-upgrade

Conversation

@Simrayz
Copy link
Contributor

@Simrayz Simrayz commented Jan 14, 2026

Scope and purpose

Resolves #1262

This PR upgrades the frontend styling from Tailwind CSS v3 to v4 and DaisyUI v4 to v5.

  • New CSS-first config format (replaces JS config)
  • Updated color variable syntax throughout
  • Compatibility fixes for DaisyUI v5 (badges, tabs, tables, forms, dropdowns, tooltips)
  • Fixed filter dropdowns not triggering htmx requests
  • Fixed tooltip alignment causing horizontal scroll on incident table

NOTE: Most changes are straightforward (class renames, variable syntax). The compatibility CSS in 12-daisy-compat.css restores v4 styling where v5 changed defaults we want to keep

How to test

  • After checking out the branch, make sure to run make upgrade-tailwind and make tailwind (should already be commited, but just in case)
  • Start the server, and make sure to refresh the browser (and maybe hard refresh) to get the new stylesheet
  • Click around and see if anything looks strange. During development I had https://argus.uninett.no/ open in a split view, so I could compare directly what the differences were.

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to Argus can be found in the
Development docs.

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation, including updates to the user manual if feature flow or UI is considerably changed
  • Linted/formatted the code with ruff and djLint, easiest by using pre-commit
  • The first line of the commit message continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See our how-to
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done
  • If this results in changes in the UI: Added screenshots of the before and after
  • If this results in changes to the database model: Updated the ER diagram

@Simrayz Simrayz added the CSS label Jan 14, 2026
@CLAassistant
Copy link

CLAassistant commented Jan 14, 2026

CLA assistant check
All committers have signed the CLA.

@Simrayz Simrayz added design frontend Affects frontend theme Theme-dependent frontend problems labels Jan 14, 2026
@Simrayz Simrayz self-assigned this Jan 14, 2026
@Simrayz Simrayz force-pushed the chore/1262-tailwind-v4-upgrade branch from d2899f9 to 5d7240b Compare January 14, 2026 12:21
@github-actions
Copy link

github-actions bot commented Jan 14, 2026

Test results

    6 files    900 suites   1m 47s ⏱️
  701 tests   700 ✅ 1 💤 0 ❌
4 206 runs  4 200 ✅ 6 💤 0 ❌

Results for commit 36603e2.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 23.33333% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.91%. Comparing base (32fefd4) to head (36603e2).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../argus/htmx/management/commands/tailwind_config.py 0.00% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1723      +/-   ##
==========================================
+ Coverage   82.57%   82.91%   +0.34%     
==========================================
  Files         137      134       -3     
  Lines        6552     6521      -31     
==========================================
- Hits         5410     5407       -3     
+ Misses       1142     1114      -28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Simrayz Simrayz requested a review from a team January 14, 2026 12:56
@Simrayz
Copy link
Contributor Author

Simrayz commented Jan 14, 2026

SonarQube is not happy with the new Tailwind directives (@source, @plugin). Should probably add them to the ignore list? (I don't have access)

@Simrayz Simrayz force-pushed the chore/1262-tailwind-v4-upgrade branch from 5d7240b to 8032875 Compare January 14, 2026 13:19
Copy link
Contributor

@hmpf hmpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a draft, this is the easily noticeable problems:

Global header:

  • the horizontal lines in the user menu are too long and split into two parts
    image

User preferences:

  • Argus theme is missing from drop down and I get the warning "2026-01-14 14:28:45,660 argus.htmx.themes.utils WARNING Themes in settings are out of sync with themes installed"

    image

Nothing seems to be broken in the styleguide. Nothing else looks weird except the dark theme has even worse contrast than before.

@hmpf
Copy link
Contributor

hmpf commented Jan 14, 2026

Also, it appears that djlint at github-actions differs from the version run by precommit 😮‍💨

@Simrayz Simrayz force-pushed the chore/1262-tailwind-v4-upgrade branch from 8032875 to f829de4 Compare January 14, 2026 13:38
@Simrayz
Copy link
Contributor Author

Simrayz commented Jan 14, 2026

It's a draft, this is the easily noticeable problems:

Global header:

  • the horizontal lines in the user menu are too long

They're the same length to me, but split in two, which I'll fix

image

Dashboard:

The tabs and dropdowns should be fixed, as I spent quite some time fixing them:

image image

Are you using the correct tailwind-cli, generated css and did a hard refresh etc?

User preferences:

  • Argus theme is missing from drop down and I get the warning "2026-01-14 14:28:45,660 argus.htmx.themes.utils WARNING Themes in settings are out of sync with themes installed"

Nothing seems to be broken in the styleguide. Nothing else looks weird except the dark theme has even worse contrast than before.

I'll look into fixing the broken Argus theme, and do some adjustments to make the dark theme to look as expected again.

@Simrayz Simrayz force-pushed the chore/1262-tailwind-v4-upgrade branch 3 times, most recently from f45543e to cd5152c Compare January 15, 2026 08:35
@Simrayz Simrayz requested a review from hmpf January 15, 2026 08:37
@Simrayz Simrayz force-pushed the chore/1262-tailwind-v4-upgrade branch from cd5152c to 9ee9e0e Compare January 15, 2026 08:42
@Simrayz
Copy link
Contributor Author

Simrayz commented Jan 15, 2026

I have addressed the problems identified in the first quick-pass:

  • The argus theme is now included as an option in the theme preferences. The problem was a broken regex.
  • The dividers in the user menu are fixed to have the proper length, padding and remove a space (Daisy started using a grid layout in the user menu, which made the divider split in two due to ::before and ::after being its components).

@Simrayz Simrayz requested a review from a team January 15, 2026 08:57
@Simrayz Simrayz marked this pull request as ready for review January 15, 2026 08:57
@hmpf
Copy link
Contributor

hmpf commented Jan 15, 2026

I see this now... anyone else?

image

@hmpf
Copy link
Contributor

hmpf commented Jan 15, 2026

The border is so discreet it annoys the eyes.

image

In comparison:

image

@Simrayz
Copy link
Contributor Author

Simrayz commented Jan 15, 2026

The border is so discreet it annoys the eyes.

image

Daisy just made their base-colors quite unusable... but I increased it to base-300 instead. Does that work for you?

image

@Simrayz
Copy link
Contributor Author

Simrayz commented Jan 15, 2026

I see this now... anyone else?

image

It only happens when the version number is so long that it does'nt fit, causing the menu to overflow. Shouldn't be an issue in a non-developer environment, but looking into it now 👀

@@ -1,5 +1,5 @@
.card-base {
@apply border border-base-200 bg-base-100;
@apply border border-base-300 bg-base-100;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent

<div class="relative isolate flex justify-center gap-x-4 overflow-hidden bg-red-700 px-4 py-1.5">
<div class="absolute left-[max(-7rem,calc(50%-52rem))] top-1/2 -z-10 -translate-y-1/2 transform-gpu blur-2xl"
aria-hidden="true">
<div class="aspect-[577/310] w-[36.0625rem] bg-gradient-to-r from-red-100 to-red-950 opacity-30"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this entire div (one of two even)? The banner message seems to be working just fine without it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, I just changed the class from bg-gradier-* to bg-linear-* to match the new Tailwind spec

@hmpf hmpf requested a review from a team January 21, 2026 13:36
@johannaengland johannaengland requested a review from hmpf January 22, 2026 11:59
Copy link
Contributor

@johannaengland johannaengland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highlighting which incident we're hovering over disappear in this PR:
Before:
image

After:
image

The lines between the footer elements are barely visible:
Before:
image

After:
image

Not sure how relevant it is, but the line thickness between the different segments in the user dropdown changes:
Before:
image

After:
image

The button color in the user preference page changes (when they are greyed out):
Before:
image

After:
image

The line grouping time recurrences on the timeslots page is much less visible:
Before:
image

After:
image

==================

How to customize the look:
How to choose which themes to be made available
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit unclear to me what "to be made available" means

1. Make sure the browser is in light mode if making a light theme, or dark mode
if making a dark theme.
2. Choose a name that is pure ASCII, and don't reuse any of the names that
comes pre-configured. Save the generated CSS to some file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
comes pre-configured. Save the generated CSS to some file.
come pre-configured. Save the generated CSS to a file.

--noise: 0;
}

The stuff starting with ``--`` is css-variables.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The stuff starting with ``--`` is css-variables.
The lines starting with ``--`` are css-variables.


The stuff starting with ``--`` is css-variables.

There are two different methods to install generated themes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There are two different methods to install generated themes.
There are two different methods to install generated themes:

},
]

Make the above one of the entries in the :setting:`DAISYUI_THEMES` setting and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really make sense, since the example is a whole DAISYUI_THEMES

result = get_theme_names()
self.assertEqual(result, set(theme_names_from_setting))

def test_get_theme_names_if_theme_missing_may_raise_exception(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def test_get_theme_names_if_theme_missing_may_raise_exception(self):
def test_get_theme_names_if_theme_missing_will_raise_exception(self):

@hmpf
Copy link
Contributor

hmpf commented Jan 26, 2026

SonarQube is not happy with the new Tailwind directives (@source, @plugin). Should probably add them to the ignore list? (I don't have access)

I noticed. I'll see if I can figure out how. We could also try suffixing the template css files with something else than .css?

@Simrayz Simrayz force-pushed the chore/1262-tailwind-v4-upgrade branch from 754f81e to 63c337c Compare February 16, 2026 14:07
@Simrayz Simrayz force-pushed the chore/1262-tailwind-v4-upgrade branch from b8f91ba to cae34d2 Compare February 17, 2026 07:55
@Simrayz Simrayz moved this from ♻ Changes requested to ❓ Ready for review in Argus development, public Feb 17, 2026
@Simrayz Simrayz force-pushed the chore/1262-tailwind-v4-upgrade branch from cae34d2 to c812827 Compare February 17, 2026 07:59
@Simrayz Simrayz force-pushed the chore/1262-tailwind-v4-upgrade branch from c812827 to 36603e2 Compare February 17, 2026 08:27
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@Simrayz
Copy link
Contributor Author

Simrayz commented Feb 17, 2026

The coverage is low because the tailwind config command doesn't have coverage. Is this something we require of developer/infra code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CSS design frontend Affects frontend needs NOTES NOTES.md must be updated for release rc-future theme Theme-dependent frontend problems

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

Idea: Change to use tailwind v4

4 participants

Comments