leonderijke / SassyLists

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SassyLists Gem Version

Here is a Compass Extension providing you all functions you need to manipulate your Sass lists. See complete documentation here.

How to use it

  1. gem install SassyLists
  2. Add require 'SassyLists' to your config.rb
  3. Import it in your stylesheets with @import 'SassyLists'

What's in there?

  • chunk(): returns whether list contains $value
  • contain(): returns whether the list contains the value
  • count-values(): counts the number of occurrences of each value of list
  • debug(): returns list as a string
  • explode(): explodes a string into a list using a string as a delimiter
  • first(): returns first item in list
  • flatten(): turns multidimensional list into a one-level list
  • insert-nth(): inserts value at index
  • intersection(): returns a list of shared values across all given lists
  • is-symmetrical(): checks if list is symmetrical
  • last(): returns last item in list
  • last-index(): returns last index of value in list
  • loop(): shifts indexes in list
  • prepend(): prepends value to list
  • purge(): removes all false and null values from list
  • random-value(): returns random value from list
  • remove(): removes value in list
  • remove-duplicates(): removes duplicate values from list
  • remove-nth(): removes value at index
  • replace(): replaces value in list
  • replace-nth(): replaces value at index
  • reverse(): reverses list
  • shuffle(): shuffles list
  • slice(): slices list
  • sort(): sorts list
  • sum(): sums all unitless values in list
  • to-string(): casts list as string (JS .join())
  • union(): returns a list of values from given lists minus duplicates

If you feel like an explorer, you can have a look at the code here.

Requirements

  • Sass ~> 3.3.0
  • Compass ~> 1.0.0

If you are looking for the last version of SassyLists running on Sass 3.2, install 0.4.9.

Some functions depend on other functions. If you include functions individually, make sure to check for these dependencies in their respective docs.

Also read

Credits

A million thanks to Vinay Raghu for making this Compass extension out of my original work and to Team-Sass for their Compass Extension template.

About

License:MIT License