philomena/assets/css/elements/_block.scss
2024-04-28 18:51:40 +02:00

158 lines
2.9 KiB
SCSS

@mixin block-type($type) {
.block--#{$type} {
.block__content {
border-color: var(--#{$type}-border-color);
background: var(--#{$type}-dark-color);
}
.block__footer {
background: var(--#{$type}-color);
}
&.block--muted {
border-color: var(--#{$type}-color);
}
&.block--fixed {
background: var(--#{$type}-color);
}
& a {
color: var(--#{$type}-link-color);
&:hover {
color: var(--link-hover-color);
}
}
}
}
.block {
margin-bottom: var(--padding-normal);
overflow: hidden;
}
.block .block {
border-radius: var(--border-radius-inner);
}
.block--muted {
border-color: var(--primary-color);
}
.block--borderless {
border: 0;
border-radius: 0;
}
.block__content {
border: 1px solid var(--primary-border-color);
border-radius: var(--border-radius-outer);
padding: var(--padding-normal);
background: var(--primary-dark-color);
}
.block__content--small {
padding: var(--padding-small);
}
.block__footer {
@extend .flex__row;
background: var(--primary-muted-color);
padding: var(--padding-normal);
margin: var(--padding-normal);
margin-top: 0;
}
.block__footer--small {
@extend .block__footer;
margin: var(--padding-small);
margin-top: 0;
}
@include if-phone {
.block__content {
padding: var(--padding-small);
}
.block__footer {
margin: var(--padding-small);
margin-top: 0;
}
}
.block__header {
line-height: var(--block-header-height);
padding: 0 var(--padding-normal);
font-size: var(--font-header-size);
margin-bottom: var(--padding-small);
& > .fa {
margin-right: var(--padding-normal);
}
}
.block__header--single-item {
@extend .block__header;
display: inline-block;
width: 100%;
box-sizing: border-box;
font-weight: bold;
color: var(--link-color) !important;
}
.block__header__buttons {
display: flex;
gap: var(--padding-normal);
line-height: var(--block-header-height);
font-size: var(--font-size);
padding: 0 var(--padding-normal);
}
.block--fixed {
padding: var(--padding-normal);
border-radius: var(--border-radius-inner);
background: var(--primary-muted-color);
}
.block__content > *:last-child, .block--fixed > *:last-child {
margin-bottom: 0;
}
.block__content > *:first-child, .block--fixed > *:first-child {
margin-top: 0;
}
.block__tab {
padding: var(--padding-normal);
}
.block__header--js-tabbed {
display: flex;
padding: 0;
& a {
display: block;
color: var(--text-color);
padding: 0 var(--padding-normal);
&:hover {
background: var(--background-color);
}
}
.selected {
background: var(--background-color);
}
}
.block--spaced-top {
margin-top: var(--padding-normal);
}
@include block-type(secondary);
@include block-type(success);
@include block-type(warning);
@include block-type(danger);
@include block-type(information);
@include block-type(purple);