diff --git a/CHANGELOG.md b/CHANGELOG.md index 21e9a3c..9222865 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +### 2.0.2 10/1/14 +* Reversed order that `map-merge` merges instance maps, so that newer instances are merged to the top rather than the bottom. Increased performance benchmarks by `23%`. +* Added Ruby function for `map-fetch()`. Increased performance benchmarks by `15%`. +* Updated main API mixin `_()` to follow SassDoc standards. + ### 2.0.1 - 9/25/14 * Updated Sass dependency to `~> 3.4` in gemspec. * Ignore `test` folder in bower. diff --git a/bower.json b/bower.json index 77fa2cb..7044d62 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "flint", - "version": "2.0.0", + "version": "2.0.2", "main": "stylesheets/_flint.scss", "description": "Flint is a highly advanced Sass grid framework designed for rapid responsive development.", "authors": ["Ezekiel Gabrielse "], diff --git a/lib/flint.rb b/lib/flint.rb index 6d0ace4..d9e722f 100755 --- a/lib/flint.rb +++ b/lib/flint.rb @@ -10,8 +10,8 @@ end module Flint - VERSION = "2.0.1" - DATE = "2014-09-25" + VERSION = "2.0.2" + DATE = "2014-10-01" end module Sass::Script::Functions @@ -26,29 +26,46 @@ def flint_use_ruby() end ### - # Turns string into a flat list + # Fetch value from map # - # @param {String} string - string + # @param {Map} map - map to fetch value from + # @param {ArgList} keys - list of keys to traverse + # + # @return {String | False} + ### + def flint_ruby_map_fetch(map, *keys) + assert_type map, :Map, :map + result = map + keys.each {|key| result != nil ? result = result.to_h.fetch(key, nil) : break} + return result != nil ? result : Sass::Script::Bool.new(false) + end + declare :flint_ruby_map_fetch, :args => [:map, :keys], :var_args => true + + ### + # Turn string into a flat list + # + # @param {String} string - string to operate on # @param {String} separator - item to find which separates substrings # @param {String} ignore - removes remaining string beyond item # # @return {List} ### - def string_to_list(string, separator, ignore) - # Remove rest of string after ignore - ignore = string.value[/[^#{ignore}]+/] - # Get first set of strings, convert to array by separator - items = ignore.split(separator.value) - # Convert array to list + def flint_ruby_string_to_list(string, separator, ignore) + assert_type string, :String, :string + assert_type separator, :String, :separator + assert_type ignore, :String, :ignore + # Remove everything after ignore, split with separator + items = string.value[/[^#{ignore}]+/].split(separator.value) if items.count == 1 Sass::Script::String.new(items[0], :comma) else Sass::Script::List.new(items.map { |i| Sass::Script::String.new(i) }, :comma) end end + declare :flint_ruby_string_to_list, :args => [:string, :separator, :ignore] ### - # Replace substring + # Replace substring with string # # @param {String} string - string that contains substring # @param {String} find - substring to replace @@ -56,11 +73,12 @@ def string_to_list(string, separator, ignore) # # @return {String} ### - def replace_substring(string, find, replace) + def flint_ruby_replace_substring(string, find, replace) + assert_type string, :String, :string + assert_type find, :String, :find + assert_type replace, :String, :replace Sass::Script::String.new(string.value.gsub(find.value, replace.value)) end - - declare :string_to_list, [:string, :separator, :ignore] - declare :replace_substring, [:string, :find, :replace] + declare :flint_ruby_replace_substring, :args => [:string, :find, :replace] end diff --git a/stylesheets/flint/config/_config.scss b/stylesheets/flint/config/_config.scss index 327b51c..832620b 100755 --- a/stylesheets/flint/config/_config.scss +++ b/stylesheets/flint/config/_config.scss @@ -1,10 +1,13 @@ /** * Configuration map * + * @type Map + * * @prop {Map} breakpoints - map of breakpoints, follow DSC order * @prop {Map} breakpoints.alias - named map of breakpoint settings * @prop {Number} breakpoints.alias.columns - column count for breakpoint * @prop {Number} breakpoints.alias.breakpoint - breakpoint value for breakpoint + * * @prop {Map} settings - map of settings for grid * @prop {String} settings.default - alias of breakpoint to be grid default * @prop {String} settings.grid - type of grid diff --git a/stylesheets/flint/functions/lib/_instance.scss b/stylesheets/flint/functions/lib/_instance.scss index 6fad074..a41b216 100755 --- a/stylesheets/flint/functions/lib/_instance.scss +++ b/stylesheets/flint/functions/lib/_instance.scss @@ -39,5 +39,5 @@ ) ); - @return map-merge($flint__instances, $flint__instance); + @return map-merge($flint__instance, $flint__instances); } diff --git a/stylesheets/flint/functions/lib/_map-fetch.scss b/stylesheets/flint/functions/lib/_map-fetch.scss index 02a6efd..c1cbe4a 100755 --- a/stylesheets/flint/functions/lib/_map-fetch.scss +++ b/stylesheets/flint/functions/lib/_map-fetch.scss @@ -9,11 +9,21 @@ * @return {String | False} */ @function flint-map-fetch($map, $keys...) { - $result: $map; - @each $key in $keys { - $result: flint-is-map($result) and map-has-key($result, $key) and map-get($result, $key) or false; - } + // Use Ruby function if available + @if $flint__use-ruby-functions { + @return flint_ruby_map_fetch($map, $keys...); + } @else { + $result: $map; + + @each $key in $keys { + @if $result { + $result: flint-is-map($result) and map-has-key($result, $key) and map-get($result, $key) or false; + } @else { + @return false; + } + } - @return $result; + @return $result; + } } diff --git a/stylesheets/flint/functions/lib/_replace-substring.scss b/stylesheets/flint/functions/lib/_replace-substring.scss index 3a85400..acf7073 100755 --- a/stylesheets/flint/functions/lib/_replace-substring.scss +++ b/stylesheets/flint/functions/lib/_replace-substring.scss @@ -13,7 +13,7 @@ // Use Ruby function if available @if $flint__use-ruby-functions { - @return replace_substring($string, $substring, $new-substring); + @return flint_ruby_replace_substring($string, $substring, $new-substring); } @else { // Loop through length of string @for $i from 1 through str-length($string) { diff --git a/stylesheets/flint/functions/lib/_string-to-list.scss b/stylesheets/flint/functions/lib/_string-to-list.scss index dab109d..ef8b292 100755 --- a/stylesheets/flint/functions/lib/_string-to-list.scss +++ b/stylesheets/flint/functions/lib/_string-to-list.scss @@ -3,7 +3,7 @@ * * @access private * - * @param {String} $string + * @param {String} $string - string to perform on * @param {String} $find (" ") - item to find which separates substrings * @param {String} $ignore (",") - removes remaining string beyond item * @@ -14,7 +14,7 @@ // Use Ruby function if available @if $flint__use-ruby-functions { - @return string_to_list($string, $find, $ignore); + @return flint_ruby_string_to_list($string, $find, $ignore); } @else { $string-list: (); $space-indexes: (); diff --git a/stylesheets/flint/functions/lib/_support-syntax.scss b/stylesheets/flint/functions/lib/_support-syntax.scss index aa1db1a..67e2f77 100644 --- a/stylesheets/flint/functions/lib/_support-syntax.scss +++ b/stylesheets/flint/functions/lib/_support-syntax.scss @@ -12,13 +12,11 @@ $syntax: to-lower-case($syntax); // Make sure syntax is supported - // ---- @if function-exists("flint-support-syntax-#{$syntax}") { // Support syntax - // ---- - // @warning : be sure you have created a custom function to support an unknown syntax - // ---- + // + // WARNING: Be sure you have created a custom function to support an unknown syntax @return call("flint-support-syntax-#{$syntax}", $selectors); } @else { diff --git a/stylesheets/flint/functions/lib/_types-in-list.scss b/stylesheets/flint/functions/lib/_types-in-list.scss index e0595d4..14df822 100644 --- a/stylesheets/flint/functions/lib/_types-in-list.scss +++ b/stylesheets/flint/functions/lib/_types-in-list.scss @@ -13,11 +13,9 @@ @if flint-is-list($list) { // Assert types in list? - // ---- @if $assert-types { // Assert length of list? - // ---- @if $assert-length { // Get length of list $length: length($list); @@ -28,11 +26,9 @@ $types: (); // List of asserted types? - // ---- @if flint-is-list($assert-types) { // Make sure length of types match list - // ---- @if length($assert-types) == $length { // Loop over each item in list @@ -49,13 +45,11 @@ } // Lengths did not match - // ---- } @else { @return false; } // Assert a single type across list - // ---- } @else { // Assert single type $type: nth($assert-types, 1); @@ -82,7 +76,6 @@ } // Just assert types in list, any length - // ---- } @else { // Get asserted type $type: $assert-types; @@ -100,7 +93,6 @@ } // Just assert type of first item in list - // ---- } @else { // Get type of first item in list $type: type-of(nth($list, 1)); @@ -115,6 +107,7 @@ @return true; } + // Was not a list, return false } @else { @return false; diff --git a/stylesheets/flint/globals/_globals.scss b/stylesheets/flint/globals/_globals.scss index 5609f36..74962a9 100755 --- a/stylesheets/flint/globals/_globals.scss +++ b/stylesheets/flint/globals/_globals.scss @@ -1,100 +1,100 @@ -/* +/** * Use development mode to silence fatal errors * * @access private * - * @type {Bool} + * @type Bool */ $flint__development-mode: false !global; -/* +/** * Set global variable to check if foundation has been set * * @access private * - * @type {String} + * @type String */ $flint__foundation: "non-existent" !global; -/* - * Gather all keys, breakpoints and column counts - * - * @access private - * - * @type {List} - */ -$flint__all-keys: flint-get-all-keys() !global; -$flint__all-breakpoints: flint-get-all-breakpoints() !global; -$flint__all-columns: flint-get-all-columns() !global; - -/* +/** * Keep count of all instances * * @access private * - * @type {Number} + * @type Number */ $flint__instance-count: 0 !global; -/* +/** * Keep map of all instances * * @access private * - * @type {Map} + * @type Map */ $flint__instances: () !global; -/* +/** * Font size for em calculation * * @access private * - * @type {Number} + * @type Number */ $flint__base-font-size: 16px !global; -/* +/** + * Detect if Ruby functions are available + * + * @access private + * + * @type Bool + */ +$flint__use-ruby-functions: if(flint-use-ruby-functions() == true, true, false) !global; + +/** * Global syntax support * * @access private * - * @type {String} + * @type String */ $flint__support-syntax: flint-get-value("settings", "support-syntax") !global; -/* - * Detect if Ruby functions are available +/** + * Gather all keys, breakpoints and column counts * * @access private * - * @type {Bool} + * @type List */ -$flint__use-ruby-functions: if(flint-use-ruby-functions() == true, true, false) !global; +$flint__all-keys: flint-get-all-keys() !global; +$flint__all-breakpoints: flint-get-all-breakpoints() !global; +$flint__all-columns: flint-get-all-columns() !global; -/* +/** * Cache selector instance lists * * @access private * - * @type {Map} + * @type Map */ $flint__cached-instances: () !global; -/* +/** * Cache calculated values * * @access private * - * @type {Map} + * @type Map */ $flint__cached-values: () !global; -/* +/** * Cache calculation results * * @access private * - * @type {Map} + * @type Map */ $flint__cache-results: () !global; diff --git a/stylesheets/flint/mixins/lib/_main.scss b/stylesheets/flint/mixins/lib/_main.scss index 636eceb..f68a205 100755 --- a/stylesheets/flint/mixins/lib/_main.scss +++ b/stylesheets/flint/mixins/lib/_main.scss @@ -8,6 +8,78 @@ * @param {String | Number | List} $context - context value of span * @param {String | List} $gutter - alias for gutter modifier * + * @throws error if list lengths do not match number of breakpoints + * + * @example scss - Clearfix + * _(clear) + * + * @example scss - Foundation + * _(foundation) + * + * @example scss - Container + * _(container) + * + * @example scss - Recursive shorthand with no context + * _(2) + * + * @example scss - Recursive shorthand with identical context + * _(2, 4) + * + * @example scss - Recursive shorthand with differing context + * _(1, 2 4 6 8) + * _(1, auto) + * + * @example scss - Variable shorthand with no context + * _(1 2 3 4) + * + * @example scss - Variable shorthand with identical context + * _(1 2 3 4, 4) + * _(1 2 3 4, auto) + * + * @example scss - Variable shorthand with differing context + * _(4 3 2 1, 8 6 4 2) + * _(4 3 2 1, auto) + * + * @example scss - Call by alias with no context + * _(desktop, 2) + * + * @example scss - Call by alias with context + * _(desktop, 2, 4) + * _(desktop, 2, auto) + * + * @example scss - Call $key breakpoint by alias + * _($key) + * + * @example scss - From $key breakpoint to infinity + * _(from $key to infinity) + * + * @example scss - From $key-x breakpoint to $key-y breakpoint + * _(from $key-x to $key-y) + * + * @example scss - From $num-x to $num-y + * _(from $num-x to $num-y) + * + * @example scss - Greater than $key breakpoint + * _(greater than $key) + * + * @example scss - Greater than number + * _(greater than $num) + * + * @example scss - Number greater than $key breakpoint + * _($num greater than $key) + * + * @example scss - Less than $key breakpoint + * _(less than $key) + * + * @example scss - Less than number + * _(less than $num) + * + * @example scss - Number less than $key breakpoint + * _($num less than $key) + * + * @example scss - For $key-x $key-y $key-z + * _(for $key-x $key-y $key-z) + * * @author Ezekiel Gabrielse * @link http://flint.gs */ @@ -18,15 +90,8 @@ $gutter: null ) { - /** - * Clearfix instance - * Uses `clearfix` mixin if one already exists, - * else falls back to packaged. - * - * @param {String} - * - * @example scss - * _(clear) + /* + * Clearfix */ @if $key == "clear" or $span == "clear" or $context == "clear" { @@ -70,15 +135,8 @@ } } - /** - * Foundation instance - * Uses `box-sizing` mixin if one already exists, - * else falls back to packaged. - * - * @param {String} - * - * @example scss - * _(foundation) + /* + * Foundation */ @if $key == "foundation" { @@ -97,13 +155,8 @@ } } - /** - * Container instance - * - * @param {String} - * - * @example scss - * _(container) + /* + * Container */ } @else if $key == "container" or $span == "container" or $context == "container" { @@ -209,78 +262,36 @@ @include _("foundation"); } - /** + /* * Recursive shorthand with no context - * - * @param {Number} $key - single span value for all breakpoints - * @param {Null} $span - null context value - * - * @example scss - * _(2) */ @if flint-is-number($key) and length($key) == 1 and $span == null - /** + /* * Recursive shorthand with identical context - * - * @param {Number} $key - single span value for all breakpoints - * @param {Number | String} $span - single context value for all breakpoints - * - * @example scss - * _(2, 4) */ or flint-is-number($key) and length($key) == 1 and flint-is-number($span) and length($span) == 1 or flint-is-number($key) and length($key) == 1 and $span == "auto" - /** + /* * Recursive shorthand with differing context - * - * @param {Number} $key - single span value for all breakpoints - * @param {List | String} $span - context value of span for each breakpoint - * - * @example scss - * _(1, 2 4 6 8) | _(1, auto) - * - * @throws error if lengths do not match number of breakpoints */ or flint-is-number($key) and length($key) == 1 and flint-types-in-list($span, "number") or flint-is-number($key) and length($key) == 1 and $span == "auto" - /** + /* * Variable shorthand with no context - * - * @param {List} $key - span value for each breakpoint - * @param {Null} $span - null context value - * - * @example scss - * _(1 2 3 4) - * - * @throws error if lengths do not match number of breakpoints */ or flint-types-in-list($key, "number") and $span == null - /** + /* * Variable shorthand with identical context - * - * @param {List} $key - span value for each breakpoint - * @param {Number | String} $span - context value for each breakpoint - * - * @example scss - * _(1 2 3 4, 4) | _(1 2 3 4, auto) */ or flint-types-in-list($key, "number") and flint-is-number($span) and length($span) == 1 or flint-types-in-list($key, "number") and $span == "auto" - /** + /* * Variable shorthand with differing context - * - * @param {List} $key - span value for each breakpoint - * @param {List | String} $span - context value for each breakpoint - * - * @example scss - * _(4 3 2 1, 8 6 4 2) | _(4 3 2 1, auto) - * - * @throws error if lengths do not match number of breakpoints */ or flint-types-in-list($key, "number") and flint-types-in-list($span, "number") or flint-types-in-list($key, "number") and $span == "auto" { @@ -360,36 +371,18 @@ } } - /** + /* * Call by alias with no context - * - * @param {String} $key - breakpoint alias - * @param {Number} $span - span value for breakpoint - * @param {Null} $context - null context value - * - * @example scss - * _(desktop, 2) - * - * @throws error if breakpoint alias does not exist */ } @else if flint-is-string($key) and flint-is-number($span) and $context == null - /** + /* * Call by alias with context - * - * @param {String} $key - breakpoint alias - * @param {Number} $span - span value for breakpoint - * @param {Number | String} $context - context value for breakpoint - * - * @example scss - * _(desktop, 2, 4) | _(desktop, 2, auto) - * - * @throws error if breakpoint alias does not exist */ or flint-is-string($key) and flint-is-number($span) and flint-is-number($context) or flint-is-string($key) and flint-is-number($span) and $context == "auto" { - // Emit erroring for invalid argument lengths + // Throw error for invalid argument lengths @if not flint-exists($flint, $key) { @if not $flint__development-mode { @error "Invalid argument: #{$key}. Breakpoint does not exist. Please provide a valid argument."; @@ -457,21 +450,14 @@ } } - /** - * Wrap @content in media query - * - * @param {String | List} $key - defines how to make up media query + /* + * Wrap content in media query */ } @else if flint-exists($flint, $key) and $span == null and $context == null or flint-is-list($key) and $span == null and $context == null { - /** + /* * Call $key breakpoint by alias - * - * @param {String} $key - only for $key breakpoint - * - * @example scss - * _($key) */ @if length($key) == 1 { @@ -501,13 +487,8 @@ } } - /** + /* * From $key breakpoint to infinity - * - * @param {List} $key - min-width from $key breakpoint - * - * @example scss - * _(from $key to infinity) */ } @else if flint-types-in-list($key, "string", 4) and nth($key, 1) == "from" and nth($key, 3) == "to" and nth($key, 4) == "infinity" { @@ -525,13 +506,8 @@ } } - /** + /* * From $key-x breakpoint to $key-y breakpoint - * - * @param {List} $key - from $key-x breakpoint to $key-y - * - * @example scss - * _(from $key-x to $key-y) */ } @else if flint-types-in-list($key, "string", 4) and nth($key, 1) == "from" and nth($key, 3) == "to" { @@ -549,13 +525,8 @@ } } - /** + /* * From $num-x to $num-y - * - * @param {List} $key - arbitrary media query - * - * @example scss - * _(from $num-x to $num-y) */ } @else if flint-types-in-list($key, "string" "number" "string" "number", 4) and nth($key, 1) == "from" and nth($key, 3) == "to" { // Make sure passed units match units used in config @@ -570,13 +541,8 @@ } } - /** + /* * Greater than $key breakpoint - * - * @param {List} $key - anything above $key breakpoint - * - * @example scss - * _(greater than $key) */ } @else if flint-types-in-list($key, "string", 3) and nth($key, 1) == "greater" and nth($key, 2) == "than" { @@ -594,13 +560,8 @@ } } - /** + /* * Greater than number - * - * @param {List} $key - anything above number - * - * @example scss - * _(greater than $num) */ } @else if flint-types-in-list($key, "string" "string" "number", 3) and nth($key, 1) == "greater" and nth($key, 2) == "than" { @@ -614,13 +575,8 @@ } } - /** + /* * Number greater than $key breakpoint - * - * @param {List} $key - unit value greater than $key breakpoint - * - * @example scss - * _($num greater than $key) */ } @else if flint-types-in-list($key, "number" "string" "string" "string", 4) and nth($key, 2) == "greater" and nth($key, 3) == "than" { @@ -634,13 +590,8 @@ } } - /** + /* * Less than $key breakpoint - * - * @param {List} $key - anything below $key breakpoint - * - * @example scss - * _(less than $key) */ } @else if flint-types-in-list($key, "string", 3) and nth($key, 1) == "less" and nth($key, 2) == "than" { @@ -658,13 +609,8 @@ } } - /** + /* * Less than number - * - * @param {List} $key - anything below number - * - * @example scss - * _(less than $num) */ } @else if flint-types-in-list($key, "string" "string" "number", 3) and nth($key, 1) == "less" and nth($key, 2) == "than" { @@ -678,13 +624,8 @@ } } - /** + /* * Number less than $key breakpoint - * - * @param {List} $key - unit value less than $key breakpoint - * - * @example scss - * _($num less than $key) */ } @else if flint-types-in-list($key, "number" "string" "string" "string", 4) and nth($key, 2) == "less" and nth($key, 3) == "than" { @@ -698,13 +639,8 @@ } } - /** + /* * For $key-x $key-y $key-z - * - * @param {List} $key - comma delimited list of queries - * - * @example scss - * _(for $key-x $key-y $key-z) */ } @else if flint-types-in-list($key, "string") and nth($key, 1) == "for" { // Define empty query list @@ -748,10 +684,8 @@ } } - /** + /* * Invalid argument - * - * @throw invalid argument error */ } @else { @if $key != "clear" { diff --git a/tests/input/functions/helpers/_helpers.scss b/tests/input/functions/helpers/_helpers.scss index e3ab208..db65ef0 100755 --- a/tests/input/functions/helpers/_helpers.scss +++ b/tests/input/functions/helpers/_helpers.scss @@ -1,9 +1,5 @@ /** * Returns truthiness of a value - * - * @param {*} $value - * - * @return {Bool} */ @include describe("[function] is-true") { @@ -40,10 +36,6 @@ /** * Checks if item is map - * - * @param {Map} $n - * - * @return {Bool} */ @include describe("[function] is-map") { @@ -87,10 +79,6 @@ /** * Checks if item is list - * - * @param {List} $n - * - * @return {Bool} */ @include describe("[function] is-list") { @@ -134,10 +122,6 @@ /** * Checks if item is number - * - * @param {Number} $n - * - * @return {Bool} */ @include describe("[function] is-number") { @@ -181,10 +165,6 @@ /** * Checks if item is string - * - * @param {String} $n - * - * @return {Bool} */ @include describe("[function] is-string") { @@ -228,10 +208,6 @@ /** * Checks if item is not string - * - * @param {String} $n - * - * @return {Bool} */ @include describe("[function] is-not-string") { @@ -272,8 +248,6 @@ /** * Get gutter value from config map - * - * @return {Number} */ @include describe("[function] get-gutter") { @@ -287,8 +261,6 @@ /** * Gets list of each breakpoint's key - * - * @return {List} */ @include describe("[function] get-all-keys") { @@ -302,8 +274,6 @@ /** * Gets list of all breakpoints - * - * @return {List} */ @include describe("[function] get-all-breakpoints") { @@ -317,10 +287,6 @@ /** * Checks if passed $key is the highest breakpoint - * - * @param {String} $key - alias of breakpoint - * - * @return {Bool} */ @include describe("[function] is-highest-breakpoint") { @@ -349,10 +315,6 @@ /** * Checks if passed $key is the lowest breakpoint - * - * @param {String} $key - alias of breakpoint - * - * @return {Bool} */ @include describe("[function] is-lowest-breakpoint") { @@ -381,10 +343,6 @@ /** * Checks if $key is grid default - * - * @param {String} $key - alias of breakpoint - * - * @return {Bool} */ @include describe("[function] is-default") { @@ -413,8 +371,6 @@ /** * Gets all breakpoint column values - * - * @return {List} */ @include describe("[function] get-all-columns") { @@ -428,8 +384,6 @@ /** * Returns the unit used in config - * - * @return {*} */ @include describe("[function] get-config-unit") { @include it("should expect configuration unit to be ems") { @@ -442,11 +396,6 @@ /** * Convert pixel value to em - * - * @param {Number} $target - pixel value - * @param {Number} $context - context to divide by - * - * @return em value of target relative to context */ @include describe("[function] to-em") { diff --git a/tests/input/functions/lib/_calc-breakpoint.scss b/tests/input/functions/lib/_calc-breakpoint.scss index 4b7b1b6..44b6023 100755 --- a/tests/input/functions/lib/_calc-breakpoint.scss +++ b/tests/input/functions/lib/_calc-breakpoint.scss @@ -1,11 +1,5 @@ /** * Calculate breakpoint query - * - * @param {String} $type - type of query to get - * @param {String} $key - key of breakpoint - * @param {Number} $i - index of current breakpoint - * - * @return {Number} - breakpoint value */ @include describe("[function] calc-breakpoint") { diff --git a/tests/input/functions/lib/_calc-width.scss b/tests/input/functions/lib/_calc-width.scss index 1a821aa..8f47761 100755 --- a/tests/input/functions/lib/_calc-width.scss +++ b/tests/input/functions/lib/_calc-width.scss @@ -1,12 +1,5 @@ /** * Calculate width - * - * @param {String} $key - key of breakpoint - * @param {Number} $span - span value of element - * @param {Number | String} $context (null) - context value of element - * @param {Number} $deduct (null) - subtract value out of final width - * - * @return {Map | False} - map of target and context result */ @include describe("[function] calc-width") { diff --git a/tests/input/functions/lib/_exists.scss b/tests/input/functions/lib/_exists.scss index 65b9c0e..6342455 100755 --- a/tests/input/functions/lib/_exists.scss +++ b/tests/input/functions/lib/_exists.scss @@ -1,10 +1,5 @@ /** * Check if key exists in map - * - * @param {Map} $map - map to search - * @param {String} $value - key to search for - * - * @return {Bool} */ @include describe("[function] exists") { diff --git a/tests/input/functions/lib/_fluid-width.scss b/tests/input/functions/lib/_fluid-width.scss index 412b972..4ccc55e 100755 --- a/tests/input/functions/lib/_fluid-width.scss +++ b/tests/input/functions/lib/_fluid-width.scss @@ -1,10 +1,5 @@ /** * Convert fixed to fluid width - * - * @param {Number} $target - * @param {Number} $context - * - * @return {Number} */ @include describe("[function] fluid-width") { diff --git a/tests/input/functions/lib/_get-index.scss b/tests/input/functions/lib/_get-index.scss index 9c085b8..f2888b0 100755 --- a/tests/input/functions/lib/_get-index.scss +++ b/tests/input/functions/lib/_get-index.scss @@ -1,9 +1,5 @@ /** * Gets the index of the passed key - * - * @param {String} $key - breakpoint key - * - * @return {Number} */ @include describe("[function] get-index") { diff --git a/tests/input/functions/lib/_get-instance-value.scss b/tests/input/functions/lib/_get-instance-value.scss index eb04e1b..f4bd320 100755 --- a/tests/input/functions/lib/_get-instance-value.scss +++ b/tests/input/functions/lib/_get-instance-value.scss @@ -1,10 +1,5 @@ /** * Get single value from key in instance map based on $selector::$key - * - * @param {String} $key - breakpoint key to pass to instance method - * @param {ArgList} $values - list of keys to fetch value from - * - * @return {String | False} */ @include describe("[function] get-instance-value") { diff --git a/tests/input/functions/lib/_get-value.scss b/tests/input/functions/lib/_get-value.scss index f0eb4ae..5971292 100755 --- a/tests/input/functions/lib/_get-value.scss +++ b/tests/input/functions/lib/_get-value.scss @@ -1,9 +1,5 @@ /** * Get single value from configuration map - * - * @param {ArgList} $keys - list of keys to fetch value from - * - * @return {*} */ @include describe("[function] get-value") { diff --git a/tests/input/functions/lib/_has-family-instance.scss b/tests/input/functions/lib/_has-family-instance.scss index 14b6f74..ac87617 100755 --- a/tests/input/functions/lib/_has-family-instance.scss +++ b/tests/input/functions/lib/_has-family-instance.scss @@ -1,10 +1,5 @@ /** * Checks if instance flint-exists in selector familiy tree, falls back from current selector - * - * @param {String} $key - breakpoint key to search for matching instance - * @param {String} $syntax - searches for instance using passed syntax parser - * - * @return {String | False} instance selector */ @include describe("[function] has-family-instance") { diff --git a/tests/input/functions/lib/_instance.scss b/tests/input/functions/lib/_instance.scss index 975322d..91c156c 100755 --- a/tests/input/functions/lib/_instance.scss +++ b/tests/input/functions/lib/_instance.scss @@ -1,15 +1,5 @@ /** * Keeps count of all instances with arguments, stores in global var - * - * @param {String} $key - computed breakpoint of instance - * @param {Number} $span - computed span of instance - * @param {Number} $context - computed context of instance - * @param {Number} $gutter - computed gutter of instance - * @param {Number} $output-width - computed width of instance - * @param {Number} $output-margin-right - computed right margin of instance - * @param {Number} $output-margin-left - computed left margin of instance - * - * @return {Map} merged instance map */ @include describe("[function] instance") { @@ -56,62 +46,47 @@ $flint__instance-count: 0 !global; $pseudo-instance: ( - ".parent-instance::desktop": ( - "instance-count": 1, - "parent-selector": none, - "key": "desktop", - "breakpoint": 80em, - "columns": 16, - "span": 4, - "context": null, - "gutter": null, - "internal": ( - "width": 18.75em, - "margin-right": 0.625em, - "margin-left": 0.625em - ) - ), - ".parent-instance::laptop": ( - "instance-count": 2, - "parent-selector": none, - "key": "laptop", - "breakpoint": 60em, - "columns": 12, - "span": 4, - "context": null, + ".parent-instance .child-instance::mobile": ( + "instance-count": 8, + "parent-selector": ".parent-instance::mobile", + "key": "mobile", + "breakpoint": 20em, + "columns": 4, + "span": 2, + "context": 4, "gutter": null, "internal": ( - "width": 18.75em, + "width": 8.125em, "margin-right": 0.625em, "margin-left": 0.625em ) ), - ".parent-instance::tablet": ( - "instance-count": 3, - "parent-selector": none, + ".parent-instance .child-instance::tablet": ( + "instance-count": 7, + "parent-selector": ".parent-instance::tablet", "key": "tablet", "breakpoint": 40em, "columns": 8, - "span": 4, - "context": null, + "span": 2, + "context": 4, "gutter": null, "internal": ( - "width": 18.75em, + "width": 8.125em, "margin-right": 0.625em, "margin-left": 0.625em ) ), - ".parent-instance::mobile": ( - "instance-count": 4, - "parent-selector": none, - "key": "mobile", - "breakpoint": 20em, - "columns": 4, - "span": 4, - "context": null, + ".parent-instance .child-instance::laptop": ( + "instance-count": 6, + "parent-selector": ".parent-instance::laptop", + "key": "laptop", + "breakpoint": 60em, + "columns": 12, + "span": 2, + "context": 4, "gutter": null, "internal": ( - "width": 18.75em, + "width": 8.125em, "margin-right": 0.625em, "margin-left": 0.625em ) @@ -131,47 +106,62 @@ "margin-left": 0.625em ) ), - ".parent-instance .child-instance::laptop": ( - "instance-count": 6, - "parent-selector": ".parent-instance::laptop", - "key": "laptop", - "breakpoint": 60em, - "columns": 12, - "span": 2, - "context": 4, + ".parent-instance::mobile": ( + "instance-count": 4, + "parent-selector": none, + "key": "mobile", + "breakpoint": 20em, + "columns": 4, + "span": 4, + "context": null, "gutter": null, "internal": ( - "width": 8.125em, + "width": 18.75em, "margin-right": 0.625em, "margin-left": 0.625em ) ), - ".parent-instance .child-instance::tablet": ( - "instance-count": 7, - "parent-selector": ".parent-instance::tablet", + ".parent-instance::tablet": ( + "instance-count": 3, + "parent-selector": none, "key": "tablet", "breakpoint": 40em, "columns": 8, - "span": 2, - "context": 4, + "span": 4, + "context": null, "gutter": null, "internal": ( - "width": 8.125em, + "width": 18.75em, "margin-right": 0.625em, "margin-left": 0.625em ) ), - ".parent-instance .child-instance::mobile": ( - "instance-count": 8, - "parent-selector": ".parent-instance::mobile", - "key": "mobile", - "breakpoint": 20em, - "columns": 4, - "span": 2, - "context": 4, + ".parent-instance::laptop": ( + "instance-count": 2, + "parent-selector": none, + "key": "laptop", + "breakpoint": 60em, + "columns": 12, + "span": 4, + "context": null, "gutter": null, "internal": ( - "width": 8.125em, + "width": 18.75em, + "margin-right": 0.625em, + "margin-left": 0.625em + ) + ), + ".parent-instance::desktop": ( + "instance-count": 1, + "parent-selector": none, + "key": "desktop", + "breakpoint": 80em, + "columns": 16, + "span": 4, + "context": null, + "gutter": null, + "internal": ( + "width": 18.75em, "margin-right": 0.625em, "margin-left": 0.625em ) diff --git a/tests/input/functions/lib/_last.scss b/tests/input/functions/lib/_last.scss index 2147f62..1cac944 100755 --- a/tests/input/functions/lib/_last.scss +++ b/tests/input/functions/lib/_last.scss @@ -1,9 +1,5 @@ /** * Get last item in list - * - * @param {List} $list - * - * @return {List} */ @include describe("[function] last") { diff --git a/tests/input/functions/lib/_list-to-string.scss b/tests/input/functions/lib/_list-to-string.scss index 5cbbe12..a42b66f 100755 --- a/tests/input/functions/lib/_list-to-string.scss +++ b/tests/input/functions/lib/_list-to-string.scss @@ -1,13 +1,5 @@ /** * Joins all elements of list with passed glue - * - * @link http://sassylists.com/documentation/#to-string - * - * @param {List} $list - * @param {String} $glue - * @param {Bool} $is-nested - * - * @return {String} */ @include describe("[function] list-to-string") { diff --git a/tests/input/functions/lib/_map-fetch.scss b/tests/input/functions/lib/_map-fetch.scss index 199a171..7440094 100755 --- a/tests/input/functions/lib/_map-fetch.scss +++ b/tests/input/functions/lib/_map-fetch.scss @@ -1,10 +1,5 @@ /** * Fetch value from map - * - * @param {Map} $map - map to fetch value from - * @param {ArgList} $keys - list of keys to traverse - * - * @return {String | False} */ @include describe("[function] map-fetch") { diff --git a/tests/input/functions/lib/_next-index.scss b/tests/input/functions/lib/_next-index.scss index 978d16e..0484d0b 100755 --- a/tests/input/functions/lib/_next-index.scss +++ b/tests/input/functions/lib/_next-index.scss @@ -1,9 +1,5 @@ /** * Returns next indexed key based on passed index - * - * @param {Number} $index - index of breakpoint - * - * @return {String | False} */ @include describe("[function] next-index") { diff --git a/tests/input/functions/lib/_purge.scss b/tests/input/functions/lib/_purge.scss index a536bc9..5ff543a 100755 --- a/tests/input/functions/lib/_purge.scss +++ b/tests/input/functions/lib/_purge.scss @@ -1,11 +1,5 @@ /** * Removes all false and null values from $list - * - * @link http://sassylists.com/documentation.html#purge - * - * @param {List} $list - * - * @return {List} */ @include describe("[function] purge") { diff --git a/tests/input/functions/lib/_remove.scss b/tests/input/functions/lib/_remove.scss index e2f4787..0b2dcf3 100755 --- a/tests/input/functions/lib/_remove.scss +++ b/tests/input/functions/lib/_remove.scss @@ -1,13 +1,5 @@ /** * Remove value from list - * - * @link http://sassylists.com/documentation/#remove - * - * @param {List} $list - * @param {*} $value - * @param {Bool} $recursive - * - * @return {List} */ @include describe("[function] remove") { diff --git a/tests/input/functions/lib/_replace-substring.scss b/tests/input/functions/lib/_replace-substring.scss index 24d7691..8017308 100755 --- a/tests/input/functions/lib/_replace-substring.scss +++ b/tests/input/functions/lib/_replace-substring.scss @@ -1,11 +1,5 @@ /** * Replace substring - * - * @param {String} $string - string that contains substring - * @param {String} $substring - substring to replace - * @param {String} $new-substring (" ") - new string to replace sub with - * - * @return {String} */ @include describe("[function] replace-substring") { diff --git a/tests/input/functions/lib/_replace.scss b/tests/input/functions/lib/_replace.scss index 581560a..d597a8f 100755 --- a/tests/input/functions/lib/_replace.scss +++ b/tests/input/functions/lib/_replace.scss @@ -1,13 +1,5 @@ /** * Replaces old by new in $list - * - * @link http://sassylists.com/documentation.html#replace - * - * @param {List} $list - * @param {*} $old - * @param {*} $value - * - * @return {List} */ @include describe("[function] replace") { diff --git a/tests/input/functions/lib/_steal-key.scss b/tests/input/functions/lib/_steal-key.scss index fc0b5b7..304dcf8 100755 --- a/tests/input/functions/lib/_steal-key.scss +++ b/tests/input/functions/lib/_steal-key.scss @@ -1,9 +1,5 @@ /** * Steal breakpoint key by index - * - * @param {Number} $index - index of key - * - * @return {String | False} */ @include describe("[function] steal-key") { diff --git a/tests/input/functions/lib/_steal-values.scss b/tests/input/functions/lib/_steal-values.scss index 2087852..69eefed 100755 --- a/tests/input/functions/lib/_steal-values.scss +++ b/tests/input/functions/lib/_steal-values.scss @@ -1,10 +1,5 @@ /** * Steal breakpoint value by index - * - * @param {Number} $index - index of key - * @param {String} $value - value to get from breakpoint - * - * @return {String | False} */ @include describe("[function] steal-values") { diff --git a/tests/input/functions/lib/_string-to-list.scss b/tests/input/functions/lib/_string-to-list.scss index e989db1..5ab242b 100755 --- a/tests/input/functions/lib/_string-to-list.scss +++ b/tests/input/functions/lib/_string-to-list.scss @@ -1,11 +1,5 @@ /** * Turns string into a flat list - * - * @param {String} $string - * @param {String} $find (" ") - item to find which separates substrings - * @param {String} $ignore (",") - removes remaining string beyond item - * - * @return {List | False} */ @include describe("[function] string-to-list") { diff --git a/tests/input/functions/lib/_support-syntax-bem.scss b/tests/input/functions/lib/_support-syntax-bem.scss index cf4eb25..ebd1323 100644 --- a/tests/input/functions/lib/_support-syntax-bem.scss +++ b/tests/input/functions/lib/_support-syntax-bem.scss @@ -1,9 +1,5 @@ /** * Parser to support BEM syntax - * - * @param {List} $selectors - string of selectors to parse - * - * @return {List} - parsed list of selectors according to syntax */ @include describe("[function] support-syntax-bem") { diff --git a/tests/input/functions/lib/_support-syntax.scss b/tests/input/functions/lib/_support-syntax.scss index ffa82a2..f4fafe2 100644 --- a/tests/input/functions/lib/_support-syntax.scss +++ b/tests/input/functions/lib/_support-syntax.scss @@ -1,10 +1,5 @@ /** * Support syntax - * - * @param {String} $syntax - alias of syntax to support - * @param {List} $selectors - string of selectors to parse - * - * @return {List} - list of parsed selectors according to syntax */ @include describe("[function] support-syntax") { diff --git a/tests/input/functions/lib/_types-in-list.scss b/tests/input/functions/lib/_types-in-list.scss index b1d4402..7426489 100644 --- a/tests/input/functions/lib/_types-in-list.scss +++ b/tests/input/functions/lib/_types-in-list.scss @@ -1,11 +1,5 @@ /** * Checks type of each item in list - * - * @param {List} $list - list of items - * @param {String | List} $assert-types (null) - single or list of types to assert - * @param {Number} $assert-length (null) - assert length of list - * - * @return {Bool} */ @include describe("[function] types-in-list") { diff --git a/tests/input/functions/lib/_use-syntax.scss b/tests/input/functions/lib/_use-syntax.scss index 16e6050..1f2eb53 100644 --- a/tests/input/functions/lib/_use-syntax.scss +++ b/tests/input/functions/lib/_use-syntax.scss @@ -1,9 +1,5 @@ /** * Use global syntax - * - * @param {List} $selectors - string of selectors to parse - * - * @return {List} - parsed list of selectors */ @include describe("[function] use-syntax") { diff --git a/tests/output/output.css b/tests/output/output.css index 9499851..ba8fd53 100644 --- a/tests/output/output.css +++ b/tests/output/output.css @@ -1862,66 +1862,6 @@ Test Results { } } -.col-quarter { - float: left; - width: 93.75%; - margin-right: 3.125%; - margin-left: 3.125%; - height: auto !important; -} -@media (min-width: 60.0625em) { - .col-quarter { - width: 23.4375%; - margin-right: 0.78125%; - margin-left: 0.78125%; - } -} -@media (min-width: 40.0625em) and (max-width: 60em) { - .col-quarter { - width: 31.25%; - margin-right: 1.04167%; - margin-left: 1.04167%; - } -} -@media (min-width: 20.0625em) and (max-width: 40em) { - .col-quarter { - width: 46.875%; - margin-right: 1.5625%; - margin-left: 1.5625%; - } -} -.col-quarter:before { - content: "1/4"; -} -.col-quarter .col-quarter-child { - float: left; - width: 18.75%; - margin-right: 3.125%; - margin-left: 3.125%; - height: 100% !important; -} -@media (min-width: 60.0625em) { - .col-quarter .col-quarter-child { - width: 43.75%; - margin-right: 3.125%; - margin-left: 3.125%; - } -} -@media (min-width: 40.0625em) and (max-width: 60em) { - .col-quarter .col-quarter-child { - width: 43.75%; - margin-right: 3.125%; - margin-left: 3.125%; - } -} -@media (min-width: 20.0625em) and (max-width: 40em) { - .col-quarter .col-quarter-child { - width: 18.75%; - margin-right: 3.125%; - margin-left: 3.125%; - } -} - div[class*="col"] { position: relative; font: 10px Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;