So I'm trying to import the bootstrap button.less file into my own project. However in this case I only want the danger button css stuff to include and the core button classes.
Something along the lines of
.my_custom_button {
.btn();
.btn-danger();
.btn-small();
}
But I don't particularly need all the other stuff. e.g. the warning colour class etc. Currently by using:
@import "mixins.less";
@import "variables.less";
@import "buttons.less";
I'm importing the entire file css into my project - is there any way I can avoid this (I'm a LESS noob) or is this just a consequence of less?
As of LESS 1.5 you can do an import as just a reference (so you can use the mixins without getting all the code compiled). Like this:
@import (reference) "mixins.less";
@import (reference) "variables.less";
@import (reference) "buttons.less";
.my_custom_button {
.btn();
.btn-danger();
.btn-small();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With