2015-11-04 23:49:03 +03:00
|
|
|
// This file is NOT automatically converted and must be manually merged
|
|
|
|
|
2015-11-05 01:54:57 +03:00
|
|
|
// contrast-color and brightness borrowed from compass
|
|
|
|
// Copyright (c) 2009-2014 Christopher M. Eppstein
|
|
|
|
// Complies with license: https://github.com/Compass/compass/blob/stable/LICENSE.markdown
|
|
|
|
@function contrast-color($color, $dark: $contrasted-dark-default, $light: $contrasted-light-default, $threshold: null) {
|
|
|
|
@if $threshold {
|
|
|
|
// Deprecated in Compass 0.13
|
|
|
|
@warn "The $threshold argment to contrast-color is no longer needed and will be removed in the next release.";
|
|
|
|
}
|
|
|
|
@if $color == null {
|
|
|
|
@return null;
|
|
|
|
}
|
|
|
|
@else {
|
|
|
|
$color-brightness: brightness($color);
|
|
|
|
$dark-text-brightness: brightness($dark);
|
|
|
|
$light-text-brightness: brightness($light);
|
|
|
|
@return if(abs($color-brightness - $light-text-brightness) > abs($color-brightness - $dark-text-brightness), $light, $dark);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@function brightness($color) {
|
|
|
|
@if type-of($color) == color {
|
|
|
|
@return (red($color) * 0.299 + green($color) * 0.587 + blue($color) * 0.114) / 255 * 100%;
|
|
|
|
}
|
|
|
|
@else {
|
|
|
|
@return unquote("brightness(#{$color})");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-11-04 19:57:10 +03:00
|
|
|
// variations(unquote(""), background-color, #FFF);
|
|
|
|
@mixin variations($extra, $material-param-1, $default) {
|
|
|
|
@include generic-variations($extra, $default, "variations-content", $material-param-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin variations-content($args) {
|
|
|
|
//@debug "#{map-get($args, mixin-name)}{ #{map-get($args, material-param-1)}: #{map-get($args, material-color)}; }";
|
|
|
|
//@debug "#{inspect($args)}";
|
|
|
|
//@error "break here";
|
|
|
|
#{map-get($args, material-param-1)}: map-get($args, material-color);
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
|
2015-11-04 19:57:10 +03:00
|
|
|
@mixin background-variations($extra, $default) {
|
|
|
|
@include generic-variations($extra, $default, "background-variations-content", null);
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin background-variations-content($args) {
|
|
|
|
background-color: map-get($args, material-color);
|
|
|
|
@if (map-get($args, material-color) == $btn-default) {
|
2015-11-03 18:57:40 +03:00
|
|
|
color: $lightbg-text;
|
|
|
|
} @else {
|
2015-11-04 19:57:10 +03:00
|
|
|
color: map-get($args, material-text-color);
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-04 19:57:10 +03:00
|
|
|
@mixin text-variations($extra, $default) {
|
|
|
|
@include generic-variations($extra, $default, "text-variations-content", null);
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin text-variations-content($args) {
|
|
|
|
color: map-get($args, material-color);
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
|
2015-11-04 19:57:10 +03:00
|
|
|
@mixin button-variations($extra, $default, $material-param-1) {
|
|
|
|
@include generic-variations($extra, $default, "button-variations-content", $material-param-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin button-variations-content($args) {
|
2015-11-04 21:03:16 +03:00
|
|
|
//@debug "#{inspect($args)}";
|
2015-11-04 19:57:10 +03:00
|
|
|
$material-color: map-get($args, material-color);
|
|
|
|
$material-param-1: map-get($args, material-param-1);
|
2015-11-05 01:54:57 +03:00
|
|
|
background-color: contrast-color($material-color,
|
2015-11-04 21:03:16 +03:00
|
|
|
darken($material-color, $material-param-1),
|
2015-11-05 01:54:57 +03:00
|
|
|
lighten($material-color, $material-param-1));
|
2015-11-04 19:57:10 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
@mixin bg-color-variations($extra, $default, $material-param-1) {
|
|
|
|
@include generic-variations($extra, $default, "bg-color-variations-content", $material-param-1);
|
2015-11-03 20:28:56 +03:00
|
|
|
}
|
|
|
|
|
2015-11-04 19:57:10 +03:00
|
|
|
@mixin bg-color-variations-content($args) {
|
|
|
|
background-color: rgba(map-get($args, material-color), map-get($args, material-param-1));
|
2015-11-03 21:28:56 +03:00
|
|
|
}
|
|
|
|
|
2015-11-04 23:34:47 +03:00
|
|
|
// bg-box-shadow-variations(" label input[type=checkbox]:checked + .toggle:active:after", $primary
|
|
|
|
@mixin bg-box-shadow-variations($extra, $default) {
|
|
|
|
@include generic-variations($extra, $default, "bg-box-shadow-variations-content", null);
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin bg-box-shadow-variations-content($args){
|
|
|
|
$material-color: map-get($args, material-color);
|
|
|
|
box-shadow: 0 1px 3px 1px rgba(0,0,0,0.4), 0 0 0 15px rgba($material-color, (10/100));
|
|
|
|
}
|
|
|
|
|
2015-11-04 23:41:37 +03:00
|
|
|
// bg-img-variations(" label input[type=checkbox]:checked + .toggle:active:after", $primary
|
|
|
|
@mixin bg-img-variations($extra, $default) {
|
|
|
|
@include generic-variations($extra, $default, "bg-img-variations-content", null);
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin bg-img-variations-content($args){
|
|
|
|
$material-color: map-get($args, material-color);
|
2015-11-05 02:24:27 +03:00
|
|
|
//@debug "bg-img-variations-content called for #{map-get($args, extra)} #{map-get($args, default)} #{map-get($args, material-color-name)} #{map-get($args, material-color)}"; //#{inspect($args)}";
|
2015-11-04 23:41:37 +03:00
|
|
|
background-image: linear-gradient($material-color, $material-color), linear-gradient($input-underline-color, $input-underline-color);
|
|
|
|
}
|
|
|
|
|
2015-11-04 23:49:03 +03:00
|
|
|
// navbar-variations(" label input[type=checkbox]:checked + .toggle:active:after", $primary
|
|
|
|
@mixin navbar-variations($extra, $default) {
|
|
|
|
@include generic-variations($extra, $default, "navbar-variations-content", null);
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin navbar-variations-content($args){
|
|
|
|
$material-color: map-get($args, material-color);
|
|
|
|
$material-text-color: map-get($args, material-text-color);
|
|
|
|
|
|
|
|
background-color: $material-color;
|
|
|
|
color: $material-text-color;
|
|
|
|
// deeply defined to override welljumbo class without !impotant need
|
|
|
|
.navbar-form .form-control-wrapper input.form-control::placeholder, .navbar-form input.form-control::placeholder {
|
|
|
|
color: $material-text-color;
|
|
|
|
}
|
|
|
|
.dropdown-menu {
|
|
|
|
border-radius: $dropdown-radius;
|
|
|
|
li > a {
|
|
|
|
font-size: $dropdown-font-size;
|
|
|
|
padding: 13px 16px;
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
color: $material-color;
|
|
|
|
background-color: $grey-200;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.active > a {
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
color: $material-text-color;
|
|
|
|
}
|
|
|
|
background-color: $material-color;
|
|
|
|
color: $material-text-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-11-04 23:34:47 +03:00
|
|
|
|
2015-11-05 00:00:44 +03:00
|
|
|
// alert-variations("", $primary)
|
|
|
|
@mixin alert-variations($extra, $default) {
|
|
|
|
@include generic-variations($extra, $default, "alert-variations-content", null);
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin alert-variations-content($args){
|
|
|
|
$material-color: map-get($args, material-color);
|
|
|
|
$material-text-color: map-get($args, material-text-color);
|
|
|
|
|
|
|
|
background-color: $material-color;
|
|
|
|
color: $material-text-color;
|
|
|
|
|
|
|
|
a, .alert-link {
|
|
|
|
color: $material-text-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-03 18:57:40 +03:00
|
|
|
// interpolation of mixin-name is not allowed evidently, so we statically include based on the mixin-name given
|
2015-11-04 19:57:10 +03:00
|
|
|
@mixin call-variations-content-mixin($args) {
|
|
|
|
$mixin-name: map-get($args, mixin-name);
|
2015-11-03 18:57:40 +03:00
|
|
|
@if $mixin-name == variations-content {
|
2015-11-04 19:57:10 +03:00
|
|
|
@include variations-content($args);
|
2015-11-03 18:57:40 +03:00
|
|
|
} @else if $mixin-name == background-variations-content {
|
2015-11-04 19:57:10 +03:00
|
|
|
@include background-variations-content($args);
|
2015-11-03 18:57:40 +03:00
|
|
|
} @else if $mixin-name == text-variations-content {
|
2015-11-04 19:57:10 +03:00
|
|
|
@include text-variations-content($args);
|
2015-11-03 20:28:56 +03:00
|
|
|
} @else if $mixin-name == button-variations-content {
|
2015-11-04 19:57:10 +03:00
|
|
|
@include button-variations-content($args);
|
2015-11-03 21:28:56 +03:00
|
|
|
} @else if $mixin-name == bg-color-variations-content {
|
2015-11-04 19:57:10 +03:00
|
|
|
@include bg-color-variations-content($args);
|
2015-11-04 23:34:47 +03:00
|
|
|
} @else if $mixin-name == bg-box-shadow-variations-content {
|
|
|
|
@include bg-box-shadow-variations-content($args);
|
2015-11-04 23:41:37 +03:00
|
|
|
} @else if $mixin-name == bg-img-variations-content {
|
|
|
|
@include bg-img-variations-content($args);
|
2015-11-04 23:49:03 +03:00
|
|
|
} @else if $mixin-name == navbar-variations-content {
|
|
|
|
@include navbar-variations-content($args);
|
2015-11-05 00:00:44 +03:00
|
|
|
}@else if $mixin-name == alert-variations-content {
|
|
|
|
@include alert-variations-content($args);
|
2015-11-03 18:57:40 +03:00
|
|
|
} @else {
|
|
|
|
@error "Unknown mixin: #{$mixin-name}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// 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 20:28:56 +03:00
|
|
|
@mixin generic-variations($extra, $default, $mixin-name, $material-param-1) {
|
2015-11-03 18:57:40 +03:00
|
|
|
|
2015-11-04 19:57:10 +03:00
|
|
|
//setup map to pass parameters (instead of the incredibly long-error-prone list for each and every @include)
|
|
|
|
$args: (
|
|
|
|
extra: $extra,
|
|
|
|
default: $default,
|
|
|
|
mixin-name: $mixin-name,
|
2015-11-05 01:54:57 +03:00
|
|
|
material-param-1: $material-param-1
|
2015-11-04 19:57:10 +03:00
|
|
|
);
|
2015-11-03 18:57:40 +03:00
|
|
|
|
|
|
|
// bootstrap styles
|
|
|
|
&#{$extra}, &-default#{$extra} {
|
2015-11-04 19:57:10 +03:00
|
|
|
|
|
|
|
$args-extra: map-merge($args, (
|
|
|
|
material-color-name: "default",
|
|
|
|
material-color-full-name: "default",
|
|
|
|
material-color: $default,
|
|
|
|
material-text-color: $darkbg-text
|
|
|
|
));
|
|
|
|
@include call-variations-content-mixin($args-extra);
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
&-black#{$extra} {
|
2015-11-04 19:57:10 +03:00
|
|
|
$args-black: map-merge($args, (
|
|
|
|
material-color-name: "black",
|
|
|
|
material-color-full-name: "black",
|
|
|
|
material-color: $black,
|
|
|
|
material-text-color: $darkbg-text
|
|
|
|
));
|
|
|
|
@include call-variations-content-mixin($args-black);
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
&-white#{$extra} {
|
2015-11-04 19:57:10 +03:00
|
|
|
$args-white: map-merge($args, (
|
|
|
|
material-color-name: "white",
|
|
|
|
material-color-full-name: "white",
|
|
|
|
material-color: $white,
|
|
|
|
material-text-color: $lightbg-text
|
|
|
|
));
|
|
|
|
@include call-variations-content-mixin($args-white);
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
&-inverse#{$extra} {
|
2015-11-04 19:57:10 +03:00
|
|
|
$args-inverse: map-merge($args, (
|
|
|
|
material-color-name: "inverse",
|
|
|
|
material-color-full-name: "inverse",
|
|
|
|
material-color: $inverse,
|
2015-11-05 01:54:57 +03:00
|
|
|
material-text-color: contrast-color($inverse, $lightbg-text, $darkbg-text)
|
2015-11-04 19:57:10 +03:00
|
|
|
));
|
|
|
|
@include call-variations-content-mixin($args-inverse);
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
&-primary#{$extra} {
|
2015-11-04 19:57:10 +03:00
|
|
|
$args-primary: map-merge($args, (
|
|
|
|
material-color-name: "primary",
|
|
|
|
material-color-full-name: "primary",
|
|
|
|
material-color: $primary,
|
|
|
|
material-text-color: $darkbg-text
|
|
|
|
));
|
|
|
|
@include call-variations-content-mixin($args-primary);
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
&-success#{$extra} {
|
2015-11-04 19:57:10 +03:00
|
|
|
$args-success: map-merge($args, (
|
|
|
|
material-color-name: "success",
|
|
|
|
material-color-full-name: "success",
|
|
|
|
material-color: $success,
|
|
|
|
material-text-color: $darkbg-text
|
|
|
|
));
|
|
|
|
@include call-variations-content-mixin($args-success);
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
&-info#{$extra} {
|
2015-11-04 19:57:10 +03:00
|
|
|
$args-info: map-merge($args, (
|
|
|
|
material-color-name: "info",
|
|
|
|
material-color-full-name: "info",
|
|
|
|
material-color: $info,
|
|
|
|
material-text-color: $darkbg-text
|
|
|
|
));
|
|
|
|
@include call-variations-content-mixin($args-info);
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
&-warning#{$extra} {
|
2015-11-04 19:57:10 +03:00
|
|
|
$args-warning: map-merge($args, (
|
|
|
|
material-color-name: "warning",
|
|
|
|
material-color-full-name: "warning",
|
|
|
|
material-color: $warning,
|
|
|
|
material-text-color: $darkbg-text
|
|
|
|
));
|
|
|
|
@include call-variations-content-mixin($args-warning);
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
&-danger#{$extra} {
|
2015-11-04 19:57:10 +03:00
|
|
|
$args-danger: map-merge($args, (
|
|
|
|
material-color-name: "danger",
|
|
|
|
material-color-full-name: "danger",
|
|
|
|
material-color: $danger,
|
|
|
|
material-text-color: $darkbg-text
|
|
|
|
));
|
|
|
|
@include call-variations-content-mixin($args-danger);
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
|
2015-11-04 19:57:10 +03:00
|
|
|
@include generic-variations-colors($args)
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
|
2015-11-04 19:57:10 +03:00
|
|
|
@mixin generic-variations-color($args) {
|
|
|
|
$material-color-name: map-get($args, material-color-name);
|
|
|
|
$material-color-number: map-get($args, material-color-number);
|
|
|
|
$material-color-full-name: "#{$material-color-name}#{$material-color-number}";
|
2015-11-04 21:03:16 +03:00
|
|
|
$material-color: map-get($args, material-color); // $material-color-full-name;
|
2015-11-05 01:54:57 +03:00
|
|
|
$material-text-color: contrast-color($material-color, $lightbg-text, $darkbg-text);
|
2015-11-04 19:57:10 +03:00
|
|
|
|
2015-11-05 01:54:57 +03:00
|
|
|
&-material-#{$material-color-name}#{unquote($material-color-number)}#{map-get($args, extra)} {
|
2015-11-04 19:57:10 +03:00
|
|
|
$args-color: map-merge($args, (
|
|
|
|
material-color-full-name: $material-color-full-name,
|
|
|
|
material-color: $material-color,
|
2015-11-04 21:03:16 +03:00
|
|
|
material-text-color: $material-text-color,
|
2015-11-04 19:57:10 +03:00
|
|
|
));
|
|
|
|
|
|
|
|
@include call-variations-content-mixin($args-color);
|
2015-11-03 18:57:40 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-04 19:57:10 +03:00
|
|
|
$all-variations: unquote("-default, -primary, -info, -success, -warning, -danger");
|