Here's set of userful mixins and functions I use in my projects. Feel free to contribute and use.
_all.scss includes all mixins and functions available in this repository.
Warning: This is a
function.
Get material design color
Params:
- color-name - quoted, lower-case, dasherized color name (e.g. 'pink', 'amber')
- quoted, lowercase color variant (e.g. '200', 'a100')
// Example usage:
.my-class {
color: md-color('pink', '500');
}This is a special file which includes multiple functions and some constants related to math.
3.14159265
2.71828183
2.30258509
Factorial of $value.
Calls function $iteratee with first argument as $input and second as number of iteration and then sum all results.
This is used for series.
Calculate exponent function of $value.
Calculate natural logarithm of $value.
Calculate the base $base logarithm of $value.
Calculate $base in power of $exponent.
Calculate square root of $value.
Convert any angle to radians without unit. Supports: 'rad', 'deg', 'grad', 'turn'.
This is used for trigonometric functions.
Convert units of $angle. Supports: 'rad', 'deg', 'grad', 'turn'.
Sine of $angle.
Cosine of $angle.
Tangent of $angle.
Alias for tan($angle).
Arcsine of $z.
Arccosine of $z.
Arctangent of $z.
Alias for arcsin($z).
Alias for arccos($z).
Alias for arctan($z).
atan2 function.
Used to wrap keyframes block into vendor prefixed versions:
@include keyframes($name) {
// content
}Used to wrap animation directives into vendor prefixed versions:
@include animation($name,
$duration,
$timing-function: ease-in-out,
$delay: 0,
$direction: normal,
$iteration-count: infinite,
$fill-mode: none,
$play-state: running);Used to wrap calc directive into vendor prefixed versions:
// Example usage:
.my-class {
@include calc(width, 100% - 10px);
}Center object using flexbox:
@include center($align-items-to-center: false);Center object using margin:
@include center-margin;Create flexbox:
@include flex($display: flex,
$flex-direction: row,
$flex-wrap: nowrap,
$justify-content: flex-start,
$align-items: stretch,
$align-content: stretch);Style a element colors depending on their mode:
@include link($normal: null,
$hover: null,
$active: null,
$focus: null,
$visited: null,
$text-decoration: null);Create gradient with two colored lines:
@include makeLinesGradient($angle: 135deg,
$base-color: #ffffff00,
$secondary-color: #ffffff00);Reset margin and padding. Set $list-fix to true if you need to remove list bullets:
@include normalize($list-fix: false);Create hard size declaration with same min- max- and pure directive.
Set height:
@include threeHeight($height); Set width:
@include threeWidth($width);