Reputation: 51
we want to inherit from bootstraps h1
in less using a mixin like
.btn2{ .btn; }
but instead want to use the h1
element:
.h1_replace{ h1; }
Upvotes: 5
Views: 3387
Reputation: 103
You could use an extend:
.h1_replace:extend(h1) {}
http://lesscss.org/features/#extend-feature
Upvotes: 2
Reputation: 3731
I do not believe that less supports that type of class inheritance. Instead you would likely have to redefine the h1 styling as a class and inherit that.
.h1 {
/* copy h1 style here */
}
.h1_replace{
.h1;
}
Though if you do this, you probably could just use the .h1 class throughout your code.
Upvotes: 2