Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: saadeghi/daisyui
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.0.3
Choose a base ref
...
head repository: saadeghi/daisyui
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.0.4
Choose a head ref
  • 7 commits
  • 32 files changed
  • 3 contributors

Commits on Mar 12, 2025

  1. docs: add Rsbuild install (#3653)

    zwlcoding authored Mar 12, 2025
    Copy the full SHA
    88d0da9 View commit details
  2. docs

    saadeghi committed Mar 12, 2025
    Copy the full SHA
    daad7fd View commit details
  3. format

    saadeghi committed Mar 12, 2025
    Copy the full SHA
    0551c9e View commit details
  4. .

    saadeghi committed Mar 12, 2025
    Copy the full SHA
    1a4c8cd View commit details

Commits on Mar 13, 2025

  1. Store

    withden authored Mar 13, 2025
    Copy the full SHA
    725ef7c View commit details

Commits on Mar 14, 2025

  1. Squashed commit of the following:

    commit a3ba1d6
    Author: Pouya Saadeghi <pouya.saadeghi@gmail.com>
    Date:   Fri Mar 14 13:53:08 2025 +0300
    
        format
    
    commit 88148ca
    Author: Pouya Saadeghi <pouya.saadeghi@gmail.com>
    Date:   Fri Mar 14 13:52:32 2025 +0300
    
        fix: select in `<label>` double caret
    
        closes: #3613
    
    commit ceae455
    Author: Pouya Saadeghi <pouya.saadeghi@gmail.com>
    Date:   Fri Mar 14 13:47:15 2025 +0300
    
        fix: V5 Dialog does not put focus on first focusable element
    
        closes: #3440
    
    commit 93c2eaf
    Author: Pouya Saadeghi <pouya.saadeghi@gmail.com>
    Date:   Fri Mar 14 13:17:33 2025 +0300
    
        fix: prevent additional theme to be added if there's only one default theme
    
    commit 97b4f9c
    Author: Pouya Saadeghi <pouya.saadeghi@gmail.com>
    Date:   Fri Mar 14 10:37:41 2025 +0300
    
        docs
    saadeghi committed Mar 14, 2025
    Copy the full SHA
    9a9097b View commit details
  2. chore(release): 5.0.4

    saadeghi committed Mar 14, 2025
    Copy the full SHA
    58386e0 View commit details
Showing with 2,332 additions and 442 deletions.
  1. +10 −1 CHANGELOG.md
  2. +7 −0 packages/daisyui/functions/pluginOptionsHandler.js
  3. +32 −0 packages/daisyui/functions/pluginOptionsHandler.test.js
  4. +1 −1 packages/daisyui/package.json
  5. +2 −1 packages/daisyui/src/components/fileinput.css
  6. +4 −0 packages/daisyui/src/components/modal.css
  7. +3 −1 packages/daisyui/src/components/select.css
  8. +2 −1 packages/daisyui/src/utilities/glass.css
  9. +2 −2 packages/docs/src/components/AlternativeSidebar.svelte
  10. +1 −1 packages/docs/src/components/Carbon.svelte
  11. +1 −1 packages/docs/src/components/Clipboard.svelte
  12. +7 −7 packages/docs/src/components/ColorPicker.svelte
  13. +3 −4 packages/docs/src/components/LangChange.svelte
  14. +2 −2 packages/docs/src/components/Sidebar.svelte
  15. +2 −2 packages/docs/src/components/themegenerator/ContrastMeter.svelte
  16. +92 −92 packages/docs/src/components/themegenerator/Preview.svelte
  17. +4 −4 packages/docs/src/components/themegenerator/PreviewGrid.svelte
  18. +5 −5 packages/docs/src/components/themegenerator/ThemeCSSModal.svelte
  19. +2 −2 packages/docs/src/components/themegenerator/ThemeListItem.svelte
  20. +1,981 −0 packages/docs/src/lib/data/frameworks.yaml
  21. +3 −3 packages/docs/src/lib/data/store.yaml
  22. +84 −86 packages/docs/src/lib/i18n.svelte.js
  23. +1 −1 packages/docs/src/routes/(routes)/blog/+layout.svelte
  24. +1 −1 packages/docs/src/routes/(routes)/docs/install/+page.md
  25. +5 −219 packages/docs/src/routes/(routes)/docs/install/+page.server.js
  26. +1 −1 packages/docs/src/routes/(routes)/docs/install/nextjs/+page.md
  27. +29 −0 packages/docs/src/routes/(routes)/docs/install/reactrouter/+page.md
  28. +40 −0 packages/docs/src/routes/(routes)/docs/install/rsbuild/+page.md
  29. +2 −1 packages/docs/src/routes/(routes)/theme-generator/+page.svelte
  30. +1 −1 packages/docs/src/routes/+error.svelte
  31. +1 −1 packages/docs/src/translation/ro.json
  32. +1 −1 packages/docs/src/translation/ru.json
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,10 +2,19 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## 5.0.4 (2025-03-14)

## 5.0.3 (2025-03-12)

## 5.0.2 (2025-03-11)
### Bug Fixes

* fix: CDN color opacity utilities
* fix: dropdown-end position
* fix: diff outline
* fix: diff-resizer size and placement
* fix: checked button style

## 5.0.2 (2025-03-11)

### Bug Fixes

7 changes: 7 additions & 0 deletions packages/daisyui/functions/pluginOptionsHandler.js
Original file line number Diff line number Diff line change
@@ -51,6 +51,13 @@ export const pluginOptionsHandler = (() => {
} else if (themes) {
const themeArray = Array.isArray(themes) ? themes : [themes]

// For single theme with --default flag, skip the other applications
if (themeArray.length === 1 && themeArray[0].includes("--default")) {
const [themeName, ...flags] = themeArray[0].split(" ")
applyTheme(themeName, flags)
return { include, exclude, prefix }
}

// default theme
themeArray.forEach((themeOption) => {
const [themeName, ...flags] = themeOption.split(" ")
32 changes: 32 additions & 0 deletions packages/daisyui/functions/pluginOptionsHandler.test.js
Original file line number Diff line number Diff line change
@@ -84,3 +84,35 @@ test("pluginOptionsHandler should return include, exclude, and prefix", () => {
expect(result.exclude).toEqual(["exclude"])
expect(result.prefix).toEqual("prefix")
})

test("pluginOptionsHandler should not create duplicate styles for single light theme", () => {
mockAddBase.mockReset()

const options = { themes: ["light --default"] }

pluginOptionsHandler(options, mockAddBase, mockThemesObject, "1.0.0")

// Should be called exactly once
expect(mockAddBase).toHaveBeenCalledTimes(1)
expect(mockAddBase).toHaveBeenCalledWith({
":where(:root),:root:has(input.theme-controller[value=light]:checked),[data-theme=light]": {
color: "white",
},
})
})

test("pluginOptionsHandler should not create duplicate styles for single dark theme", () => {
mockAddBase.mockReset()

const options = { themes: ["dark --default"] }

pluginOptionsHandler(options, mockAddBase, mockThemesObject, "1.0.0")

// Should be called exactly once
expect(mockAddBase).toHaveBeenCalledTimes(1)
expect(mockAddBase).toHaveBeenCalledWith({
":where(:root),:root:has(input.theme-controller[value=dark]:checked),[data-theme=dark]": {
color: "black",
},
})
})
2 changes: 1 addition & 1 deletion packages/daisyui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "daisyui",
"version": "5.0.3",
"version": "5.0.4",
"description": "daisyUI 5 - Tailwind CSS Component Library",
"author": "Pouya Saadeghi",
"license": "MIT",
3 changes: 2 additions & 1 deletion packages/daisyui/src/components/fileinput.css
Original file line number Diff line number Diff line change
@@ -47,7 +47,8 @@
--btn-bg: var(--btn-color, var(--color-base-200));
--btn-fg: var(--color-base-content);
--btn-border: color-mix(in oklab, var(--btn-bg), #000 5%);
--btn-shadow: 0 3px 2px -2px color-mix(in oklab, var(--btn-bg) 30%, #0000),
--btn-shadow:
0 3px 2px -2px color-mix(in oklab, var(--btn-bg) 30%, #0000),
0 4px 3px -2px color-mix(in oklab, var(--btn-bg) 30%, #0000);
--btn-noise: var(--fx-noise);
}
4 changes: 4 additions & 0 deletions packages/daisyui/src/components/modal.css
Original file line number Diff line number Diff line change
@@ -17,6 +17,10 @@
&[open],
&:target {
background-color: oklch(0% 0 0/ 0.4);
transition:
transform 0.3s ease-out,
background-color 0.3s ease-out,
opacity 0.1s ease-out;
}
&.modal-open,
&[open],
4 changes: 3 additions & 1 deletion packages/daisyui/src/components/select.css
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@
border-start-end-radius: var(--join-se, var(--radius-field));
border-end-start-radius: var(--join-es, var(--radius-field));
border-end-end-radius: var(--join-ee, var(--radius-field));
background-image: linear-gradient(45deg, #0000 50%, currentColor 50%),
background-image:
linear-gradient(45deg, #0000 50%, currentColor 50%),
linear-gradient(135deg, currentColor 50%, #0000 50%);
background-position:
calc(100% - 20px) calc(1px + 50%),
@@ -35,6 +36,7 @@
background: inherit;
border-radius: inherit;
border-style: none;
background-image: none;
&:focus,
&:focus-within {
@apply outline-hidden;
3 changes: 2 additions & 1 deletion packages/daisyui/src/utilities/glass.css
Original file line number Diff line number Diff line change
@@ -2,7 +2,8 @@
border: none;
backdrop-filter: blur(var(--glass-blur, 40px));
background-color: #0000;
background-image: linear-gradient(
background-image:
linear-gradient(
135deg,
oklch(100% 0 0 / var(--glass-opacity, 30%)) 0%,
oklch(0% 0 0 / 0%) 100%
4 changes: 2 additions & 2 deletions packages/docs/src/components/AlternativeSidebar.svelte
Original file line number Diff line number Diff line change
@@ -11,9 +11,9 @@
<div class="h-6"></div>
{#if import.meta.env.DEV}
<div
class="carbonads-responsive mx-auto max-xl:w-[22rem] xl:h-[13rem] bg-base-200 rounded-box flex min-h-[100px] items-center justify-center"
class="carbonads-responsive bg-base-200 rounded-box mx-auto flex min-h-[100px] items-center justify-center max-xl:w-[22rem] xl:h-[13rem]"
>
<div class="text-xs text-base-content/30">Ads</div>
<div class="text-base-content/30 text-xs">Ads</div>
</div>
{:else}
<div class="carbonads-responsive mx-auto flex min-h-[100px] items-center justify-center">
2 changes: 1 addition & 1 deletion packages/docs/src/components/Carbon.svelte
Original file line number Diff line number Diff line change
@@ -24,4 +24,4 @@
})
</script>
<div class="print:hidden w-full" id="carbon-container"></div>
<div class="w-full print:hidden" id="carbon-container"></div>
2 changes: 1 addition & 1 deletion packages/docs/src/components/Clipboard.svelte
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@

<div
data-tip={isClipboardButtonPressed ? "copied" : "copy"}
class="tooltip tooltip-left tooltip-accent m-2 [justify-self:right] self-start"
class="tooltip tooltip-left tooltip-accent m-2 self-start [justify-self:right]"
>
<button
class="btn btn-square btn-sm btn-neutral"
14 changes: 7 additions & 7 deletions packages/docs/src/components/ColorPicker.svelte
Original file line number Diff line number Diff line change
@@ -83,17 +83,17 @@

<div class="relative inline-block align-middle">
<button
class="w-6 h-6 rounded border border-gray-300 cursor-pointer"
class="h-6 w-6 cursor-pointer rounded border border-gray-300"
style:background-color={currentColor}
on:click={togglePicker}
aria-label="Open color picker"
/>

{#if isOpen}
<div class="fixed inset-0 z-40" on:click={togglePicker} />
<div class="absolute z-50 mt-2 p-4 bg-white rounded-2xl shadow-lg">
<div class="absolute z-50 mt-2 rounded-2xl bg-white p-4 shadow-lg">
<div
class="w-52 h-52 mb-4 cursor-crosshair relative border rounded-lg overflow-hidden border-black/10 grid"
class="relative mb-4 grid h-52 w-52 cursor-crosshair overflow-hidden rounded-lg border border-black/10"
bind:this={pickerElement}
on:mousedown={handleMouseDown}
>
@@ -119,7 +119,7 @@

<!-- Selection indicator -->
<div
class="absolute w-4 h-4 rounded-full border-2 border-white shadow-sm pointer-events-none"
class="pointer-events-none absolute h-4 w-4 rounded-full border-2 border-white shadow-sm"
style:left={`${(chroma / 0.4) * 100}%`}
style:top={`${100 - lightness}%`}
style:transform="translate(-50%, -50%)"
@@ -131,7 +131,7 @@
min="0"
max="360"
bind:value={hue}
class="w-full h-5 appearance-none cursor-pointer rounded-xl px-[2px]"
class="h-5 w-full cursor-pointer appearance-none rounded-xl px-[2px]"
style={`background: linear-gradient(to right,
oklch(${lightness}% 0.3 0),
oklch(${lightness}% 0.3 65),
@@ -143,7 +143,7 @@
)`}
/>

<div class="mt-2 text-sm text-gray-600 tabular-nums flex gap-2">
<div class="mt-2 flex gap-2 text-sm text-gray-600 tabular-nums">
<div
class="size-6 rounded"
style:background-color={`oklch(${lightness.toFixed(0)}% ${chroma.toFixed(2)} ${hue.toFixed(0)})`}
@@ -153,7 +153,7 @@
</div>

<button
class="mt-4 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 w-full"
class="mt-4 w-full rounded bg-blue-500 px-4 py-2 text-white hover:bg-blue-600"
on:click={updateColor}
>
Apply
7 changes: 3 additions & 4 deletions packages/docs/src/components/LangChange.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<script>
import { currentLang, langs, setLang } from "$lib/i18n.svelte.js"
import { t } from "$lib/i18n.svelte.js"
// Create a sorted array of languages based on languageMetadata order
// This will be used instead of the unsorted 'langs' array
import { languageMetadata } from "$lib/i18n.svelte.js"
// Filter langs to only include languages that exist in both languageMetadata and langs
const sortedLangs = Object.keys(languageMetadata)
.filter(lang => langs.includes(lang));
const sortedLangs = Object.keys(languageMetadata).filter((lang) => langs.includes(lang))
</script>

<div class="dropdown dropdown-end">
4 changes: 2 additions & 2 deletions packages/docs/src/components/Sidebar.svelte
Original file line number Diff line number Diff line change
@@ -16,15 +16,15 @@

<div
data-sveltekit-preload-data
class={`bg-base-100/90 sticky top-0 z-20 hidden navbar items-center gap-2 px-4 py-2 backdrop-blur ${
class={`bg-base-100/90 navbar sticky top-0 z-20 hidden items-center gap-2 px-4 py-2 backdrop-blur ${
$page.url.pathname == "/" ? "" : "lg:flex"
} ${switchNavbarStyle ? "shadow-xs" : ""}`}
>
<a
href="/"
aria-current="page"
aria-label="Homepage"
class="flex-0 btn btn-ghost px-2"
class="btn btn-ghost flex-0 px-2"
oncontextmenu={(e) => {
e.preventDefault()
contextMenuEl.openContextMenu(e)
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@
</script>

<div class="tooltip" data-tip={`Contrast ${wcagContrast(color1, color2).toFixed(2)}`}>
<div class="flex flex-col gap-1 items-end">
<div class="flex items-center h-6 gap-2">
<div class="flex flex-col items-end gap-1">
<div class="flex h-6 items-center gap-2">
{#if ["low", "bad"].includes(contrastRating(color1, color2))}
<span class="text-[10px]">Low contrast</span>
<svg
Loading