2014-07-19 22:33:48 +04:00
|
|
|
//
|
2014-10-26 20:07:35 +03:00
|
|
|
// Mixins
|
2014-07-19 22:33:48 +04:00
|
|
|
// --------------------------------------------------
|
2014-05-21 21:17:39 +04:00
|
|
|
|
2014-10-26 20:07:35 +03:00
|
|
|
|
|
|
|
// Baseline margin
|
2014-05-21 21:17:39 +04:00
|
|
|
@mixin baseline {
|
|
|
|
margin: 1.6em 0;
|
2014-08-04 19:57:33 +04:00
|
|
|
}
|
|
|
|
|
2014-10-26 20:07:35 +03:00
|
|
|
|
|
|
|
// Fix for clearing float-based overflows
|
2014-08-26 14:56:02 +04:00
|
|
|
@mixin clearfix {
|
2014-10-26 20:07:35 +03:00
|
|
|
&:after {
|
|
|
|
content: "";
|
|
|
|
display: table;
|
|
|
|
clear: both;
|
|
|
|
}
|
2014-08-26 14:56:02 +04:00
|
|
|
}
|
|
|
|
|
2014-08-04 19:57:33 +04:00
|
|
|
|
|
|
|
// WebKit-style focus
|
2014-10-26 20:07:35 +03:00
|
|
|
// From Bootstrap
|
2014-08-04 19:57:33 +04:00
|
|
|
@mixin tab-focus() {
|
2014-10-26 20:07:35 +03:00
|
|
|
// Default
|
|
|
|
outline: thin dotted;
|
|
|
|
// WebKit
|
|
|
|
outline: 0px auto -webkit-focus-ring-color;
|
|
|
|
outline-offset: -2px;
|
2014-08-04 19:57:33 +04:00
|
|
|
}
|
2014-08-05 18:12:27 +04:00
|
|
|
|
|
|
|
|
2014-10-26 20:07:35 +03:00
|
|
|
// Simple SCSS mixin to create CSS triangles
|
|
|
|
// Example: @include css-triangle (10px, #fff, "up");
|
|
|
|
@mixin triangle($size: 20px, $color: #000, $direction: "down", $type: "normal") {
|
2014-09-29 15:17:27 +04:00
|
|
|
$verticalSize: $size;
|
2014-08-26 14:56:02 +04:00
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
|
2014-09-29 15:17:27 +04:00
|
|
|
@if $type == "shallow" {
|
|
|
|
$verticalSize: floor($size * $popover_triangle_shallow_multiplier);
|
|
|
|
}
|
|
|
|
|
2014-08-26 14:56:02 +04:00
|
|
|
@if $direction == "down" {
|
|
|
|
border-left: $size solid #{setTriangleColor($direction, "left", $color)};
|
|
|
|
border-right: $size solid #{setTriangleColor($direction, "right", $color)};
|
2014-09-29 15:17:27 +04:00
|
|
|
border-top: $verticalSize solid #{setTriangleColor($direction, "top", $color)};
|
2014-08-26 14:56:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
@if $direction == "up" {
|
|
|
|
border-left: $size solid #{setTriangleColor($direction, "left", $color)};
|
|
|
|
border-right: $size solid #{setTriangleColor($direction, "right", $color)};
|
2014-09-29 15:17:27 +04:00
|
|
|
border-bottom: $verticalSize solid #{setTriangleColor($direction, "bottom", $color)};
|
2014-08-26 14:56:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
@if $direction == "left" {
|
2014-09-29 15:17:27 +04:00
|
|
|
border-right: $verticalSize solid #{setTriangleColor($direction, "right", $color)};
|
2014-08-26 14:56:02 +04:00
|
|
|
border-top: $size solid #{setTriangleColor($direction, "top", $color)};
|
|
|
|
border-bottom: $size solid #{setTriangleColor($direction, "bottom", $color)};
|
|
|
|
}
|
|
|
|
|
|
|
|
@if $direction == "right" {
|
2014-09-29 15:17:27 +04:00
|
|
|
border-left: $verticalSize solid #{setTriangleColor($direction, "left", $color)};
|
2014-08-26 14:56:02 +04:00
|
|
|
border-bottom: $size solid #{setTriangleColor($direction, "bottom", $color)};
|
|
|
|
border-top: $size solid #{setTriangleColor($direction, "top", $color)};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-10-26 20:07:35 +03:00
|
|
|
// Utility function to return the relevant colour depending on what type of arrow it is
|
|
|
|
@function setTriangleColor($direction, $side, $color) {
|
2014-08-26 14:56:02 +04:00
|
|
|
@if $direction == "left" and $side == "right"
|
|
|
|
or $direction == "right" and $side == "left"
|
|
|
|
or $direction == "down" and $side == "top"
|
|
|
|
or $direction == "up" and $side == "bottom" {
|
|
|
|
@return $color
|
|
|
|
} @else {
|
|
|
|
@return "transparent";
|
|
|
|
}
|
|
|
|
}
|