Sha256: 3e6713465da75fd1c3db2a3e613d8e2dcdf349857e7cc9a40dfb731f569f4682

Contents?: true

Size: 388 Bytes

Versions: 27

Compression:

Stored size: 388 Bytes

Contents

require 'sass'

module Sass::Script::Functions
  COMMA_SEPARATOR = /\s*,\s*/
  def nest(*arguments)
    nested = arguments.map{|a| a.value}.inject do |memo,arg|
      ancestors = memo.split(COMMA_SEPARATOR)
      descendants = arg.split(COMMA_SEPARATOR)
      ancestors.map{|a| descendants.map{|d| "#{a} #{d}"}.join(", ")}.join(", ")
    end
    Sass::Script::String.new(nested)
  end
end

Version data entries

27 entries across 27 versions & 6 rubygems

Version Path
arnebrasseur-compass-0.3.5.1 lib/sass_extensions.rb
arnebrasseur-compass-0.3.5 lib/sass_extensions.rb
bsherman-compass-0.5.2 lib/sass_extensions.rb
chriseppstein-compass-0.1.1 lib/sass_extensions.rb
chriseppstein-compass-0.3.0 lib/sass_extensions.rb
chriseppstein-compass-0.3.1 lib/sass_extensions.rb
chriseppstein-compass-0.3.2 lib/sass_extensions.rb
chriseppstein-compass-0.3.3 lib/sass_extensions.rb
chriseppstein-compass-0.3.4 lib/sass_extensions.rb
chriseppstein-compass-0.3.6 lib/sass_extensions.rb
chriseppstein-compass-0.3.7 lib/sass_extensions.rb
chriseppstein-compass-0.3.8 lib/sass_extensions.rb
chriseppstein-compass-0.3.9 lib/sass_extensions.rb
chriseppstein-compass-0.4.0 lib/sass_extensions.rb
chriseppstein-compass-0.4.1 lib/sass_extensions.rb
chriseppstein-compass-0.4.2 lib/sass_extensions.rb
chriseppstein-compass-0.5.0 lib/sass_extensions.rb
chriseppstein-compass-0.5.1 lib/sass_extensions.rb
chriseppstein-compass-0.5.2 lib/sass_extensions.rb
chriseppstein-compass-0.5.3 lib/sass_extensions.rb