animation
mixins
animated
@mixin animated() { ... }
Description
Sets the main animation properties. Used in initialize-animation
Parameters
None.
Requires
- [variable]
animation-easing
- [variable]
animation-duration
Used by
- [mixin]
initialize-animation
fade-in
@mixin fade-in() { ... }
Description
Fades in element using opacity.
Parameters
None.
Used by
- [mixin]
initialize-animation
See
- [mixin]
initialize-animation
fade-in-up
@mixin fade-in-up() { ... }
Description
Fades in opacity and moves element up on the Y axis.
Parameters
None.
Used by
- [mixin]
initialize-animation
See
- [mixin]
initialize-animation
fade-in-down
@mixin fade-in-down() { ... }
Description
Fades in opacity and moves element up on the Y axis.
Parameters
None.
Used by
- [mixin]
initialize-animation
See
- [mixin]
initialize-animation
over-scale
@mixin over-scale() { ... }
Description
Creates an elastic scaling up bigger than 100% then resting to 100% size.
Parameters
None.
Used by
- [mixin]
initialize-animation
See
- [mixin]
initialize-animation
initialize-animation
@mixin initialize-animation($$max-delay-classes: 20) { ... }
Description
Put this on your document root to get a few nice animations. Warning: Creates classes in your css and styles them - not to be used inside an element.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$$max-delay-classes | Number of delay classes ( | Variable | 20 |
Example
@include initialize-animation();
Requires
- [mixin]
animated
- [mixin]
fade-in
- [mixin]
fade-in-up
- [mixin]
fade-in-down
- [mixin]
over-scale
Links
code
mixins
code
@mixin code($color: #DF5C33) { ... }
Description
Styles inline code snippets on your page. Defaults to a beautiful red, but can be passed any color.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$color | Text Color | Variable | #DF5C33 |
Example
code {
@include code(blue);
}
pre
@mixin pre() { ... }
Description
Some default styles for code blocks on your page. Takes not arguments
Parameters
None.
Example
pre {
@include pre();
}
layout
mixins
clearfix (aliased as cf
)
@mixin clearfix() { ... }
Description
Just your standard clearfix.
Parameters
None.
Example
@include clearfix();
Used by
- [mixin]
cf
- [mixin]
inline-list
cf (alias for clearfix
)
@mixin cf() { ... }
Refer to clearfix.
ratio-box
@mixin ratio-box($ratio: 1 / 1) { ... }
Description
This sets a specific width/height ratio. Useful on background images, iframes and Youtube embeds.
note: Any content inside ratio-box
will need to be positioned absolutely as not to change the aspect-ratio.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$ratio | Aspect ratio: height / width | Variable | 1 / 1 |
Example
figure {
@include ratio(16 / 9);
}
Links
full-page
@mixin full-page($height: 100vh, $max-height: 850px, $min-height: 600px) { ... }
Description
Create a responsive full page section with intelligent defaults. Resets on mobile.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$height | Page height | Variable | 100vh |
$max-height | Max page height | Variable | 850px |
$min-height | Min page height | Variable | 600px |
Example
section {
@include full-page();
}
section {
@include full-page(calc(100vh - 90px), 800px, 500px);
}
TODO's
- Have mobile reset be optional
Links
vertically-align
@mixin vertically-align($reset: Null) { ... }
Description
Cross browser vertical align. Works down to IE9.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$reset | Pass | Variable | Null |
Example
article {
@include vertically-align();
}
h4 {
@include vertically-align(false);
}
Links
rule
@mixin rule($color: rgba(#000, .15), $spacing: 1.5em) { ... }
Description
Clean reset for divider lines.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$color | Line color | Variable | rgba(#000, .15) |
$spacing | Margin above and below the line | Variable | 1.5em |
Example
hr {
@include rule();
}
hr.blue {
@include rule(blue);
}
TODO's
- $border-width param
table-layout
@mixin table-layout($layout-type: fixed) { ... }
Description
Sets element and its children to use table layout. An old but very powerful css property for flexible layout challenges.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$layout-type |
| Variable | fixed |
Example
ul {
@include table-layout();
}
Links
settings
variables
animation-duration
$animation-duration: .65s !default;
Description
Sets default duration for animations.
Type
Number (time)
Used by
- [mixin]
animated
animation-easing
$animation-easing: ease-out !default;
Description
Sets default duration for animations.
Type
Easing function
Used by
- [mixin]
animated
base-font-size
$base-font-size: 16px !default;
Description
Sets the base font size for rem calculations;
Type
Number (px)
Used by
- [function]
rem
table
mixins
table
@mixin table($border: true, $striped: true, $condensed: false) { ... }
Description
Ported directly from Twitter Bootstrap (by way of Axis), as they did an excellent job with the tables.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$border | Makes table bordered | Variable | true |
$striped | Adds zebra striping | Variable | true |
$condensed | Makes the table condensed | Variable | false |
Example
table {
@include table();
}
TODO's
- make hover effect optional
typography
mixins
inline-list
@mixin inline-list($spacing: 20px) { ... }
Description
For when you need your list to be horizontal.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$spacing | Amount of spacing between elements - can be whatever unit you like. | Variable | 20px |
Example
ul {
@include inline-list();
}
Requires
- [mixin]
clearfix
text-list
@mixin text-list($style: disc) { ... }
Description
We tend to spend a great deal of time resetting all of the properties for lists. This puts them back to roughly the same state as browser defaults. You can pass it any option that [list-style-type] (http://www.w3schools.com/cssref/pr_list-style-type.asp) would normally take.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$style | Amount of spacing between elements. can be whatever unit you like. | Variable | disc |
Example
ul {
@include text-list();
}
ul {
@include text-list('disc');
}
reset-list
@mixin reset-list() { ... }
Description
Resets the margins padding, and styles to list.
Parameters
None.
Example
ul {
@include reset-list();
}
ellipsis
@mixin ellipsis($width: 100%) { ... }
Description
Truncate text to the width of its container...
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$width | Width of the container can be whatever unit you like. | Variable | 100% |
Example
h3 {
@include ellipsis();
}
fluid-type
@mixin fluid-type($min-font-size: 12px, $max-font-size: 24px, $lower-range: 420px, $upper-range: 900px) { ... }
Description
Magic calc + vh combo to allow text to be fluid between minimum and maximum breakpoints.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$min-font-size | Minimum font size | Variable | 12px |
$max-font-size | Maximum font size | Variable | 24px |
$lower-range | Stop scaling font smaller at this screen resolution | Variable | 420px |
$upper-range | Stop scaling font larger at this screen resolution | Variable | 900px |
Example
h1 {
@include fluid-type(20px, 48px);
}
Links
ui
mixins
button
@mixin button($background-color: #00BFFF, $color: #FFF) { ... }
Description
A starting place for button styling.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$background-color | Button background color | Variable | #00BFFF |
$color | Button text color | Variable | #FFF |
Example
a.btn {
@include button();
}
a.yellow-button {
@include button(yellow, black);
}
utilities
functions
rem
@function rem($size) { ... }
Description
Calculates and returns the rem value based on px input. Default base font size is 16px, but can be changed with a global $base-font-size
variable.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$size | Size in pixels | Variable | —none |
Example
font-size: rem(30px);
// returns font-size: 1.875rem;
Requires
- [variable]
base-font-size
strip-unit
@function strip-unit($number) { ... }
Description
Sometimes it's just easier to do calculations with the unit is stripped.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$number | Number that has a unit | Number | —none |
Example
$length: 42px;
$value: strip-unit($length);
// -> 42
Links
luminance
@function luminance($color) { ... }
Description
Returns the luminance of $color
as a float (between 0 and 1) 1 is pure white, 0 is pure black
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$color | Color | Color | —none |
Returns
Number
Links
Author
Hugo Giradel
mixins
debug
@mixin debug() { ... }
Description
Debugging tool - adds a border to the current element, its children, grandchildren, etc so you can see what's up – great for precise layout tweaks. It will also add flags if you made mistakes like put in inline styles, forgot an alt on an image, left the alt blank, etc. Not to be used in production, obviously.
Parameters
None.
Example
.container-elment {
@include debug();
}
Links
triangle
@mixin triangle($direction: up, $size: 10px, $color: #000) { ... }
Description
Makes a little css triangle for you.
Parameters
parameterName | parameterDescription | parameterType | parameterDefault value |
---|---|---|---|
$direction | Direction of the triangle: up, down left or right | Variable | up |
$size | Size of the triangle | Variable | 10px |
$color | Color of the triangle | Variable | #000 |
Example
.element:after {
@include triangle();
}
span {
@include triangle(right, 8px, red);
}