mdb-ui-kit/less/_mixins.less

125 lines
3.5 KiB
Plaintext
Raw Normal View History

@import '_mixins-shared.less';
2014-12-13 14:26:25 +03:00
2015-03-09 19:10:44 +03:00
//
// To use this mixin you should pass a function as final parameter to define
// the style. In that definition you can use the following variables to define it.
//
// @mdb-color-name ---> "red", "green", "indigo" ...
// @mdb-color-full-name ---> "red", "green-50", "indigo-400" ...
// @mdb-color ---> #f44336, #e8f5e9, #5c6bc0 ...
// @mdb-text-color ---> rgba(255,255,255,0.84), rgba(0,0,0,0.84), rgba(255,255,255,0.84) ...
2015-03-09 19:10:44 +03:00
//
2014-12-13 14:26:25 +03:00
2014-12-19 21:32:44 +03:00
.generic-variations(@extra, @default, @func) {
2014-12-13 14:26:25 +03:00
2014-12-19 21:32:44 +03:00
@contrast-factor: 40%;
2014-12-13 14:26:25 +03:00
// bootstrap styles
2014-12-18 15:59:34 +03:00
&@{extra}, &-default@{extra} {
@mdb-color-name: "default";
@mdb-color-full-name: @mdb-color-name;
@mdb-color: @default;
@mdb-text-color: @darkbg-text;
2014-12-19 21:32:44 +03:00
@func();
}
&-black@{extra} {
@mdb-color-name: "black";
@mdb-color-full-name: @mdb-color-name;
@mdb-color: @black;
@mdb-text-color: @darkbg-text;
2014-12-19 21:32:44 +03:00
@func();
}
&-white@{extra} {
@mdb-color-name: "white";
@mdb-color-full-name: @mdb-color-name;
@mdb-color: @white;
@mdb-text-color: @lightbg-text;
2014-12-19 21:32:44 +03:00
@func();
}
&-inverse@{extra} {
@mdb-color-name: "inverse";
@mdb-color-full-name: @mdb-color-name;
@mdb-color: @inverse;
@mdb-text-color: contrast(@inverse, @lightbg-text, @darkbg-text, @contrast-factor);
2014-12-19 21:32:44 +03:00
@func();
2014-12-18 15:59:34 +03:00
}
&-primary@{extra} {
@mdb-color-name: "primary";
@mdb-color-full-name: @mdb-color-name;
@mdb-color: @brand-primary;
@mdb-text-color: @darkbg-text;
2014-12-19 21:32:44 +03:00
@func();
2014-12-18 15:59:34 +03:00
}
&-success@{extra} {
@mdb-color-name: "success";
@mdb-color-full-name: @mdb-color-name;
@mdb-color: @brand-success;
@mdb-text-color: @darkbg-text;
2014-12-19 21:32:44 +03:00
@func();
2014-12-18 15:59:34 +03:00
}
&-info@{extra} {
@mdb-color-name: "info";
@mdb-color-full-name: @mdb-color-name;
@mdb-color: @brand-info;
@mdb-text-color: @darkbg-text;
2014-12-19 21:32:44 +03:00
@func();
2014-12-18 15:59:34 +03:00
}
&-warning@{extra} {
@mdb-color-name: "warning";
@mdb-color-full-name: @mdb-color-name;
@mdb-color: @brand-warning;
@mdb-text-color: @darkbg-text;
2014-12-19 21:32:44 +03:00
@func();
2014-12-18 15:59:34 +03:00
}
&-danger@{extra} {
@mdb-color-name: "danger";
@mdb-color-full-name: @mdb-color-name;
@mdb-color: @brand-danger;
@mdb-text-color: @darkbg-text;
2014-12-19 21:32:44 +03:00
@func();
2014-12-18 15:59:34 +03:00
}
2014-12-13 14:26:25 +03:00
// given a color build multiples dephs
.generic-variations-factory(@mdb-color-name) {
2014-12-13 14:26:25 +03:00
// given a color and its deph build css
.generic-variations-factory-deep(@mdb-color-number) {
2014-12-13 14:26:25 +03:00
&-material-@{mdb-color-name}@{mdb-color-number}@{extra} {
@mdb-color-full-name: "@{mdb-color-name}@{mdb-color-number}";
@mdb-color: @@mdb-color-full-name;
@mdb-text-color: contrast(@mdb-color, @lightbg-text, @darkbg-text, @contrast-factor);
2014-12-19 21:32:44 +03:00
@func();
2014-12-13 14:26:25 +03:00
}
}
2014-12-19 21:32:44 +03:00
.generic-variations-factory-deep(~"");
}
.generic-variations-factory(~"red");
.generic-variations-factory(~"pink");
.generic-variations-factory(~"purple");
.generic-variations-factory(~"deep-purple");
.generic-variations-factory(~"indigo");
.generic-variations-factory(~"blue");
.generic-variations-factory(~"light-blue");
.generic-variations-factory(~"cyan");
.generic-variations-factory(~"teal");
.generic-variations-factory(~"green");
.generic-variations-factory(~"light-green");
.generic-variations-factory(~"lime");
.generic-variations-factory(~"yellow");
.generic-variations-factory(~"amber");
.generic-variations-factory(~"orange");
.generic-variations-factory(~"deep-orange");
.generic-variations-factory(~"brown");
.generic-variations-factory(~"grey");
.generic-variations-factory(~"blue-grey");
2014-12-13 14:26:25 +03:00
2014-12-05 05:35:32 +03:00
}
2014-12-19 21:32:44 +03:00
@all-variations: ~"-default, -primary, -info, -success, -warning, -danger";