mix live_style.gen.css (LiveStyle v0.13.0)

View Source

Generates the LiveStyle CSS file with a forced recompilation.

This task clears the manifest, forces a recompilation of all modules, and generates fresh CSS. Use this when you need to ensure the CSS is fully regenerated from scratch.

For regular development, the LiveStyle compiler (mix compile) or the watcher (in config/dev.exs) handles CSS generation automatically.

Usage

mix live_style.gen.css

Options

  • --output, -o - Output file path (overrides configured output_path)

Examples

# Generate CSS to default location
mix live_style.gen.css

# Generate to custom location
mix live_style.gen.css -o assets/css/styles.css

When to Use

Use this task when:

  • Setting up LiveStyle for the first time
  • CSS appears stale or incorrect
  • Debugging CSS generation issues
  • Building for production (though mix compile usually suffices)

Configuration

Configure the default output path in your config/config.exs:

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

Integration

Add the generated CSS to your root layout:

<link rel="stylesheet" href={~p"/assets/css/live.css"} />