0.0
No commit activity in last 3 years
No release in over 3 years
Wraps up the CSS lint tool from https://github.com/stubbornella/csslint into a gem
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.8.3
>= 0
~> 3.12
 Project Readme

ruby_css_lint¶ ↑

A repackaging of [CSS Lint](github.com/stubbornella/csslint) for use with Rails.

If you’re using Rails 3.1, you probably want to run css lint on your precompiled assets. Compile them:

rake assets:precompile

To install Ruby CSS Lint, Add it to your gemfile

gem 'ruby_css_lint'

And after a bundle install, run it:

rake css_lint:run

You probably want more control over things, so generate a config file:

rake css_lint:generate_config

You will find the config file at config/initializers/css_lint.rb.

You can control the behavior of Ruby CSS Lint by modifying the implementation of the methods RubyCssLint::location_of_css_files, RubyCssLint::location_of_custom_rules and RubyCssLint::ruleset_classifications.

module RubyCssLint
  def self.ruleset_classifications
    {
      "floats" => RubyCssLint::WARNING,
    }
  end

  def self.location_of_custom_rules(rails_root)
    ["#{rails_root.to_s}/test/css_lint/*.js"]
  end

  def self.location_of_css_files(rails_root)
    [rails_root.to_s+"/public/assets/application.css"]
  end
end

Copyright © 2012 AppFolio, inc. See LICENSE.txt for further details.