kazhnuz.css/src/scss/components/_cards.scss

179 lines
3.8 KiB
SCSS
Raw Normal View History

/*
* 2. Cards and containers
* All elements that are supposed to contain other stuff
*
*
*/
$card-bigpad: $lineheight;
$card-smallpad: $lineheight_half;
2021-07-25 14:12:29 +02:00
@mixin card-color($background-color) {
& .card-header, & .menu-header {
2021-07-28 18:05:39 +02:00
@include colorize-shape($background-color);
color:getTextColorFromBackground($background-color);
}
}
2019-10-17 14:04:20 +02:00
.card, .menu {
2021-07-30 11:37:23 +02:00
@include panel($card-bigpad);
2021-07-29 11:59:25 +02:00
display: flex;
flex-direction: column;
2019-10-17 14:04:20 +02:00
&-body {
padding:0!important;
}
&-header {
2021-07-30 11:37:23 +02:00
@include panel-header($card-bigpad);
.fa {
margin-right: 0.5em;
}
}
2019-10-17 14:04:20 +02:00
/* Menu handling */
2019-10-17 14:04:20 +02:00
&-menu {
display:flex;
flex-direction: column;
ul {
margin:0;
padding:0;
}
li {
list-style: none;
padding:0;
margin:0;
}
2021-07-24 16:59:42 +02:00
.menu-element, .menu-element-link, li a, li a:visited {
2019-10-17 14:04:20 +02:00
display:flex;
line-height:$lineheight;
padding-right:$lineheight_half;
padding-left:$lineheight_quarter;
padding-top:$lineheight_quarter;
padding-bottom:$lineheight_quarter;
2019-10-17 14:04:20 +02:00
margin:0;
justify-content: space-between;
2019-10-17 15:34:11 +02:00
word-wrap:none;
white-space: nowrap;
text-overflow: ellipsis;
overflow:hidden;
2021-07-28 18:05:39 +02:00
@include shape-style($lineheight_half);
@include button-hover();
@include prefer-no-borders();
strong {
font-weight: 900;
2021-07-25 14:12:29 +02:00
color:get-color("dark")!important;
}
&.noflex {
& :first-child {
min-width:2rem;
}
justify-content: flex-start;
}
2019-10-17 14:04:20 +02:00
}
2021-07-24 16:59:42 +02:00
a, a:visited {
2021-07-28 18:05:39 +02:00
@include shape-style($lineheight_half);
@include button-hover();
2021-07-28 19:17:16 +02:00
@include button-fullcontrol(transparent, accentuate($color-background-alt), $color-primary);
}
2019-10-17 14:04:20 +02:00
.menu-divider {
position: relative;
left: -$lineheight_quarter;
font-weight: $fontweight_hyper;
padding-top:$lineheight_quarter;
padding-bottom:$lineheight_quarter;
}
}
}
2019-10-18 15:26:26 +02:00
/* CARD LIST - Make a list part of a card */
@mixin list-symbol($symbol) {
li.list-element {
list-style: none;
&::before {
font-family: "ForkAwesome";
content:$symbol;
padding-right:$lineheight_half;
2019-10-18 15:26:26 +02:00
}
}
}
@mixin list-color($color) {
li.list-element {
&::before {
color: $color;
}
}
}
2021-07-24 16:59:42 +02:00
ul.card-list, .card > ul {
2019-10-18 15:26:26 +02:00
padding:0;
margin:0;
li.list-element {
line-height:$lineheight;
padding-right:$lineheight_half;
padding-left:$lineheight_quarter;
padding-top:$lineheight_quarter;
padding-bottom:$lineheight_quarter;
2019-10-18 15:26:26 +02:00
margin:0;
}
}
.list {
&-check {@include list-symbol("\f00c");}
&-cross {@include list-symbol("\f00d");}
&-danger{@include list-color($color-danger);}
&-success{@include list-color($color-success);}
}
2019-10-17 14:04:20 +02:00
.smallcard, .toast {
2021-07-30 11:37:23 +02:00
@include panel($card-smallpad);
2019-10-17 14:04:20 +02:00
&-header {
2021-07-30 11:37:23 +02:00
@include panel-header($card-bigpad);
2019-10-17 14:04:20 +02:00
}
}
2021-07-29 11:59:25 +02:00
.toast {
padding:$card-smallpad,
}
/* COLORIZE CARDS and TOASTS */
.card, .smallcard, .menu {
2021-07-25 14:12:29 +02:00
@each $name, $color in list-colors() {
&-#{$name} { @include card-color(get-color($name)); }
}
}
.toast {
2021-07-25 14:12:29 +02:00
@each $name, $color in list-colors() {
&-#{$name} { @include background-color(get-color($name)); }
}
2021-07-24 16:59:42 +02:00
a, a:visited {
2021-07-25 14:12:29 +02:00
color: $color-font-light;
2021-07-24 16:59:42 +02:00
background-color:rgba(0,0,0,0.15);
text-decoration:none;
opacity:1;
&:hover, &:active, &:visited {
2021-07-25 14:12:29 +02:00
color: $color-font-light;
2021-07-24 16:59:42 +02:00
background-color:transparent;
opacity:1;
}
}
}