New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

css_compare

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css_compare

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

CSS Compare

Processes, evaluates and compares 2 CSS files based on their AST. The repository has been created in order to be able to test the less2sass project. The program returns true or false to the $stdout, so far. Uses the Sass parser to get the CSS files' AST.

Supported CSS features:

  • all types of selectors (they are normalized - duplicity removal and logical/alphabetical ordering)
  • @media, partially
  • @import (lazy loading of imported css files, that can be found, otherwise ignored)
  • @font-face
  • @namespace
  • @charset
  • @keyframes
  • @page
  • @supports, partially

Installation

Add this line to your application's Gemfile:

gem 'css_compare'

And then execute:

$ bundle

Or install it yourself as:

$ gem install css_compare

Usage

Command line usage:

$ css_compare <CSS file> <CSS file>

Programmatic usage:

opts = {
    :operands => ["path/to/file1.css", "path/to/file2.css"]
}
result = CssCompare::Engine.new(opts)
                   .parse!
                   .equal?

TODO

  • Evaluate shorthand properties, so the values of base properties get overridden.
  • Evaluate @media rule's and @supports rule's conditions.
  • Output the difference, optionally.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/vecerek/css_compare.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 14 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc