LumixEngine

Style

This document describes the in-game GUI styling system: a small, CSS-like language optimized for simplicity and runtime performance. Style is defined in the same file as UI. The style is defined in [style] block:

[style] {
	.some_class {
		width: 50%;
	}
}

Goals

Selectors & precedence

Inheritance

Certain style attributes are inherited from a widget’s parent when the child doesn’t supply its own value. This keeps styles compact while allowing explicit overrides where needed.

Rules:

Hovered state

Use the :hover pseudoclass to target elements while the mouse cursor is over them.

Use it directly in style selectors:

[style] {
	.button {
		bg-color: #3a3a3a;
		color: #ffffff;
	}

	.button:hover {
		bg-color: #4a4a4a;
	}
}

Notes: