Cinder.Theme.DslModule (Cinder v0.5.0)

View Source

Simplified DSL module for creating custom Cinder themes.

This module provides the use Cinder.Theme functionality that allows users to define custom themes using a simple macro-based DSL.

Usage

defmodule MyApp.CustomTheme do
  use Cinder.Theme

  component Cinder.Components.Table do
    set :container_class, "my-custom-table-container"
    set :row_class, "my-custom-row hover:bg-blue-50"
  end

  component Cinder.Components.Filters do
    set :container_class, "my-filter-container"
    set :text_input_class, "my-text-input"
  end
end

Theme Inheritance

defmodule MyApp.DarkTheme do
  use Cinder.Theme
  extends :modern

  component Cinder.Components.Table do
    set :container_class, "bg-gray-900 text-white"
    set :row_class, "border-gray-700 hover:bg-gray-800"
  end
end

Summary

Functions

Before compile callback to generate the theme configuration function.

Macro for defining component customizations.

Macro for extending from another theme.

Resolves a base theme at compile time.

Resolves a theme module's DSL configuration into a theme map.

Macro for setting theme properties within an override block.

Validates that all overrides in a theme module are valid.

Functions

__before_compile__(env)

(macro)

Before compile callback to generate the theme configuration function.

component(component, list)

(macro)

Macro for defining component customizations.

extends(base_theme)

(macro)

Macro for extending from another theme.

resolve_base_theme(base_preset)

Resolves a base theme at compile time.

resolve_theme(theme_module)

Resolves a theme module's DSL configuration into a theme map.

set(key, value)

(macro)

Macro for setting theme properties within an override block.

validate_theme(theme_module)

Validates that all overrides in a theme module are valid.