Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: hexdump42/libcss2less
base: master
...
head fork: thomaspierson/libcss2less
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 10 commits
  • 13 files changed
  • 0 commit comments
  • 3 contributors
Commits on Feb 02, 2013
@thomaspierson thomaspierson ignore .project files fbbe317
@thomaspierson thomaspierson cleanup: reformat using ruby conventions (Brian I hear you) 7f16d3c
@thomaspierson thomaspierson convert the gem to rubygem-tasks structure + use rdoc and rspec 63a7f47
Commits on Feb 03, 2013
@thomaspierson thomaspierson implement new rspec test: 'should convert basic css structure into le…
…ss structure'
fd29a36
@thomaspierson thomaspierson correctly handle css child selectors ( fix #12 ) 78d7735
@thomaspierson thomaspierson correctly handle css @import rules ( fix ##10 ) 5ab3ff4
@thomaspierson thomaspierson implement new rspec test to check if css @font-face rules are correct…
…ly handled. And it seem to be OK ( fix #7 ref #13 )
40236fb
@thomaspierson thomaspierson bump version to 0.0.2 201177f
Commits on Jun 02, 2013
@grundprinzip grundprinzip Introducing color extraction and vendor prefix handling
This commit allows to automatically extract all colors that are used
in the css file into global variables that can be changed more easily.
In addition this adds an option to automatically extract vendor
prefixed logic into mixins so that they become easier digestible.

Essentially this means, that this block:

    .service-block .span4 {
      color: red;
      -webkit-transition:all 0.3s ease-in-out;
      -moz-transition:all 0.3s ease-in-out;
      -o-transition:all 0.3s ease-in-out;
      transition:all 0.3s ease-in-out;
    }

will become this in LESS

    @color0: red;

    .vp-transition(@p0; @p1; @p2) {
      -webkit-transition: @p0 @p1 @p2;
      -moz-transition: @p0 @p1 @p2;
      -o-transition: @p0 @p1 @p2;
      transition: @p0 @p1 @p2;
    }

    .service-block .span4 {
      color: @color0;
      .vp-transition(all; 0.3s; ease-in-out);
    }

The goal of these modifications is to make transitioning with a given
CSS code base easier. The new options are available to the command
line via:

    Usage: css2less [options] filename
    -c, --colors                     Automatically extract colors from less
    -m, --mixins                     Automatically extract vendor prefixed mixins
    -h, --help                       Show this message]

The code is portable Ruby 1.8.7 and Ruby 1.9
4aca3ff
Commits on Jun 03, 2013
@thomaspierson thomaspierson Merge pull request #18 from grundprinzip/master
Automatic Color Extraction and Vendor Prefixed Modules
6f1cf20
View
4 .document
@@ -0,0 +1,4 @@
+lib/**/*.rb
+README.rdoc
+ChangeLog.rdoc
+COPYING
View
3  .gitignore
@@ -1,2 +1,5 @@
*.css
*~
+.project
+/html/
+/pkg/
View
1  .rspec
@@ -0,0 +1 @@
+--colour --format documentation
View
15 ChangeLog.rdoc
@@ -0,0 +1,15 @@
+=== 0.0.2 / 2013-02-03
+
+* implement a new test to check if css @font-face rules are correctly handled
+* fix: correctly handle css @import rules ( #10 )
+* fix: correctly handle css child selectors ( #12 )
+
+=== 0.0.1 / 2013-02-02
+
+* Reformat the source code using Ruby conventions.
+* Convert Gem to rubygem-task format and use Rspec an Rdoc.
+
+=== 0.0.0 / 2012-04-23
+
+* Initial release: Refactor the script initially written by Marcin Kulik into a RubyGem library.
+
View
16 README.md
@@ -1,16 +0,0 @@
-Css2Less Library
-================
-
-A ruby library which convert old CSS stylesheet into LESS dynamic stylesheet.
-
-Based on css2less script initially written by Marcin Kulik.
-
-Refactored and Gemified by Thomas Pierson.
-
-## Simple usage ##
-
- cd monprojet/
-
- css2less myfile.css >> myfile.less
-
-That's all folks !
View
26 README.rdoc
@@ -0,0 +1,26 @@
+= Css2Less
+
+* {Homepage}[https://github.com/thomaspierson/libcss2less]
+* {Documentation}[http://rubydoc.info/gems/css2less/frames]
+* {Email}[mailto:contact@thomaspierson.fr]
+
+== Description
+
+A ruby library which convert old CSS stylesheet into LESS dynamic stylesheet.
+Based on css2less script initially written by Marcin Kulik.
+Refactored and Gemified by Thomas Pierson.
+
+== Simple usage
+
+ css2less myfile.css > myfile.less
+
+== Install
+
+ $ gem install css2less
+
+== Copyright
+
+See COPYING for details.
+
+
+That's all folks !
View
41 Rakefile
@@ -0,0 +1,41 @@
+# encoding: utf-8
+
+require 'rubygems'
+require 'rake'
+
+begin
+ gem 'rubygems-tasks', '~> 0.2'
+ require 'rubygems/tasks'
+
+ Gem::Tasks.new
+rescue LoadError => e
+ warn e.message
+ warn "Run `gem install rubygems-tasks` to install Gem::Tasks."
+end
+
+begin
+ gem 'rdoc', '~> 3.0'
+ require 'rdoc/task'
+
+ RDoc::Task.new do |rdoc|
+ rdoc.title = "css2less"
+ end
+rescue LoadError => e
+ warn e.message
+ warn "Run `gem install rdoc` to install 'rdoc/task'."
+end
+task :doc => :rdoc
+
+begin
+ gem 'rspec', '~> 2.4'
+ require 'rspec/core/rake_task'
+
+ RSpec::Core::RakeTask.new
+rescue LoadError => e
+ task :spec do
+ abort "Please run `gem install rspec` to install RSpec."
+ end
+end
+
+task :test => :spec
+task :default => :spec
View
29 bin/css2less
@@ -1,9 +1,36 @@
#!/usr/bin/env ruby
+require 'optparse'
require 'css2less'
+options = {}
+parser = OptionParser.new do |opts|
+ opts.banner = "Usage: css2less [options] filename"
+
+ opts.on("-c", "--colors", "Automatically extract colors from less") do |v|
+ options[:update_colors] = v
+ end
+
+ opts.on("-m", "--mixins", "Automatically extract vendor prefixed mixins") do |v|
+ options[:vendor_mixins] = v
+ end
+
+ opts.on_tail("-h", "--help", "Show this message") do
+ puts opts
+ exit
+ end
+
+end
+
+parser.parse!
+
+if ARGV.empty?
+ puts parser
+ exit
+end
+
css = File.read(ARGV[0])
-converter = Css2Less::Converter.new(css)
+converter = Css2Less::Converter.new(css, options)
converter.process_less
puts converter.get_less
View
34 css2less.gemspec
@@ -1,14 +1,22 @@
-Gem::Specification.new do |s|
- s.name = 'css2less'
- s.version = '0.0.0'
- s.date = '2012-04-23'
- s.summary = "CSS to LESS converter"
- s.description = "A ruby library which convert old CSS stylesheet into LESS dynamic stylesheet."
- s.authors = ['Thomas Pierson', 'Marcin Kulik']
- s.email = ['contact@thomaspierson.fr', 'm@ku1ik.com']
- s.license = 'GPL-3'
- s.files = ["lib/css2less.rb"]
- s.homepage =
- 'https://github.com/thomaspierson/libcss2less'
- s.executables << 'css2less'
+require File.expand_path('../lib/css2less/version', __FILE__)
+
+Gem::Specification.new do |gem|
+ gem.name = "css2less"
+ gem.version = Css2Less::VERSION
+ gem.summary = "CSS to LESS converter"
+ gem.description = "A ruby library which convert old CSS stylesheet into LESS dynamic stylesheet."
+ gem.license = "GPL-3"
+ gem.authors = ["Thomas Pierson", "Marcin Kulik"]
+ gem.email = ["contact@thomaspierson.fr", "m@ku1ik.com"]
+ gem.homepage = "https://github.com/thomaspierson/libcss2less"
+
+ gem.files = `git ls-files`.split($/)
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
+ gem.require_paths = ['lib']
+
+ gem.add_development_dependency 'rdoc', '~> 3.0'
+ gem.add_development_dependency 'rspec', '~> 2.4'
+ gem.add_development_dependency 'rubygems-tasks', '~> 0.2'
end
+
View
233 lib/css2less.rb
@@ -15,86 +15,249 @@
#
# You should have received a copy of the GNU General Public License
# along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+require 'set'
module Css2Less
-
+
+ # These are the official colors
+ CSS_COLORS = Set.new %w{aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgrey darkgreen darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray grey green greenyellow honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgrey lightgreen lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen}
+ VENDOR_PREFIXES_LIST = %w{-moz -o -ms -webkit}
+ VENDOR_PREFIXES = /^(-moz|-o|-ms|-webkit)-/
+
require 'enumerator'
-
+
+ # This is the CSS2Less converter class.
class Converter
-
- def initialize(css=nil)
+
+ # This is the constructor of the class
+ #
+ # The following options are supported:
+ #
+ # * Matching colors in the CSS document and replacing them
+ # update_colors => true
+ def initialize(css=nil, options = {})
if not css.nil?
- @css = css
+ @css = css
end
+
+ # Option merge, instead of rails reverse_merge
+ @options = {:update_colors => false, :vendor_mixins => false}.merge(options)
+
@tree = {}
@less = ''
+
+ # We want to store all color information
+ @colors = {}
+
+ # Storing all vendor prefix mixins here
+ @vendor_mixins = {}
end
-
+
def process_less
cleanup
if @css.nil?
- return false
+ return false
end
if @css.empty?
- return false
+ return false
end
generate_tree
render_less
return true
end
-
+
def get_less
return @less
end
-
+
def set_css(css)
@css = css
end
-
+
private
-
+
def cleanup
@tree = {}
@less = ''
end
-
+
+ # Split set of rules into single item
+ def convert_rules(data)
+ data.split(';').map { |s| s.strip }.reject { |s| s.empty? }
+ end
+
+ def color?(value)
+ if CSS_COLORS.include?(value.strip) || /^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.match(value.strip) != nil ||
+ /(rgba?)\(.*\)/.match(value)
+ true
+ else
+ false
+ end
+ end
+
+ # Check if the global index contains the color and replace the value
+ # accordingly
+ def convert_if_color(color)
+ if color?(color)
+ unless @colors.key?(color.strip)
+ @colors[color.strip] = "@color#{@colors.size}"
+ end
+ @colors[color.strip]
+ else
+ color
+ end
+ end
+
+ # Try to match a color of a set of rules
+ def match_color(style)
+ convert_rules(style).map { |r|
+ (key, value) = r.split(":").map { |e| e.strip }
+ if value.nil?
+ "#{key}"
+ else
+ "#{key}: #{value.split(/\s+/).map { |e| convert_if_color(e) }.join(" ")}"
+ end
+ }.join(";\n") << ";\n"
+ end
+
+ def match_vendor_prefix_mixin(style)
+ normal_rules = {}
+ prefixed_rules = {}
+
+ # First identify all those vendor prefixed rules that are similar
+ convert_rules(style).each { |e|
+ (key, value) = e.split(":").map { |e| e.strip }
+ if value.nil?
+ normal_rules[key] = nil
+ else
+ # If this is a vendor prefixed rule, collect all similar ones in a
+ # single entry
+ if key.match(VENDOR_PREFIXES)
+ rule_key = key.gsub(VENDOR_PREFIXES, "")
+ val = value.split(/\s+/).map { |e| e.strip }
+
+ if prefixed_rules.key?(rule_key) && prefixed_rules[rule_key] != val
+ # Abort, because we have different values for different vendor
+ # prefixed values, this can only mean intended different behavior
+ # for different browsers
+ return style
+ end
+
+ prefixed_rules[rule_key] = val
+ else
+ normal_rules[key] = value
+ end
+ end
+ }
+
+ # Now we have all information to proceed. First, we check if the mixin is
+ # already available globally. If not we announce it
+ prefixed_rules.each { |k,v|
+ unless @vendor_mixins.key?(k)
+ @vendor_mixins[k] = v.size
+ end
+
+ if normal_rules.key?(k)
+ normal_rules.delete(k)
+ normal_rules[".vp-#{k}(#{v.join("; ")})"] = nil
+ end
+ }
+
+ result = normal_rules.to_a.map { |e|
+ val = "#{e[0]}"
+ val << ": #{e[1]}" unless e[1].nil?
+ val}.join(";\n") << ";\n"
+ end
+
+ # This method is called for each selector that we want to add as a rule.
+ # Since we have plain CSS rules here, we should try to bring some order into
+ # the chaos.
def add_rule(tree, selectors, style)
return if style.nil? || style.empty?
+
+ # Stop recursion and add styles
if selectors.empty?
- (tree[:style] ||= ';') << style
+
+ # Match and replace global colors
+ style = match_color(style) if @options[:update_colors]
+
+ # Match and replace global mixins for vendor specific behavior
+ style = match_vendor_prefix_mixin(style) if @options[:vendor_mixins]
+
+ (tree[:style] ||= ';') << style
else
- first, rest = selectors.first, selectors[1..-1]
- node = (tree[first] ||= {})
- add_rule(node, rest, style)
+ first, rest = selectors.first, selectors[1..-1]
+ node = (tree[first] ||= {})
+ add_rule(node, rest, style)
end
end
-
+
def generate_tree
@css.split("\n").map { |l| l.strip }.join.gsub(/\/\*+[^\*]*\*+\//, '').split(/[\{\}]/).each_slice(2) do |style|
- rules = style[0].strip
- if rules.include?(',') # leave multiple rules alone
- add_rule(@tree, [rules], style[1])
- else
- add_rule(@tree, rules.split(/\s+/), style[1])
- end
+ rules = style[0].strip
+ # handle child selector case - step1
+ if rules.include?('>')
+ rules = rules.gsub(/\s*>\s*/, ' &>')
+ end
+ if rules.include?("@import")
+ import_rule = rules.match(/@import.*;/)[0]
+ rules = rules.gsub(/@import.*;/, '')
+ add_rule(@tree, [], import_rule)
+ end
+ # leave multiple rules alone
+ if rules.include?(',')
+ add_rule(@tree, [rules], style[1])
+ else
+ rules_split = rules.split(/\s+/)
+ # handle child selector case - step2
+ rules_split.map! {|rule| rule.gsub('&>', '& > ')}
+ add_rule(@tree, rules_split, style[1])
+ end
end
end
-
+
+
+ def build_mixin_list(indent)
+ less = ""
+ @vendor_mixins.each { |k,v|
+ args = Array(0..v-1).map { |e| "@p#{e}" }
+ less << ".vp-#{k}(#{args.join("; ")}) {\n"
+ VENDOR_PREFIXES_LIST.each { |vp|
+ less << " " * (indent+4) << "#{vp}-#{k}: #{args.join(" ")};\n"
+ }
+ less << " " * (indent+4) << "#{k}: #{args.join(" ")};\n"
+ less << "}\n"
+ }
+ less << "\n"
+ end
+
def render_less(tree=nil, indent=0)
if tree.nil?
- tree = @tree
+ # This is the initial node, add all global vars / mixins here
+ @colors.each { |k,v|
+ @less << "#{v}: #{k};\n"
+ }
+ @less << "\n" if @colors.size > 0
+
+ @less << build_mixin_list(indent) if @options[:vendor_mixins]
+
+ tree = @tree
end
tree.each do |element, children|
- @less = @less + ' ' * indent + element + " {\n"
- style = children.delete(:style)
- if style
- @less = @less + style.split(';').map { |s| s.strip }.reject { |s| s.empty? }.map { |s| ' ' * (indent+4) + s + ";" }.join("\n") + "\n"
- end
- render_less(children, indent + 4)
- @less = @less + ' ' * indent + "}\n"
+ if element == :style
+ @less = @less + convert_rules(children).map { |s| s + ";" }.join("\n") + "\n"
+ else
+ @less = @less + ' ' * indent + element + " {\n"
+ style = children.delete(:style)
+ if style
+ @less = @less + convert_rules(style).map { |s| ' ' * (indent+4) + s + ";" }.join("\n") + "\n"
+ end
+ render_less(children, indent + 4)
+ @less = @less + ' ' * indent + "}\n"
+ end
end
end
-
+
end
-
+
end
View
3  lib/css2less/version.rb
@@ -0,0 +1,3 @@
+module Css2Less
+ VERSION = "0.0.2"
+end
View
260 spec/css2less_spec.rb
@@ -0,0 +1,260 @@
+require 'spec_helper'
+require 'css2less'
+
+describe Css2Less do
+ it "should have a VERSION constant" do
+ subject.const_get('VERSION').should_not be_empty
+ end
+end
+
+describe Css2Less::Converter do
+ it "should convert basic css structure into less structure" do
+ css = <<EOF
+#hello {
+ color: blue;
+}
+
+#hello #buddy {
+ background: red;
+}
+EOF
+ less = <<EOF
+#hello {
+ color: blue;
+ #buddy {
+ background: red;
+ }
+}
+EOF
+ converter = Css2Less::Converter.new(css)
+ converter.process_less
+ converter.get_less.should eq(less)
+ end
+
+ it "should correctly handle css child selectors" do
+ css = <<EOF
+body .navbar .nav > li > a {
+ color: #333;
+ font-weight: bold;
+}
+EOF
+ less = <<EOF
+body {
+ .navbar {
+ .nav {
+ & > li {
+ & > a {
+ color: #333;
+ font-weight: bold;
+ }
+ }
+ }
+ }
+}
+EOF
+ converter = Css2Less::Converter.new(css)
+ converter.process_less
+ converter.get_less.should eq(less)
+ end
+
+ it "should correctly handle css @import rules" do
+ css = <<EOF
+@import "style1.css";
+@import "style2.css";
+
+@import "style3.css";
+
+#hello {
+ color: blue;
+}
+
+@import "style4.css";
+
+#hello #buddy {
+ background: red;
+}
+@import "style5.css";
+EOF
+ less = <<EOF
+@import "style1.css";
+@import "style2.css";
+@import "style3.css";
+@import "style4.css";
+@import "style5.css";
+#hello {
+ color: blue;
+ #buddy {
+ background: red;
+ }
+}
+EOF
+ converter = Css2Less::Converter.new(css)
+ converter.process_less
+ converter.get_less.should eq(less)
+ end
+
+ it "should correctly handle @font-face rules" do
+ css = <<EOF
+@font-face {
+ font-family: 'MyWebFont';
+ src: url('webfont.eot'); /* IE9 Compat Modes */
+ src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
+ url('webfont.woff') format('woff'), /* Modern Browsers */
+ url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
+ url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
+}
+
+#hello {
+ color: blue;
+}
+
+#hello #buddy {
+ background: red;
+}
+EOF
+ less = <<EOF
+@font-face {
+ font-family: 'MyWebFont';
+ src: url('webfont.eot');
+ src: url('webfont.eot?#iefix') format('embedded-opentype'), url('webfont.woff') format('woff'), url('webfont.ttf') format('truetype'), url('webfont.svg#svgFontName') format('svg');
+}
+#hello {
+ color: blue;
+ #buddy {
+ background: red;
+ }
+}
+EOF
+ converter = Css2Less::Converter.new(css)
+ converter.process_less
+ converter.get_less.should eq(less)
+ end
+
+ it "should convert basic css colors into global variables" do
+ css = <<EOF
+#hello {
+ color: blue;
+}
+
+#hello #buddy {
+ background: red;
+ color: #333;
+}
+
+p {
+ color: rgb(1,1,1);
+ border: 1px dotted #e4e9f0;
+}
+EOF
+ less = <<EOF
+@color0: blue;
+@color1: red;
+@color2: #333;
+@color3: rgb(1,1,1);
+@color4: #e4e9f0;
+
+#hello {
+ color: @color0;
+ #buddy {
+ background: @color1;
+ color: @color2;
+ }
+}
+p {
+ color: @color3;
+ border: 1px dotted @color4;
+}
+EOF
+ converter = Css2Less::Converter.new(css, {:update_colors => true})
+ converter.process_less
+ converter.get_less.should eq(less)
+ end
+
+ it "should generate appropriate vendor mixins" do
+ css = <<EOF
+.thumbnail-kenburn img {
+ left:10px;
+ margin-left:-10px;
+ position:relative;
+ -webkit-transition: all 0.8s ease-in-out;
+ -moz-transition: all 0.8s ease-in-out;
+ -o-transition: all 0.8s ease-in-out;
+ -ms-transition: all 0.8s ease-in-out;
+ transition: all 0.8s ease-in-out;
+}
+.thumbnail-kenburn:hover img {
+ -webkit-transform: scale(1.2) rotate(2deg);
+ -moz-transform: scale(1.2) rotate(2deg);
+ -o-transform: scale(1.2) rotate(2deg);
+ -ms-transform: scale(1.2) rotate(2deg);
+ transform: scale(1.2) rotate(2deg);
+}
+
+/*Welcome Block*/
+.service-block .span4 {
+ padding:20px 30px;
+ text-align:center;
+ color: red;
+ margin-bottom:20px;
+ border-radius:2px;
+ -webkit-transition:all 0.3s ease-in-out;
+ -moz-transition:all 0.3s ease-in-out;
+ -o-transition:all 0.3s ease-in-out;
+ transition:all 0.3s ease-in-out;
+}
+EOF
+
+ less = <<EOF
+@color0: red;
+
+.vp-transition(@p0; @p1; @p2) {
+ -moz-transition: @p0 @p1 @p2;
+ -o-transition: @p0 @p1 @p2;
+ -ms-transition: @p0 @p1 @p2;
+ -webkit-transition: @p0 @p1 @p2;
+ transition: @p0 @p1 @p2;
+}
+.vp-transform(@p0; @p1) {
+ -moz-transform: @p0 @p1;
+ -o-transform: @p0 @p1;
+ -ms-transform: @p0 @p1;
+ -webkit-transform: @p0 @p1;
+ transform: @p0 @p1;
+}
+
+.thumbnail-kenburn {
+ img {
+ left: 10px;
+ margin-left: -10px;
+ position: relative;
+ .vp-transition(all;
+ 0.8s;
+ ease-in-out);
+ }
+}
+.thumbnail-kenburn:hover {
+ img {
+ .vp-transform(scale(1.2);
+ rotate(2deg));
+ }
+}
+.service-block {
+ .span4 {
+ padding: 20px 30px;
+ text-align: center;
+ color: @color0;
+ margin-bottom: 20px;
+ border-radius: 2px;
+ .vp-transition(all;
+ 0.3s;
+ ease-in-out);
+ }
+}
+EOF
+
+ converter = Css2Less::Converter.new(css, {:update_colors => true, :vendor_mixins => true})
+ converter.process_less
+ converter.get_less.should eq(less)
+
+ end
+end
View
5 spec/spec_helper.rb
@@ -0,0 +1,5 @@
+gem 'rspec', '~> 2.4'
+require 'rspec'
+require 'css2less/version'
+
+include Css2Less

No commit comments for this range

Something went wrong with that request. Please try again.