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

271 lines
6.1 KiB

9 years ago
// AdminLTE mixins
// ===============
9 years ago
// Changes the color and the hovering properties of the navbar
@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;
9 years ago
// Navbar links
.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 {
color: $hover-color;
background: $hover-bg;
}
}
}
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;
color: $color;
border-bottom: $border-bottom-width solid $border-bottom-color;
&:hover {
background-color: darken($bg-color, 1%);
}
}
9 years ago
// Box solid color variantion creator
@mixin box-solid-variant($color, $text-color: #fff) {
border: 1px solid $color;
> .box-header {
color: $text-color;
background: $color;
background-color: $color;
a,
.btn {
color: $text-color;
}
}
}
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;
color: $color;
&:after,
&:before {
border-left-color: $bg-color;
}
}
}
9 years ago
// border radius creator
@mixin border-radius($radius) {
border-radius: $radius;
}
@mixin translate($x, $y) {
-webkit-transform: translate($x, $y);
-ms-transform: translate($x, $y); // IE9 only
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);
}
9 years ago
// Skins Mixins
9 years ago
// Dark Sidebar Mixin
@mixin skin-dark-sidebar($link-hover-border-color) {
// Sidebar background color (Both .wrapper and .left-side are responsible for sidebar bg color)
.main-sidebar,
9 years ago
.main-sidebar:before {
background-color: $sidebar-dark-bg;
}
9 years ago
// User Panel (resides in the sidebar)
.user-panel {
> .info, > .info > a {
color: #fff;
}
}
9 years ago
// Sidebar Menu. First level links
.nav-sidebar > .nav-item {
// links
> .nav-link {
border-left: 3px solid transparent;
9 years ago
&:active,
&:focus {
color: $sidebar-dark-color;
}
}
9 years ago
// Hover and active states
&:hover > .nav-link,
&.active > .nav-link {
color: $sidebar-dark-hover-color;
background: $sidebar-dark-hover-bg;
border-left-color: $link-hover-border-color;
}
9 years ago
// First Level Submenu
> .nav-treeview {
margin: 0 1px;
background: $sidebar-dark-submenu-bg;
}
}
9 years ago
// Section Headning
.nav-header {
color: darken($sidebar-dark-color, 20%);
background: inherit;//darken($sidebar-dark-bg, 3%);
}
// All links within the sidebar menu
.sidebar a {
color: $sidebar-dark-color;
&:hover {
text-decoration: none;
}
}
9 years ago
// All submenus
.nav-treeview {
> .nav-item {
> .nav-link {
color: $sidebar-dark-submenu-color;
}
9 years ago
&.active > .nav-link,
> .navlink:hover {
color: $sidebar-dark-submenu-hover-color;
}
}
}
9 years ago
// Sidebar form
.sidebar-form {
9 years ago
.form-control {
background: $sidebar-dark-hover-bg;
border: 0;
color: $sidebar-dark-hover-color;
padding: 10px 10px;
&:focus {
background: lighten($sidebar-dark-bg, 3%);
}
}
}
}
9 years ago
// Light Sidebar Mixin
@mixin skin-light-sidebar($icon-active-color) {
9 years ago
// Sidebar background color
.main-sidebar,
9 years ago
.main-sidebar:before {
background-color: $sidebar-light-bg;
}
.content-wrapper,
.main-footer {
border-left: 1px solid $gray;
}
9 years ago
// User Panel (resides in the sidebar)
.user-panel {
9 years ago
> .info,
> .info > .nav-link {
color: $sidebar-light-color;
}
}
9 years ago
// Sidebar Menu. First level links
.sidebar-menu > .nav-item {
transition: border-left-color .3s ease;
9 years ago
// links
> .nav-link {
border-left: 3px solid transparent;
font-weight: 600;
9 years ago
&:focus {
color: $sidebar-light-color;
}
}
9 years ago
// Hover and active states
&:hover > .nav-link,
&.active > .nav-link {
color: $sidebar-light-hover-color;
background: $sidebar-light-hover-bg;
}
9 years ago
&:hover > .nav-link {
}
&.active {
border-left-color: $icon-active-color;
9 years ago
> .nav-link {
font-weight: 600;
}
}
9 years ago
// First Level Submenu
> .nav-treeview {
background: $sidebar-light-submenu-bg;
}
}
9 years ago
// Section Headning
.nav-header {
color: lighten($sidebar-light-color, 25%);
background: $sidebar-light-bg;
}
// All links within the sidebar menu
.sidebar .nav-link {
color: $sidebar-light-color;
&:hover {
text-decoration: none;
}
}
9 years ago
// All submenus
.nav-treeview {
> .nav-item {
> .nav-link {
color: $sidebar-light-submenu-color;
}
9 years ago
&.active > .nav-link,
> .nav-link:hover {
color: $sidebar-light-submenu-hover-color;
}
9 years ago
&.active > .nav-link {
font-weight: 600;
}
}
}
9 years ago
@include media-breakpoint-up(sm) {
&.sidebar-mini.sidebar-collapse {
9 years ago
.sidebar-menu > li > .nav-treeview {
border-left: 1px solid $gray;
}
}
}
}