Gianpiero Caretti Gianpiero Caretti - 7 months ago 78
Less Question

How to override properties of a CSS class altering the original value (less + mixin)

Let's say I use bootstrap and what to override the

padding-top
of
jumbotron
class of a percentage using less and mixin

Is it possible to do something like this?


// this is my style.less file loaded *after* bootstrap.css
.jumbotron {
padding-top: _original_padding-top_ * 0.5
}

Answer Source

See https://github.com/twbs/bootstrap/blob/v3.3.7/less/jumbotron.less

So you simply do something like:

@import "bootstrap/variables.less";

.jumbotron {
    padding-top: @jumbotron-padding * .5;
}

}

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download