mixins.less.
Import
variables.less, giving you access to both mixins and LESS variables.
Surface Effects
.mixin-citizen-opaque-background(@surface)
Creates an opaque background with the specified surface level and progressive color tinting.
Parameters:
@surface- Surface level (1-4), default: 1
.mixin-citizen-frosted-glass(@surface)
Creates a frosted glass effect with backdrop blur and progressive color tinting.
Parameters:
@surface- Surface level (1-4), default: 1
Header Components
.mixin-citizen-header-card(@position)
Positions header card popups responsively based on screen size and position.
Parameters:
@position- Eitherstartorend
- Mobile: Appears at bottom (above header)
- Tablet: Positioned at start/end based on parameter
- Desktop: Appears to the side (left for start, right for end)
Sticky Elements
.mixin-citizen-sticky-header-element()
Applies positioning and transition for sticky header elements.
Example:
.mixin-citizen-sticky-header-background()
Creates a frosted glass background for sticky headers using a ::before pseudo-element.
Example:
.mixin-citizen-sticky-header(@bottomBorder, @zIndex)
Combines all sticky header features into one mixin.
Parameters:
@bottomBorder- Add bottom border (true/false), default: true@zIndex- Apply sticky z-index (true/false), default: true
Accessibility
.mixin-citizen-screen-reader-only()
Hides content visually while keeping it accessible to screen readers.
Example:
Buttons
.mixin-citizen-button-progressive()
Applies progressive (primary) button styling.
Example:
.mixin-citizen-button-destructive()
Applies destructive (danger) button styling.
Example:
Typography
.mixin-citizen-font-styles(@type)
Applies Codex 2.0 typography styles.
Parameters:
@type- Typography type:heading-1,heading-2,heading-3,heading-4,body,small,overline
Forms
.mixin-citizen-cdx-input()
Retrofits input elements with Codex styling.
Example:
Visual Effects
.mixin-citizen-mask-gradient(@direction, @color1, @color2, @color3, @color4)
Creates a gradient mask effect (useful for fade-out effects).
Parameters:
@direction- Gradient direction (e.g.,to right,to bottom)@color1,@color2- Required gradient stops@color3,@color4- Optional additional gradient stops
.recolor(@color)
Transforms black SVG/images to a specified color using CSS filters.
Parameters:
@color- Target color (LESS color value)
Theme Utilities
.mixin-citizen-css-theme-clientpref-all(@prop, @value)
Applies a CSS property across all theme modes (overrides MediaWiki dark mode styles).
Parameters:
@prop- CSS property name@value- CSS value
Codex Overrides
.citizen-cdx-mixin-link-base-overrides()
Overrides Codex link styles to use Citizen link colors.
Example:
Complete Component Example
Here’s how multiple mixins work together in a real component:Related Resources
- CSS Variables - Available CSS custom properties
- Design Tokens - Token system overview
- MediaWiki LESS Mixins - Upstream mixins