Marrakech
Marrakech is a collection of common Sass helper mixins and functions helping you write more maintainable styles ✨
Why
Writing styles can be repetitive and slow. Marrakech's collection of mixins makes it easy and fast to write more DRY code.
Table of Contents
- Requirements
- Documentation
- Contributors
- License
Requirements
Documentation
Aspect Ratio
Set a aspect ratio for an element
- @mixin aspect-ratio([width], [height]);
Parameters
Parameter | Type | Default | Optional |
---|---|---|---|
width | number | - | No |
height | number | - | No |
Example
/** Usage */.youtube-fluid
/** Output */
Border Radius
A shorhand syntax for adding border radius to different sides of an element
- @mixin border-top-radius([radius]);
- @mixin border-right-radius([radius]);
- @mixin border-bottom-radius([radius]);
- @mixin border-left-radius([radius]);
Parameters
Parameter | Type | Default | Optional |
---|---|---|---|
radius | Border radius size | - | No |
Example
/** Usage */.box-1 .box-2 .box-3 .box-4
/** Output */
Border Width
A shorthand syntax for setting different border widths on each side of an element
- @mixin border-width([widths]);
Parameters
Parameter | Type | Default | Optional |
---|---|---|---|
widths | List of border width sizes | - | No |
Example
/** Usage */.box
/** Output */
Center
Center an element vertically and horizontally relative to closest positioned parent
- @mixin center;
Example
/** Usage */.box
/** Output */
Center Block
Center a block element with a display horizontally
- @mixin center-block;
Example
/** Usage */.box
/** Output */
Circle
Create a circle shape
- @mixin circle([diameter], [color]);
Parameters
Parameter | Type | Default | Optional |
---|---|---|---|
diameter | size | - | No |
color | color | #000 | Yes |
Example
/** Usage */.circle
/** Output */
Clearfix
Clearfix hack clears floated child elements without extra markup
- @mixin clearfix;
Example
/** Usage */.clearfix
/** Output */
Hide Visually
Hides element and makes the content only visible to screen readers
- @mixin hide-visually;
Example
/** Usage */.sr-only
/** Ouput */
Hide Text
- @mixin hide-text;
Example
/** Usage */.logo
/** Ouput */
Margin
A shorthand way of adding individual margins
- @mixin margin([margins]);
Parameters
Parameter | Type | Default | Optional |
---|---|---|---|
margins | List of sizes (4) | - | No |
Example
/** Usage */.box
/** Ouput */
Modular Scale
Modular scale calculator for consistent typographical scale http://www.modularscale.com/
- @function modular-scale([increment], [ratio], [value]);
Parameters
Parameter | Type | Default | Optional |
---|---|---|---|
increment | integer | - | No |
ratio | number | 1.25 (4:5) | Yes |
value | size | 1rem | Yes |
Example
/** Usage */h1 h2 h3 h4 h5 h6
/** Ouput */
Padding
A shorthand way of adding individual paddings
- @mixin padding([paddings]);
Parameters
Parameter | Type | Default | Optional |
---|---|---|---|
paddings | List of sizes (4) | - | No |
Example
/** Usage */.box
/** Ouput */
Position
A shorthand syntax for defining an elements position and its lenghts
- @mixin position([position], [lengths]);
Parameters
Parameter | Type | Default | Optional |
---|---|---|---|
position | CSS position value | - | No |
lengths | map of lengths | - | No |
Example
/** Usage */.box
/** Ouput */
Size
Set the height and width of an element in one line
- @mixin size([width], [height]);
Parameters
Parameter | Type | Default | Optional |
---|---|---|---|
width | unit size | - | No |
height | unit size | width | Yes |
Example
/** Usage */.square .rectangle
/** Ouput */
System UI Font
Get a list of font list to enable system UI font
- @function system-ui-font;
Example
/** Usage */body
/** Ouput */
Timing
Extra cubic-bezier timing functions for animations and transitions
- @function timing([timing-function]);
Parameters
Parameter | Type | Default | Optional |
---|---|---|---|
timing-function | timing function name | - | No |
Timing functions
- ease-in-quad
- ease-in-cubic
- ease-in-quart
- ease-in-quint
- ease-in-sine
- ease-in-expo
- ease-in-circ
- ease-in-back
- ease-out-quad
- ease-out-cubic
- ease-out-quart
- ease-out-quint
- ease-out-sine
- ease-out-expo
- ease-out-circ
- ease-out-back
- ease-in-out-quad
- ease-in-out-cubic
- ease-in-out-quart
- ease-in-out-quint
- ease-in-out-sine
- ease-in-out-expo
- ease-in-out-circ
- ease-in-out-back
Example
/** Usage */.box
/** Ouput */
Triangle
Create a triangle facing up, down, right, left, up-right, up-left, down-right or down-left
- @mixin triangle([size], [color], [direction]);
Parameters
Parameter | Type | Default | Optional |
---|---|---|---|
size | size | - | No |
color | color | - | No |
direction | up, down, right, left, up-right, up-left, down-right or down-left | - | No |
Example
/** Usage */.triangle
/** Ouput */
Truncate
Truncate overflowing text and add a ellipsis
- @mixin truncate;
Example
/** Usage */.foo
/** Ouput */
UI Color
Get a UI color from the Open Color scheme https://yeun.github.io/open-color/
- @function ui-color([color], [shade], [opacity]);
Parameters
Parameter | Type | Default | Optional |
---|---|---|---|
color | gray, red, pink, grape, violet, indigo, blue, cyan, teal, green, lime, yellow or orange | - | No |
shade | 0-9 | 5 | Yes |
opacity | 0-1 | 1 | Yes |
Example
/** Usage */.box
/** Ouput */
Word wrap
A shorhand way of changing the word-wrap property
- @mixin word-wrap([wrap]);
Parameters
Parameter | Type | Default | Optional |
---|---|---|---|
wrap | normal, break-word, initial or inherit | break-word | Yes |
Example
/** Usage */.foo
/** Ouput */
Contributors
License
MIT