mixins - Using a LESS variable as a property instead of a value -


i've made following 2 mixins:

.responsive_color(@color, @response_color, @speed: 0.1s){      color:                  @color;     .transition(color, @speed);      &:hover, &:active, &:focus{         color:                  @response_color;     } }  .responsive_background(@color, @response_color, @speed: 0.1s){     background-color:       @color;     .transition(background-color, @speed);      &:hover, &:active, &:focus{         background-color:       @response_color;     } } 

since these 2 identical want combine them this:

.responsive(@property, @color, @response_color, @speed: 0.1s){     @property:              @color;     .transition(@property, @speed);      &:hover, &:active, &:focus{         @property:                  @response_color;     } } 

while doesn't cause errors in less parser (php class) ignored. i've tried @{property} , '@{property}' both of these cause errors.

does know how can output @property parsed? or trying isn't possible?

a similar question has been answered here may you. particular feature isn't in less.js framework (yet), can possibly around little hack, outlined here:

how pass property name argument mixin in less


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -