taiga-front/app/styles/dependencies/mixins.scss

160 lines
3.7 KiB
SCSS

@mixin box-shadow($h-shadow: 1px, $v-shadow: 1px, $blur: 15px, $spread: 6px, $color: rgba(0, 0, 0, .1)) {
box-shadow: $h-shadow $v-shadow $blur $spread $color;
}
@mixin clearfix {
&:after {
clear: both;
content: '';
display: table;
}
}
@mixin placeholder {
$placeholders: ":-webkit-input" ":-moz" "-moz" "-ms-input";
@each $placeholder in $placeholders {
&:#{$placeholder}-placeholder {
@content;
}
}
}
@mixin slide($max, $overflow, $min: 0) {
max-height: $min;
transition: max-height .5s ease-in;
overflow: #{$overflow};
&.open {
transition: max-height .5s ease-in;
max-height: $max;
}
}
@mixin popover($width, $top: '', $left: '', $bottom: '', $right: '', $arrow-width: 0, $arrow-top: '', $arrow-left: '', $arrow-bottom: '', $arrow-height: 15px) {
@extend %light;
@extend %small;
background: $blackish;
bottom: #{$bottom};
color: $white;
display: none;
left: #{$left};
list-style-type: none;
margin: 0;
padding: 10px;
position: absolute;
right: #{$right};
top: #{$top};
width: $width;
z-index: 99;
a {
@extend %small;
border-bottom: 1px solid $grayer;
color: $white;
display: block;
padding: 10px 2px;
&:last-child {
border: 0;
}
&:hover {
color: $primary-light;
transition: color .3s linear;
&.point {
color: $white;
}
}
}
&:after {
background: $blackish;
bottom: #{$arrow-bottom};
content: '';
height: #{$arrow-height};
left: #{$arrow-left};
position: absolute;
top: #{$arrow-top};
transform: rotate(45deg);
width: #{$arrow-width};
}
}
@mixin arrow($arrow-direction, $border-color, $background-color, $border-width, $border-size) {
&:after,
&:before {
#{$arrow-direction}: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
&:after {
border-color: rgba($background-color, 0);
border-#{$arrow-direction}-color: $background-color;
border-width: #{$border-size}px;
margin-left: -#{$border-size}px;
}
&:before {
border-color: rgba($border-color, 0);
border-#{$arrow-direction}-color: $border-color;
border-width: calc(#{$border-size}px + #{$border-width}px);
margin-left: calc(-#{$border-size}px + #{$border-width}px);
}
}
// Mixin for track buttons
@mixin list-itemtype-track {
.list-itemtype-track {
@extend %small;
color: $gray-light;
display: flex;
flex-shrink: 0;
justify-content: flex-end;
.list-itemtype-track-likers {
margin-right: .5rem;
}
}
.list-itemtype-track-likers,
.list-itemtype-track-watchers {
display: flex;
.icon {
display: block;
margin-right: .25rem;
}
&.active {
color: $primary;
.icon {
fill: currentcolor;
}
}
}
.icon {
fill: $gray-light;
}
}
@mixin cursor-progress {
.in-progress {
cursor: progress;
}
}
@mixin centered {
margin: 1rem auto;
max-width: 1200px;
min-width: 768px;
@include breakpoint(tablet) {
width: 90%;
min-width: 0;
}
}
@mixin svg-size($width: 1rem, $height: null) {
@if $height == null {
width: $width;
height: $width;
} @else {
width: $width;
height: $height;
}
}