You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AdminLTE/build/scss/_mixins.scss

163 lines
3.3 KiB

/*
* General: Mixins
* ---------------
*/
// Cards Variant
@mixin cards-variant($name, $color) {
.card-#{$name} {
&:not(.card-outline) {
.card-header {
background-color: $color;
border-bottom: 0;
&,
a {
color: color-yiq($color);
}
}
}
&.card-outline {
border-top: 3px solid $color;
}
}
.bg-#{$name},
.bg-#{$name}-gradient,
.card-#{$name}:not(.card-outline) {
.btn-tool {
color: rgba(color-yiq($color), 0.8);
&:hover {
color: color-yiq($color);
}
}
}
.card.bg-#{$name},
.card.bg-#{$name}-gradient {
.bootstrap-datetimepicker-widget {
.table td,
.table th {
border: none;
}
table thead tr:first-child th:hover,
table td.day:hover,
table td.hour:hover,
table td.minute:hover,
table td.second:hover {
background: darken($color, 8%);
color: color-yiq($color);
}
table td.active,
table td.active:hover {
background: lighten($color, 10%);
color: color-yiq($color);
}
}
}
}
// Sidebar Color
@mixin sidebar-color($color) {
.nav-sidebar > .nav-item {
& > .nav-link.active {
background-color: $color;
color: color-yiq($color);
}
}
}
@mixin navbar-variant($color, $font-color: rgba(255, 255, 255, 0.8), $hover-color: #f6f6f6, $hover-bg: rgba(0, 0, 0, 0.1)) {
background-color: $color;
.nav > li > a {
color: $font-color;
}
.nav > li > a:hover,
.nav > li > a:active,
.nav > li > a:focus,
.nav .open > a,
.nav .open > a:hover,
.nav .open > a:focus,
.nav > .active > a {
background: $hover-bg;
color: $hover-color;
}
9 years ago
// Add color to the sidebar toggle button
.sidebar-toggle {
color: $font-color;
&:hover,
&:focus {
background: $hover-bg;
color: $hover-color;
}
}
}
9 years ago
// Logo color variation
@mixin logo-variant($bg-color, $color: #fff, $border-bottom-color: transparent, $border-bottom-width: 0) {
background-color: $bg-color;
border-bottom: $border-bottom-width solid $border-bottom-color;
color: $color;
&:hover,
&:focus {
background-color: darken($bg-color, 1%);
}
}
9 years ago
// Direct Chat Variant
@mixin direct-chat-variant($bg-color, $color: #fff) {
.right > .direct-chat-text {
background: $bg-color;
border-color: $bg-color;
7 years ago
color: color-yiq($bg-color);
&:after,
&::before {
border-left-color: $bg-color;
}
}
}
@mixin translate($x, $y) {
transform: translate($x, $y);
}
9 years ago
// Different radius each side
@mixin border-radius-sides($top-left, $top-right, $bottom-left, $bottom-right) {
border-radius: $top-left $top-right $bottom-left $bottom-right;
}
9 years ago
@mixin calc($property, $expression) {
#{$property}: -webkit-calc(#{$expression});
#{$property}: calc(#{$expression});
}
@mixin rotate($value) {
-ms-transform: rotate($value);
transform: rotate($value);
}
@mixin animation($animation) {
animation: $animation;
}
9 years ago
// Gradient background
@mixin gradient($color: #F5F5F5, $start: #EEE, $stop: #FFF) {
background: $color;
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, $start), color-stop(1, $stop));
background: -ms-linear-gradient(bottom, $start, $stop);
background: -moz-linear-gradient(center bottom, $start 0%, $stop 100%);
background: -o-linear-gradient($stop, $start);
}