Skip to main content
Compile one or more CSS files into a Roblox StyleSheet. The output format (Luau or RBXMX) can be explicitly specified or automatically inferred from the output file extension.

Usage

rbx-css compile <files...> [options]

Arguments

files
string[]
required
One or more CSS input files to compile. Multiple files are merged into a single StyleSheet.

Options

-o, --output
string
Output file path. The format is automatically inferred from the file extension (.luau or .rbxmx).Default: Outputs to stdout
--name
string
default:"StyleSheet"
Name of the generated StyleSheet instance.
--format
string
Explicitly set the output format. Valid values are luau or rbxmx.Default: Inferred from --output extension (defaults to luau if not specified)
--warn
string
default:"all"
Warning level for unsupported CSS features. Valid values:
  • all - Show all warnings
  • unsupported - Show only unsupported feature warnings
  • none - Suppress all warnings
--strict
boolean
default:false
Treat warnings as errors. Compilation will fail if any warnings are emitted.
--minify
boolean
default:false
Minify the generated Luau output. Only applies to Luau format.
--tokens-sheet
boolean
default:false
Emit design tokens (CSS custom properties from :root) as a separate StyleSheet.
--manifest
boolean
default:false
Generate a .manifest.json file alongside the output. The manifest contains metadata about the compiled stylesheet, such as which classes use overflow: scroll.
Only works when --output is specified.

Examples

Compile to stdout

rbx-css compile styles.css

Compile to Luau file

rbx-css compile styles.css -o StyleSheet.luau

Compile to RBXMX model

rbx-css compile styles.css -o StyleSheet.rbxmx

Merge multiple CSS files

rbx-css compile base.css theme.css components.css -o StyleSheet.luau

Custom StyleSheet name

rbx-css compile styles.css -o CoreSheet.luau --name "CoreSheet"

Strict mode with minification

rbx-css compile styles.css -o styles.luau --strict --minify

Generate with manifest

rbx-css compile styles.css -o StyleSheet.luau --manifest
This creates both StyleSheet.luau and StyleSheet.manifest.json.

Output formats

Generates a .luau module that exports a factory function to create the StyleSheet at runtime:
local createStyleSheet = require(path.to.StyleSheet)
local sheet = createStyleSheet()

RBXMX

Generates a .rbxmx model file that can be:
  • Imported directly into Roblox Studio
  • Synced via Rojo
  • Committed to version control
RBXMX output is currently experimental. StyleRule properties are emitted as XML comments rather than fully encoded RBXMX properties. The Luau format is recommended for production use.

Exit codes

  • 0 - Success
  • 1 - Compilation failed (syntax errors, or warnings in --strict mode)

Build docs developers (and LLMs) love