Skip to content

Commit

Permalink
Fix append() docs.
Browse files Browse the repository at this point in the history
Closes sass#433.
  • Loading branch information
nex3 committed Jun 30, 2012
1 parent a6db98c commit 7b6b001
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions doc-src/SASS_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Garbutt](http://github.com/techsplicer).
* Properly watch files recursively with `sass --watch`. Thanks to [Sébastien
Tisserant](https://github.com/sebweaver).
* Fix the documentation for the \{Sass::Script::Functions#append append()}
function.

## 3.1.19

Expand Down
15 changes: 9 additions & 6 deletions lib/sass/script/functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ module Sass::Script
# \{#join join($list1, $list2, \[$separator\])}
# : Joins together two lists into one.
#
# \{#append append($list1, $val, \[$separator\])}
# : Appends a single value onto the end of a list.
#
# ## Introspection Functions
#
# \{#type_of type-of($value)}
Expand Down Expand Up @@ -1271,14 +1274,14 @@ def join(list1, list2, separator = Sass::Script::String.new("auto"))
# append(10px 20px, 30px) => 10px 20px 30px
# append((blue, red), green) => blue, red, green
# append(10px 20px, 30px 40px) => 10px 20px (30px 40px)
# join(10px, 20px, comma) => 10px, 20px
# join((blue, red), green, space) => blue red green
# @overload join(list, val, separator: auto)
# @param list1 [Literal] The first list to join
# @param list2 [Literal] The second list to join
# append(10px, 20px, comma) => 10px, 20px
# append((blue, red), green, space) => blue red green
# @overload append(list, val, separator: auto)
# @param list [Literal] The list to add the value to
# @param val [Literal] The value to add to the end of the list
# @param separator [String] How the list separator (comma or space) should be determined.
# If this is `comma` or `space`, that is always the separator;
# if this is `auto` (the default), the separator is determined as explained above.
# if this is `auto` (the default), the separator is the same as that used by the list.
def append(list, val, separator = Sass::Script::String.new("auto"))
assert_type separator, :String
unless %w[auto space comma].include?(separator.value)
Expand Down

0 comments on commit 7b6b001

Please sign in to comment.