Cinder.Theme (Cinder v0.1.1)
View SourceTheme management for Cinder table components.
Provides default themes and utilities for merging custom theme configurations. Also supports the new Spark DSL for defining modular themes.
Basic Usage (Map-based themes)
# Using built-in themes
theme = Cinder.Theme.merge("modern")
# Using custom map
theme = Cinder.Theme.merge(%{
container_class: "my-custom-container",
table_class: "my-custom-table"
})
Advanced Usage (DSL-based themes)
defmodule MyApp.CustomTheme do
use Cinder.Theme
override Cinder.Components.Table do
set :container_class, "my-custom-table-container"
set :row_class, "my-custom-row hover:bg-blue-50"
end
end
theme = Cinder.Theme.merge(MyApp.CustomTheme)
Summary
Functions
Gets all available theme properties across all components.
Gets the complete default theme by merging all component defaults.
Returns the default theme configuration.
Merges a custom theme configuration with the default theme.
Returns a list of available theme presets.
Validates a theme configuration.
Types
Functions
Gets all available theme properties across all components.
Gets the complete default theme by merging all component defaults.
Returns the default theme configuration.
Merges a custom theme configuration with the default theme.
Examples
iex> Cinder.Theme.merge(%{container_class: "my-custom-class"})
%{container_class: "my-custom-class", ...}
iex> Cinder.Theme.merge("modern")
%{container_class: "bg-white shadow-lg rounded-xl border border-gray-100 overflow-hidden", ...}
Returns a list of available theme presets.
Validates a theme configuration.
Returns :ok if the theme is valid, or {:error, reason} if invalid.