Git Product home page Git Product logo

sassybarista's Introduction

SassyBarista is a java implementation of a CSS preprocessor. The goal is that it will eventually be fully compatible with the SCSS syntax of SASS (http://sass-lang.com). It's based on a JavaCC grammar and is in a comparatively early stage, although some advanced features are already supported. There are still a few glitches that prevents some standard CSS files from parsing correctly, but worki on getting rid of them is in progress. All feedback is very welcome.

If you need a way to parse css and manipulate it programatically this project might also fit nicely, since it was partly designed for that purpose. The java API should be rather straight forward to use directly.

Currently supported:

  • Correctly parses most of the CSS specification. If you find examples of valid css that it can't process, I'd like to hear about it.
  • Nesting of rules
  • Variables (has to be defined in the global scope right now)
  • Mixins (parameters are supported, although not keyword arguments, nesting rules within mixins works as expected)
  • Selector inheritance (chaining and multiple, no partial substitutions)
  • Basic arithmetic
  • An @if statement, @else if and @else (no logical operators)
  • Functions are supported, although currently no functions are implemented.
  • Parent references
  • Interpolation using #{} in selectors and property-names.

Planned:

  • Improved error messages (currently javacc's default ParseException are used, which can be really confusing)
  • Various output styles
  • @for, @each and @while
  • Keyword arguments to mixins

Not planned:

  • Function directives (@function)

For samples of the capabilities, look in the testcases directory. It contains a .scss-file with the test case, and a manually controlled .css file. When running tests using "ant test" these are validated.

To build it you'll need to download JavaCC and specify the path to it in build.xml. Simply runt ant to build:

ant jar

You can then try ut using:

java -jar sassybarista.jar test.scss

Some relevant links:

Authors:

  • Emil Hernvall
  • Jim Barritt

sassybarista's People

Contributors

jimbarritt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.