Use LESS Variables
Last modified by Eleni Cojocariu on 2026/02/05 17:21
Steps
1. Find the property you want to use.
XWiki Standard has its LESS variables declared in a few files, mostly:
- variables.less from the bootstrap module: pretty much everything to make the Bootstrap 3 design system work.
- variables.less from the flamingo module: XWiki's special variables and overrides for default values
- variablesInit.vm from the flamingo module:
- $xsVariablesValues in variablelist.vm
- The flamingo Color Themes, those variables can be viewed and edited directly in the Administrator UI but they do not cover everything in the skin.
2. Use this syntax in a LESS stylesheet
.box.box-custom {
color: @brand-color;
}FAQ
Can I use a LESS variable in a CSS stylesheet?
Technically this is impossible. Use a CSS property instead. In the rare case where you NEED a CSS stylesheet and cannot use CSS properties, rely instead on the old Colortheme variables.