less - Can I override global variables from the calling scope -


i need override global variables used within mixin. i'm reluctant change variables in global space (wouldn't overriding then)

consider given mixin required variable defined.

// mixin , adjust regular image class .thumbnail {   display: block;   padding: @thumbnail-padding;   margin-bottom: @line-height-computed;   line-height: @line-height-base;   background-color: @thumbnail-bg;   border: 1px solid @thumbnail-border;   border-radius: @thumbnail-border-radius;   .transition(all .2s ease-in-out);    > img,   > img {     .img-responsive();     margin-left: auto;     margin-right: auto;   }    // add hover state linked versions   a&:hover,   a&:focus,   a&.active {     border-color: @link-color;   }    // image captions   .caption {     padding: @thumbnail-caption-padding;     color: @thumbnail-caption-color;   } } 

yep, bootstrap... want mixin work different variables, without changing global scoped ones. can done?

article.publications {   .news-thumb {     @thumbnail-padding: 10px;     @line-height-computed: 20px;     @line-height-base: 30px;     @thumbnail-bg : black;     .thumbnail();   } } 


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -