# `Cinder.Theme`
[🔗](https://github.com/sevenseacat/cinder/blob/v0.16.0/lib/cinder/theme.ex#L1)

Theme management for Cinder table components.

Provides default themes and utilities for merging custom theme configurations.

## Basic Usage

    # Using built-in themes
    theme = Cinder.Theme.merge("modern")

    # Using application configuration for default theme
    # config/config.exs
    config :cinder, default_theme: "modern"

## Custom Themes

    defmodule MyApp.CustomTheme do
      use Cinder.Theme

      # Table
      set :container_class, "my-custom-table-container"
      set :row_class, "my-custom-row hover:bg-blue-50"

      # Filters
      set :filter_container_class, "my-filter-container"
    end

    # Use in config
    config :cinder, default_theme: MyApp.CustomTheme

    # Or use directly
    theme = Cinder.Theme.merge(MyApp.CustomTheme)

## Configuration

You can set a default theme for all Cinder tables in your application configuration:

    # config/config.exs
    config :cinder, default_theme: "modern"

    # Or use a custom theme module
    config :cinder, default_theme: MyApp.CustomTheme

Individual tables can still override the configured default:

```heex
<Cinder.collection theme="dark" ...>
  <!-- This table uses "dark" theme, ignoring the configured default -->
</Cinder.collection>
```

# `theme`

```elixir
@type theme() :: %{required(atom()) =&gt; String.t()}
```

# `built_in_theme_names`

Returns the names of built-in themes that ship with a matching CSS file
under `priv/themes/`. `"default"` is intentionally excluded — its classes
live in `theme.ex` itself and don't need a separate `@import`.

# `complete_default`

Gets the complete default theme.

# `default`

Returns the default theme configuration.

# `get_default_theme`

Gets the configured default theme from application configuration.

Returns the theme configured via `config :cinder, default_theme: ...`
or falls back to "default" if no configuration is set.

## Examples

    # With configuration
    Application.put_env(:cinder, :default_theme, "modern")
    Cinder.Theme.get_default_theme()
    #=> returns modern theme configuration

    # Without configuration
    Cinder.Theme.get_default_theme()
    #=> returns "default" theme configuration

# `merge`

Merges a theme configuration with the default theme.

## Examples

    iex> Cinder.Theme.merge("modern")
    %{container_class: "bg-white shadow-lg rounded-xl border border-gray-100 overflow-hidden", ...}

    iex> Cinder.Theme.merge(MyApp.CustomTheme)
    %{container_class: "custom-container", ...}

# `presets`

Returns a list of available theme presets.

# `theme_or_default`

```elixir
@spec theme_or_default(map() | nil) :: map()
```

Returns the given theme or the default theme if nil.

Used internally by the theme DSL to avoid dialyzer warnings
when extending themes.

# `valid_property?`

Validates that a theme property key is valid.

# `validate`

Validates a theme configuration.

Returns :ok if the theme is valid, or {:error, reason} if invalid.

---

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