2015-11-02 23:39:13 +03:00
|
|
|
// usage: @include variations(unquote(" .check"), color, transparent);
|
2015-11-03 17:21:39 +03:00
|
|
|
@mixin variations($extra, $property, $default) {
|
2015-11-03 03:29:40 +03:00
|
|
|
@include generic-variations($extra, $default) {
|
2015-11-02 23:39:13 +03:00
|
|
|
#{$property}: $material-color !default;
|
2015-11-03 17:21:39 +03:00
|
|
|
}
|
|
|
|
;
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
|
|
|
|
2015-11-03 17:21:39 +03:00
|
|
|
@mixin background-variations($extra, $default) {
|
2015-11-03 03:29:40 +03:00
|
|
|
@include generic-variations($extra, $default) {
|
2015-11-02 23:39:13 +03:00
|
|
|
background-color: $material-color;
|
2015-11-03 17:21:39 +03:00
|
|
|
@if ($material-color == $btn-default) {
|
|
|
|
color: $lightbg-text;
|
|
|
|
} @else {
|
|
|
|
color: $material-text-color;
|
|
|
|
}
|
2015-11-03 03:29:40 +03:00
|
|
|
};
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
|
|
|
|
2015-11-03 17:21:39 +03:00
|
|
|
@mixin text-variations($extra, $default) {
|
2015-11-03 03:29:40 +03:00
|
|
|
@include generic-variations($extra, $default) {
|
2015-11-02 23:39:13 +03:00
|
|
|
color: $material-color;
|
2015-11-03 17:21:39 +03:00
|
|
|
}
|
|
|
|
;
|
2015-11-02 23:39:13 +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.
|
|
|
|
//
|
|
|
|
// $material-color-name ---> "red", "green", "indigo" ...
|
|
|
|
// $material-color-full-name ---> "red", "green-50", "indigo-400" ...
|
|
|
|
// $material-color ---> #f44336, #e8f5e9, #5c6bc0 ...
|
|
|
|
// $material-text-color ---> rgba(255,255,255,0.84), rgba(0,0,0,0.84), rgba(255,255,255,0.84) ...
|
|
|
|
//
|
|
|
|
|
2015-11-03 17:21:39 +03:00
|
|
|
@mixin generic-variations($extra, $default) {
|
2015-11-02 23:39:13 +03:00
|
|
|
|
|
|
|
$contrast-factor: 40% !default;
|
|
|
|
|
|
|
|
// bootstrap styles
|
|
|
|
&#{$extra}, &-default#{$extra} {
|
|
|
|
$material-color-name: "default" !default;
|
|
|
|
$material-color-full-name: $material-color-name !default;
|
|
|
|
$material-color: $default !default;
|
|
|
|
$material-text-color: $darkbg-text !default;
|
2015-11-03 03:29:40 +03:00
|
|
|
@content
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
|
|
|
&-black#{$extra} {
|
|
|
|
$material-color-name: "black" !default;
|
|
|
|
$material-color-full-name: $material-color-name !default;
|
|
|
|
$material-color: $black !default;
|
|
|
|
$material-text-color: $darkbg-text !default;
|
2015-11-03 03:29:40 +03:00
|
|
|
@content
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
|
|
|
&-white#{$extra} {
|
|
|
|
$material-color-name: "white" !default;
|
|
|
|
$material-color-full-name: $material-color-name !default;
|
|
|
|
$material-color: $white !default;
|
|
|
|
$material-text-color: $lightbg-text !default;
|
2015-11-03 03:29:40 +03:00
|
|
|
@content
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
|
|
|
&-inverse#{$extra} {
|
|
|
|
$material-color-name: "inverse" !default;
|
|
|
|
$material-color-full-name: $material-color-name !default;
|
|
|
|
$material-color: $inverse !default;
|
|
|
|
$material-text-color: contrast($inverse, $lightbg-text, $darkbg-text, $contrast-factor) !default;
|
2015-11-03 03:29:40 +03:00
|
|
|
@content
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
|
|
|
&-primary#{$extra} {
|
|
|
|
$material-color-name: "primary" !default;
|
|
|
|
$material-color-full-name: $material-color-name !default;
|
|
|
|
$material-color: $primary !default;
|
|
|
|
$material-text-color: $darkbg-text !default;
|
2015-11-03 03:29:40 +03:00
|
|
|
@content
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
|
|
|
&-success#{$extra} {
|
|
|
|
$material-color-name: "success" !default;
|
|
|
|
$material-color-full-name: $material-color-name !default;
|
|
|
|
$material-color: $success !default;
|
|
|
|
$material-text-color: $darkbg-text !default;
|
2015-11-03 03:29:40 +03:00
|
|
|
@content
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
|
|
|
&-info#{$extra} {
|
|
|
|
$material-color-name: "info" !default;
|
|
|
|
$material-color-full-name: $material-color-name !default;
|
|
|
|
$material-color: $info !default;
|
|
|
|
$material-text-color: $darkbg-text !default;
|
2015-11-03 03:29:40 +03:00
|
|
|
@content
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
|
|
|
&-warning#{$extra} {
|
|
|
|
$material-color-name: "warning" !default;
|
|
|
|
$material-color-full-name: $material-color-name !default;
|
|
|
|
$material-color: $warning !default;
|
|
|
|
$material-text-color: $darkbg-text !default;
|
2015-11-03 03:29:40 +03:00
|
|
|
@content
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
|
|
|
&-danger#{$extra} {
|
|
|
|
$material-color-name: "danger" !default;
|
|
|
|
$material-color-full-name: $material-color-name !default;
|
|
|
|
$material-color: $danger !default;
|
|
|
|
$material-text-color: $darkbg-text !default;
|
2015-11-03 03:29:40 +03:00
|
|
|
@content
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
|
|
|
|
2015-11-03 17:21:39 +03:00
|
|
|
@include generic-variations-colors($extra, $default, $contrast-factor)
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin generic-variations-colors($extra, $default, $contrast-factor) {
|
2015-11-02 23:39:13 +03:00
|
|
|
|
2015-11-03 17:21:39 +03:00
|
|
|
$material-color-names: "red" "pink" "purple" "deep-purple" "indigo" "blue" "light-blue" "cyan" "teal" "green" "light-green" "lime" "yellow" "amber" "orange" "deep-orange" "brown" "grey" "blue-grey";
|
|
|
|
@each $material-color-name in $material-color-names {
|
|
|
|
// given a color build multiples depths
|
2015-11-03 03:29:40 +03:00
|
|
|
$material-color-numbers: "" "-50" "-100" "-200" "-300" "-400" "-500" "-600" "-700" "-800" "-900" "-A100" "-A200" "-A400" "-A700";
|
2015-11-03 17:21:39 +03:00
|
|
|
@each $material-color-number in $material-color-numbers {
|
|
|
|
@include generic-variations-color($extra, $default, $contrast-factor, $material-color-name, $material-color-number)
|
|
|
|
}
|
|
|
|
}
|
2015-11-02 23:39:13 +03:00
|
|
|
}
|
|
|
|
|
2015-11-03 17:21:39 +03:00
|
|
|
@mixin generic-variations-color($extra, $default, $contrast-factor, $material-color-name, $material-color-number) {
|
|
|
|
& -material-#{$material-color-name}#{unquote($material-color-number)}#{$extra} {
|
|
|
|
$material-color-full-name: "#{$material-color-name}#{$material-color-number}" !default;
|
|
|
|
$material-color: $material-color-full-name !default;
|
|
|
|
$material-text-color: contrast($material-color, $lightbg-text, $darkbg-text, $contrast-factor) !default;
|
|
|
|
@content
|
|
|
|
}
|
|
|
|
}
|
2015-11-02 23:39:13 +03:00
|
|
|
|
|
|
|
$all-variations: unquote("-default, -primary, -info, -success, -warning, -danger") !default;
|