Skip to content

Commit 46a2057

Browse files
chore!(website): migrate tailwind to v4, daisyui to v5 and flowbite-react to v0.12, change how custom colors are defined (#6510)
Breaking: custom color themes now need to be defined in `src/styles/custom-colors.css` as CSS variables: ```css /* src/styles/custom-colors.css * Custom colors now defined in this file */ :root, :host { --color-primary-400: #52b4de; --color-primary-600: #1c7dad; /* etc */ } ``` Resolves #4020, resolves #3714, resolves #5117 Unblocks #6513 Commit messages have more detail about reasoning behind the changes. I've tried to keep changes minimal but a bunch of things were unavoidable. Overview of main changes: - Tailwind renames a lot of classes, this causes the majority of the churn. Much of the renames were done by tailwind's upgrade cli but it missed some files and some class patterns so Codex/Claude reviewed migration guide as well to find anything remaining. - DaisyUI v5 hides modals with `.modal-box` class unless they are inside `.modal`, we had a bunch of modals that weren't following this pattern - We now need to pin vite to v6, the same used by our current version of astro, as otherwise our 2-stage build with `npm ci --omit=dev` gets mismatch issues - Fix some console errors related to react ref forwarding and SSR hydration - Flowbite v0.10 used to set a bunch of global styles that are no longer set in v0.12. To keep styling consistent I add relevant global styles as a CSS file. We use those styles for example in radio buttons, checkboxes - Color theme is now defined as css instead of `colors.json` (`website/colors.json`) as we can no longer import a json file in CSS (it could be imported into tailwind config, but that's no longer possible in tailwind v4). This would be breaking for people who override colors (heads up to Genspectrum @chaoran-chen @fengelniederhammer if you do). Feel free to ask if you have questions about some of the changes.
1 parent b56b43d commit 46a2057

86 files changed

Lines changed: 2094 additions & 2140 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ updates:
1818
versions: [ ">=5.0.0" ]
1919
- dependency-name: "@mui/material"
2020
- dependency-name: "change-case"
21-
# see https://github.com/loculus-project/loculus/issues/4020
22-
- dependency-name: "flowbite-react"
2321
- dependency-name: "@types/node"
2422
versions: [">=23"] # Increase when we update node version in .nvmrc
2523
groups:

integration-tests/tests/fixtures/console-warnings.fixture.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const test = base.extend({
1111
'Form submission canceled because the form is not connected',
1212
'ERR_INCOMPLETE_CHUNKED_ENCODING',
1313
"Response to preflight request doesn't pass access control check", // LAPIS sometimes hangs up preflight requests for unknown reasons
14+
'has been externalized for browser compatibility.',
1415
];
1516

1617
const isHarmless = harmlessMessages.some((harmless) =>

website/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ pnpm-debug.log*
1818

1919
log/
2020

21+
# flowbite-react auto-generated files (regenerated by `flowbite-react dev/build`)
22+
.flowbite-react/
23+
2124
justfile
2225
/tests/config/backend_config.json
2326
/tests/config/website_config.json

website/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/dist
22
/playwright-report
33
.claude/
4+
.flowbite-react/

website/astro.config.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { defineConfig } from 'astro/config';
22
import node from '@astrojs/node';
3-
import tailwind from '@astrojs/tailwind';
3+
import tailwindcss from '@tailwindcss/vite';
44
import Icons from 'unplugin-icons/vite';
55
import react from '@astrojs/react';
66
import mdx from '@astrojs/mdx';
7+
import flowbiteReact from 'flowbite-react/plugin/astro';
78

89
// https://astro.build/config
910
export default defineConfig({
1011
output: 'server',
11-
integrations: [tailwind(), react(), mdx()],
12+
integrations: [react(), mdx(), flowbiteReact()],
1213
adapter: node({
1314
mode: 'standalone',
1415
}),
@@ -20,6 +21,6 @@ export default defineConfig({
2021
optimizeDeps: {
2122
exclude: ['fsevents', 'msw/node', 'msw', 'chromium-bidi'],
2223
},
23-
plugins: [Icons({ compiler: 'jsx', jsx: 'react' })],
24+
plugins: [tailwindcss(), Icons({ compiler: 'jsx', jsx: 'react' })],
2425
},
2526
});

website/colors.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

website/eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const disableFromReact = {
154154

155155
export default defineConfig(
156156
{
157-
ignores: ['**/.astro/content.d.ts'],
157+
ignores: ['**/.astro/content.d.ts', '.flowbite-react/**'],
158158
files: ['**/*.ts', '**/*.tsx'],
159159
extends: [
160160
eslint.configs.recommended,

0 commit comments

Comments
 (0)