CSS & Styling
Custom CSS styles
Section titled “Custom CSS styles”To customize the styles applied to your Starlight site when using the Starlight Nova theme, you can providing additional CSS files to modify or extend the Starlight and the Starlight Nova theme default styles.
Learn more about custom CSS in the Starlight documentation.
Cascade layers
Section titled “Cascade layers”Like Starlight, the Starlight Nova theme uses cascade layers internally to manage the order of its styles.
This ensures a predictable CSS order and allows for simpler overrides.
Any custom unlayered CSS will override the default styles from the starlight
and nova
layers.
If you are using cascade layers, you can use @layer
in your custom CSS to define the order of precedence for different layers relative to the Starlight and Starlight Nova theme styles:
@layer my-reset, starlight, nova, my-overrides;
The example above defines a custom layer named my-reset
, applied before all the Starlight and Starlight Nova theme layers, and another named my-overrides
, applied after all Starlight and Starlight Nova theme layers.
Any styles in the my-overrides
layer would take precedence over the Starlight and Starlight Nova theme styles, but Starlight or the Starlight Nova theme could still change styles set in the my-reset
layer.