mix compile.live_style (LiveStyle v0.13.0)

View Source

Mix compiler that generates CSS from LiveStyle definitions.

This compiler runs after the standard Elixir compiler and generates the CSS file from the manifest that was populated during compilation.

Installation

Add to your mix.exs:

def project do
  [
    compilers: Mix.compilers() ++ [:live_style],
    # ...
  ]
end

Configuration

Configure in your config/config.exs:

config :live_style,
  default: [
    output: "priv/static/assets/css/live.css",
    cd: Path.expand("..", __DIR__)
  ]

What It Does

  1. Writes the generated CSS to the configured output path
  2. Reports statistics (vars, keyframes, rules)

Output

The compiler outputs a message like:

LiveStyle: 42 vars, 3 keyframes, 128 rules  priv/static/assets/css/live.css
  • mix live_style.gen.css - Force regenerate CSS with recompilation
  • mix live_style default - Run with profile configuration