Skip to content

Instantly share code, notes, and snippets.

@mfd
Created December 28, 2017 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfd/cf1e61ec61c4feaf86ad506ad2a76890 to your computer and use it in GitHub Desktop.
Save mfd/cf1e61ec61c4feaf86ad506ad2a76890 to your computer and use it in GitHub Desktop.
+plussell --- zayaList
$color-orange: #ff9900;
$color-green: #48b04b;
$color-blue: #00ccff;
$color-purple: #6e4db0;
$color-gray: #5f7d8c;
$st_colors: $color-orange $color-green $color-blue $color-purple $color-gray $color-gray $color-gray $color-gray;
// ЗАКАЗЧИК
// .flabel__customer_formir
// .label__customer_formir
// .badge__customer_formir
$st_customer: 'formir' 'inwork' 'agree' 'lp' 'arch' 'all';
// ПОСТАВЩИК
// .flabel__supplier_formir
// .label__supplier_formir
// .badge__supplier_formir
$st_supplier: 'newest' 'podacha' 'agree' 'unused' 'lp' 'arch' 'all';
$st_supplier_num: '0' '1' '2' '3' '4' '5' '6' '7';
// СОГЛАСУЮЩИЙ
// .flabel__agr_formir
// .label__agr_formir
// .badge__agr_formir
$st_agr: 'newest' 'modif' 'agreenot' 'agreeyes' 'arch' 'all';
// ФИЛЬТР СТАТУСОВ
@mixin flabel($role, $status, $color) {
.flabel__#{$role}_#{$status} {
color: $color;
a:hover & {
color: darken($color, 10%);
}
}
}
@mixin flabel_num($role, $status, $color) {
.#{$role}.flabel__#{$status} {
color: $color;
a:hover {
color: darken($color, 10%);
}
}
}
//ЛЕЙБЛЫ
@mixin label($role, $status, $color) {
.label__#{$role}_#{$status} {
//content: $status;
color: darken($color, 10%);
background: lighten($color, 45%);
// &:hover{
// color: darken($color, 10%);
// }
}
}
// ЛЕЙБЛ В КАРТОЧКЕ ЗАЯВКИ
@mixin badge($role, $status, $color) {
.badge__#{$role}_#{$status} {
background-color: $color;
border-color: $color;
color:#ffffff;
//color: contrast($color, $text-color, $white, $color-threshold);
}
}
@mixin make_statuses($role, $role_statuses) {
@each $status in $role_statuses {
$i: index($role_statuses, $status);
$color: nth($st_colors, $i);
@include flabel($role, $status, $color);
@include label($role, $status, $color);
@include badge($role, $status, $color);
}
}
@mixin make_statuses_num($role, $role_statuses) {
@each $status in $role_statuses {
$i: index($role_statuses, $status);
$color: nth($st_colors, $i);
@include flabel_num($role, $status, $color);
}
}
// START -> MAKE STATUSES
@include make_statuses('customer', $st_customer);
@include make_statuses('supplier', $st_supplier);
@include make_statuses('agr', $st_agr);
@include make_statuses_num('supplier', $st_supplier_num);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment