metaskills / less-rails-bootstrap

The most popular front-end framework for developing responsive, mobile first projects on the web for Rails asset pipeline.
561 stars 128 forks source link

@import (reference) and .button-variant mixin #115

Closed incubus closed 9 years ago

incubus commented 10 years ago

Hi!

I have a problem when using .button-variant mixin with @import (reference) "twitter/bootstrap". Here is a simple code:

@import (reference) "twitter/bootstrap";

.btn-test {
  .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border);
}

Output:

.btn-test {
  color: #ffffff;
  background-color: #5cb85c;
  border-color: #4cae4c;
}
.btn-test:hover,
.btn-test:focus,
.btn-test:active,
.btn-test.active,
.open > .dropdown-toggle.btn-test {
  color: #ffffff;
  background-color: #449d44;
  border-color: #398439;
}
.btn-test:active,
.btn-test.active,
.open > .dropdown-toggle.btn-test {
  background-image: none;
}
.btn-test .badge {
  color: #5cb85c;
  background-color: #ffffff;
}

And a simple import without reference:

@import "twitter/bootstrap";

.btn-test {
  .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border);
}

Output:

.btn-test {
  color: #ffffff;
  background-color: #5cb85c;
  border-color: #4cae4c;
}
.btn-test:hover,
.btn-test:focus,
.btn-test:active,
.btn-test.active,
.open > .dropdown-toggle.btn-test {
  color: #ffffff;
  background-color: #449d44;
  border-color: #398439;
}
.btn-test:active,
.btn-test.active,
.open > .dropdown-toggle.btn-test {
  background-image: none;
}
.btn-test.disabled,
.btn-test[disabled],
fieldset[disabled] .btn-test,
.btn-test.disabled:hover,
.btn-test[disabled]:hover,
fieldset[disabled] .btn-test:hover,
.btn-test.disabled:focus,
.btn-test[disabled]:focus,
fieldset[disabled] .btn-test:focus,
.btn-test.disabled:active,
.btn-test[disabled]:active,
fieldset[disabled] .btn-test:active,
.btn-test.disabled.active,
.btn-test[disabled].active,
fieldset[disabled] .btn-test.active {
  background-color: #5cb85c;
  border-color: #4cae4c;
}
.btn-test .badge {
  color: #5cb85c;
  background-color: #ffffff;
}

There is no .btn-test.disabled section in the first variant! What's the problem? Thanks!

maxd commented 9 years ago

Hello incubus,

I think this is LESS specific problem and you should ask it here: https://github.com/less/less.js/issues

Thanks you