Skip to content

bug: rootscrollgutter sets background color #4294

Description

@sbarre

Reproduction URL (Required)

https://play.tailwindcss.com/tc1fOy67iY?file=css

What version of daisyUI are you using?

v5.5.5

Which browsers are you seeing the problem on?

All browsers

Describe your issue

I want to set a custom background color on my pages that isn't --color-base-100 so I am following the documentation and adding the following to my theme:

@plugin "daisyui" {
  exclude: rootcolor; 
};

Then in my own CSS file I add:

@layer base {
  :root {
    background-color: var(--color-base-300);
  }
}

However the background color remains --color-base-100 even when I exclude the rootcolor component.

On investigation it turns out that the rootscrollgutter component sets the root background-color as well, which (in my opinion) violates the single-responsibility principle, and is unexpected/undocumented.

:root:root {
background: var(--page-scroll-bg, var(--root-bg, var(--color-base-100)));
}

I think this is a bug because unless I also exclude the rootscrollgutter component, I cannot override DaisyUI's logic that the root background color must be --color-base-100 by excluding the rootcolor component as the docs indicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions