# `PhoenixKit.Install.DaisyUI`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v2.14.0/lib/phoenix_kit/install/daisyui.ex#L1)

Advisory check of the host's vendored daisyUI version.

PhoenixKit's UI is styled by daisyUI, which lives in the HOST app
(`assets/vendor/daisyui.js` + `daisyui-theme.js`, scaffolded by
`mix phx.new` and loaded from the host's `app.css`). The host owns that
file — PhoenixKit does not manage or replace it; it only **checks** it.
`mix phoenix_kit.install`, `mix phoenix_kit.update`, and
`mix phoenix_kit.doctor` warn when the vendored copy is older than
`minimum_version/0`, with upgrade instructions.

Why the minimum matters: daisyUI < 5.1 reserves the modal scrollbar gutter
UNCONDITIONALLY while a modal/drawer is open, which either leaves a phantom
right-edge strip on non-scrolling pages or (when countered) makes content
reflow ~15px around every modal open/close on scrolling pages. daisyUI
≥ 5.1 reserves the gutter only when the page really has a scrollbar
(`rootscrollgutter.css`), and 5.6.0 finished the job for modals
(`scrollbar-gutter: auto`), so PhoenixKit ships **no** scrollbar-gutter
compensations of its own (removed 2026-07-12) and relies on a modern
daisyUI instead.

## Two warning bands

Those are two different situations, and `outdated_warning/1` says so
(`severity/1` picks the copy):

- `:broken` — below `gutter_fix_version/0` (5.1.0). Modals genuinely
  misbehave; upgrading is the fix.
- `:behind` — at/above 5.1.0 but below `minimum_version/0`. Modals render
  correctly; the host is simply short of the version core is verified
  against. Purely a heads-up — notably, `mix phx.new` currently vendors
  5.5.19, so a *freshly scaffolded* app lands in this band and must not be
  told it has a rendering bug.

# `check`

```elixir
@spec check() :: :ok | {:outdated, String.t()} | :unversioned | :missing
```

Check the host's vendored daisyUI against `minimum_version/0`.

- `:ok` — present and at/above the minimum
- `{:outdated, version}` — present but older than the minimum
- `:unversioned` — present but carries no parseable version marker
- `:missing` — no `assets/vendor/daisyui.js` (npm or custom setup)

# `gutter_fix_version`

```elixir
@spec gutter_fix_version() :: String.t()
```

The daisyUI version that made the modal scrollbar gutter conditional.

Below this, modals visibly misbehave; at or above it they render correctly
even when the copy is older than `minimum_version/0`.

# `host_path`

```elixir
@spec host_path() :: Path.t()
```

The host-side path of the vendored daisyUI plugin.

# `installed_version`

```elixir
@spec installed_version(Path.t()) :: String.t() | nil
```

Parse the daisyUI version out of a plugin bundle, or `nil` when the file is
missing or carries no `version = "x.y.z"` marker.

# `minimum_version`

```elixir
@spec minimum_version() :: String.t()
```

The minimum daisyUI version PhoenixKit's UI is designed against.

# `outdated?`

```elixir
@spec outdated?(String.t()) :: boolean()
```

Whether a daisyUI version string is below `minimum_version/0`.

# `outdated_warning`

```elixir
@spec outdated_warning(String.t()) :: String.t()
```

Human warning for an outdated vendored daisyUI, with upgrade steps.

The copy follows `severity/1`: a real bug report below
`gutter_fix_version/0`, an advisory heads-up above it.

# `severity`

```elixir
@spec severity(String.t()) :: :broken | :behind
```

How bad an outdated version actually is.

- `:broken` — below `gutter_fix_version/0`; modals mishandle the gutter.
- `:behind` — older than `minimum_version/0` but rendering correctly.

Unparseable versions get the benign verdict — never accuse a host of a
rendering bug we could not confirm.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
