This commit is contained in:
Loïc Guibert
2022-09-30 20:02:02 +01:00
commit 66dafc36c3
2561 changed files with 454489 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
// Avatar mixin
@mixin avatar-base($size: $unit-8) {
font-size: $size / 2;
height: $size;
width: $size;
}

View File

@@ -0,0 +1,54 @@
// Button variant mixin
@mixin button-variant($color: $primary-color) {
background: $color;
border-color: darken($color, 3%);
color: $light-color;
&:focus {
@include control-shadow($color);
}
&:focus,
&:hover {
background: darken($color, 2%);
border-color: darken($color, 5%);
color: $light-color;
}
&:active,
&.active {
background: darken($color, 7%);
border-color: darken($color, 10%);
color: $light-color;
}
&.loading {
&::after {
border-bottom-color: $light-color;
border-left-color: $light-color;
}
}
}
@mixin button-outline-variant($color: $primary-color) {
background: $light-color;
border-color: $color;
color: $color;
&:focus {
@include control-shadow($color);
}
&:focus,
&:hover {
background: lighten($color, 50%);
border-color: darken($color, 2%);
color: $color;
}
&:active,
&.active {
background: $color;
border-color: darken($color, 5%);
color: $light-color;
}
&.loading {
&::after {
border-bottom-color: $color;
border-left-color: $color;
}
}
}

View File

@@ -0,0 +1,8 @@
// Clearfix mixin
@mixin clearfix() {
&::after {
clear: both;
content: "";
display: table;
}
}

View File

@@ -0,0 +1,27 @@
// Background color utility mixin
@mixin bg-color-variant($name: ".bg-primary", $color: $primary-color) {
#{$name} {
background: $color;
@if (lightness($color) < 60) {
color: $light-color;
}
}
}
// Text color utility mixin
@mixin text-color-variant($name: ".text-primary", $color: $primary-color) {
#{$name} {
color: $color;
}
a#{$name} {
&:focus,
&:hover {
color: darken($color, 5%);
}
&:visited {
color: lighten($color, 5%);
}
}
}

View File

@@ -0,0 +1,11 @@
// Label base style
@mixin label-base() {
border-radius: $border-radius;
line-height: 1.2;
padding: .1rem .2rem;
}
@mixin label-variant($color: $light-color, $bg-color: $primary-color) {
background: $bg-color;
color: $color;
}

View File

@@ -0,0 +1,65 @@
// Margin utility mixin
@mixin margin-variant($id: 1, $size: $unit-1) {
.m-#{$id} {
margin: $size !important;
}
.mb-#{$id} {
margin-bottom: $size !important;
}
.ml-#{$id} {
margin-left: $size !important;
}
.mr-#{$id} {
margin-right: $size !important;
}
.mt-#{$id} {
margin-top: $size !important;
}
.mx-#{$id} {
margin-left: $size !important;
margin-right: $size !important;
}
.my-#{$id} {
margin-bottom: $size !important;
margin-top: $size !important;
}
}
// Padding utility mixin
@mixin padding-variant($id: 1, $size: $unit-1) {
.p-#{$id} {
padding: $size !important;
}
.pb-#{$id} {
padding-bottom: $size !important;
}
.pl-#{$id} {
padding-left: $size !important;
}
.pr-#{$id} {
padding-right: $size !important;
}
.pt-#{$id} {
padding-top: $size !important;
}
.px-#{$id} {
padding-left: $size !important;
padding-right: $size !important;
}
.py-#{$id} {
padding-bottom: $size !important;
padding-top: $size !important;
}
}

View File

@@ -0,0 +1,9 @@
// Component focus shadow
@mixin control-shadow($color: $primary-color) {
box-shadow: 0 0 0 .1rem rgba($color, .2);
}
// Shadow mixin
@mixin shadow-variant($offset) {
box-shadow: 0 $offset ($offset + .05rem) * 2 rgba($dark-color, .3);
}

View File

@@ -0,0 +1,6 @@
// Text Ellipsis
@mixin text-ellipsis() {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

View File

@@ -0,0 +1,5 @@
// Toast variant mixin
@mixin toast-variant($color: $dark-color) {
background: rgba($color, .9);
border-color: $color;
}

View File

@@ -0,0 +1,4 @@
// Component transition
@mixin control-transition() {
transition: all .2s ease;
}