Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Black Mirror committed Apr 30, 2018
1 parent a41b878 commit 20044b3
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 16 deletions.
28 changes: 15 additions & 13 deletions docs/index.html

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions scss/core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@
@return $d and not is-null($d);
}

// Helper function
// Return null rather than throwing an error if index is outside list range.
/// nth-value Helper function
/// <br>Return $default rather than throwing an error if index is not available in the list.
///
/// @param {array | list} $list - the haystack list to check
/// @param {integer} $index - the needle index
/// @param {any} $default [null] - the default value to fallback
/// @return {any}
@function nth-value($list, $index, $default: null) {
@return if(length($list) >= $index, nth($list, $index), $default);
}
Expand Down
2 changes: 2 additions & 0 deletions scss/mixins/_animation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,11 @@ $animation-play-state-modes: array-concat((paused, running), $css-default-modes)
/// @param {string} $options.timing-function [ease] - animation timing function (easing)
/// @param {string} $options.fill-mode [forwards] - animation fill mode
/// @param {string} $options.play-state [initial] - animation play state
/// @requires {function} extend
/// @requires {function} is-defined
/// @requires {function} is-animation-time
/// @requires {function} is-animation-direction
/// @requires {function} nth-value
/// @requires {mixin} prefixer
/// @example scss - Usage
/// .animated-element {
Expand Down
4 changes: 4 additions & 0 deletions scss/mixins/_background.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ $background-position-vertical-modes: array-concat((top, center, bottom), $css-de
/// @access public
/// @param {string | array} $bp - the background position value/values
/// @link https://www.w3schools.com/cssref/pr_background-position.asp W3Schools background-position docs
/// @requires {function} nth-value
/// @return {boolean}
@function is-background-position($bp) {
@if is-defined($bp) {
Expand Down Expand Up @@ -68,6 +69,7 @@ $background-size-modes: array-concat((auto, cover, contain), $css-default-modes)
/// @access public
/// @param {string | array} $bs - the background size value/values
/// @link https://www.w3schools.com/cssref/css3_pr_background-size.asp W3Schools background-size docs
/// @requires {function} nth-value
/// @return {boolean}
@function is-background-size($bs) {
@if is-defined($bs) {
Expand Down Expand Up @@ -149,8 +151,10 @@ $background-attachment-modes: array-concat((scroll, fixed, local), $css-default-
/// @param {string} $options.clip [border-box] - background clip
/// @param {string} $options.attachment [scroll] - background attachment
/// @param {boolean} $shorthand [false] - specifies if shorthand selector will be used or not
/// @requires {function} extend
/// @requires {function} is-defined
/// @requires {function} is-background-origin-clip
/// @requires {function} nth-value
/// @example scss - Usage
/// .background-element {
/// @include background(null url('http://test.com/image.png') null cover no-repeat null null fixed);
Expand Down
4 changes: 3 additions & 1 deletion scss/mixins/_border.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ $border-styles: array-concat((none, hidden, dotted, dashed, solid, double, groov
/// @todo manage fractions (e.g. 2em 1em 4em / 0.5em 0.2em)
/// @requires {function} is-defined
/// @requires {function} is-border-radius-value
/// @requires {function} nth-value
/// @requires {mixin} prefixer
/// @example scss - Usage - One value
/// .border-radius-element {
Expand Down Expand Up @@ -272,9 +273,10 @@ $border-modes: array-concat((none), $css-default-modes);
/// @param {color} $options.color [transparent] - border-color
/// @param {size} $options.radius [null] - border-radius
/// @link https://www.w3schools.com/cssref/pr_border.asp W3Schools border docs
/// @requires {function} is-defined
/// @requires {function} extend
/// @requires {function} get
/// @requires {function} is-defined
/// @requires {function} nth-value
/// @example scss - Usage
/// .border-element {
/// @include border(1px null red);
Expand Down
6 changes: 6 additions & 0 deletions scss/mixins/_box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ $box-bound-size-modes: array-concat((none), $css-default-modes);
/// @param {size | percentage} $options.min-height [null] - the min height bound
/// @param {size | percentage} $options.max-width [null] - the max width bound
/// @param {size | percentage} $options.max-height [null] - the max height bound
/// @requires {function} extend
/// @requires {function} nth-value
/// @example scss - Usage
/// .bounds-element {
/// @include box-bounds(10% null null 610px);
Expand Down Expand Up @@ -265,6 +267,8 @@ $box-bound-size-modes: array-concat((none), $css-default-modes);
/// @param {size | percentage} $options.max-width [null] - the max width bound
/// @param {size | percentage} $options.max-height [null] - the max height bound
/// @param {boolean} $height-fallback [true] - falls back the height value to the width value, if height is not specified (useful for square sizes)
/// @requires {function} extend
/// @requires {function} nth-value
/// @example scss - Usage - height fallback
/// .size-element {
/// @include box-size(100px);
Expand Down Expand Up @@ -395,6 +399,8 @@ $box-bound-size-modes: array-concat((none), $css-default-modes);
/// @param {object | map} $options - the box color options
/// @param {color} $options.color [inherit] - the color
/// @param {color} $options.bgcolor [inherit] - the background color
/// @requires {function} extend
/// @requires {function} nth-value
/// @example scss - Usage
/// .color-element {
/// @include box-color(#ffa transparent);
Expand Down
1 change: 1 addition & 0 deletions scss/types/_object.scss
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
/// @access public
/// @param {object | map} $o - the object to modify in
/// @param {object | map} $objects - the objects to merge in
/// @requires {function} is-object
/// @example scss - Usage
/// $o1: (
/// prop1: (
Expand Down

0 comments on commit 20044b3

Please sign in to comment.