Less Theming: Choosing Between Mixins and Variables
Deciding between Less mixins and variables for theming impacts CSS bundle size and maintainability. Learn how to balance global design tokens with component patterns using a hybrid approach.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Deciding between Less mixins and variables for theming impacts CSS bundle size and maintainability. Learn how to balance global design tokens with component patterns using a hybrid approach.
Goal Understand which variable value is used when a mixin parameter shares a name with a global variable. Context Stylus allows mixins to declare parameters that act as local variables. Global variables defined outside a mixin are accessible inside it unless a local variable with the same name shadows them. The language specification does not explicitly stat