Popularity
6.3
Stable
Activity
0.0
Stable
431
18
35

Programming language: Go
License: GNU General Public License v3.0 or later
Tags: CSS Preprocessors    

c6 alternatives and similar packages

Based on the "CSS Preprocessors" category.
Alternatively, view c6 alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of c6 or a related project?

Add another 'CSS Preprocessors' Package

README

C6

Hate waiting for SASS compiling your stylesheets with Compass over 10 seconds everytime? C6 helps you write style sheets with efficiency.

C6 is a SASS 3.2 compatible implementation written in Go. But wait! this is not only to implement SASS, but also to create a new language for better consistency, syntax and performance. And yes, this means we're free to accept new language feature requests.

Build Status Coverage Status GoDoc

wercker status

Installation

go get github.com/c9s/c6/cmd/c6

Working in progress

  • [ ] Lexing
    • [x] @import
    • [x] simple selector.
    • [x] type selector.
    • [x] child selector.
    • [x] attribute selector.
    • [x] adjacent selector.
    • [x] descendant selector.
    • [x] class selector.
    • [x] ID selector.
    • [x] Ruleset
    • [x] Sub-ruleset
    • [x] Interpolation
    • [x] Property name
    • [x] Property value list
    • [x] Nested properties.
    • [x] Comma-separated list
    • [x] Space-separated list
    • [x] @if , @else , @else if
    • [x] @for, from, through statement
    • [x] @while
    • [x] @mixin
    • [x] @mixin with arguments
    • [x] @include
    • [x] Flags: !default, !important, !optional, !global
    • [x] Hex color
    • [x] Functions
    • [x] Vendor prefix properties
    • [x] MS filter. progid:DXImageTransform.Microsoft....
    • [x] Variable names
    • [x] Variable assignment
    • [x] Time unit support. s second, ms ... etc
    • [x] Angle unit support.
    • [x] Resolution unit support.
    • [x] Unicode Range support: https://developer.mozilla.org/en-US/docs/Web/CSS/unicode-range
    • [x] Media Query
  • [ ] Built-in Functions
    • .... to be listed
  • [ ] Parser
    • [x] Parse @import
    • [x] Parse Expr
    • [x] Parse Space-Sep List
    • [x] Parse Comma-Sep List
    • [x] Parse Map (tests required)
    • [x] Parse Selector
    • [ ] Parse Selector with interpolation
    • [x] Parse RuleSet
    • [x] Parse DeclBlock
    • [x] Parse Variable Assignment Stmt
    • [x] Parse PropertyName
    • [x] Parse PropertyName with interpolation
    • [x] Parse PropertyValue
    • [x] Parse PropertyValue with interpolation
    • [x] Parse conditions
    • [x] Parse @media statement
    • [x] Parse Nested RuleSet
    • [x] Parse Nested Properties
    • [x] Parse options: !default, !global, !optional
    • [ ] Parse CSS Hack for different browser (support more syntax sugar for this)
    • [x] Parse @font-face block
    • [x] Parse @if statement
    • [x] Parse @for statement
    • [x] Parse @while statement
    • [x] Parse @mixin statement
    • [x] Parse @include statement
    • [x] Parse @function statement
    • [x] Parse @return statement
    • [x] Parse @extend statement
    • [x] Parse keyword arguments for @function
    • [ ] Parse @switch statement
    • [ ] Parse @case statement
    • [ ] Parse @use statement
  • [ ] Building AST

    • [x] RuleSet
    • [x] DeclBlock
    • [x] PropertyName
    • [x] PropertyValue
    • [x] Comma-Separated List
    • [x] Space-Separated List
    • [x] Basic Exprs
    • [x] FunctionCall
    • [x] Expr with interpolation
    • [x] Variable statements
    • [x] Built-in color keyword table
    • [x] Hex Color computation
    • [x] Number operation: add, sub, mul, div
    • [x] Length operation: number operation for px, pt, em, rem, cm ...etc
    • [x] Expr evaluation
    • [x] Boolean expression evaluation
    • [x] Media Query conditions
    • [x] @if If Condition
    • [x] @else if If Else If
    • [x] @else else condition
    • [x] @while statement node
    • [x] @function statement node
    • [x] @mixin statement node
    • [x] @include statement node
    • [x] @return statement node
    • [ ] @each statement node
  • [ ] Runtime

    • [ ] HSL Color computation
    • [ ] Function Call Invoke mech
    • [ ] Mixin Include
    • [ ] Import
  • [ ] SASS Built-in Functions

    • [ ] RGB functions
    • [ ] rgb($red, $green, $blue)
    • [ ] rgba($red, $green, $blue, $alpha)
    • [ ] red($color)
    • [ ] green($color)
    • [ ] blue($color)
    • [ ] mix($color1, $color2, [$weight])
    • [ ] HSL Functions
    • [ ] hsl($hue, $saturation, $lightness)
    • [ ] hsla($hue, $saturation, $lightness, $alpha)
    • [ ] hue($color)
    • [ ] saturation($color)
    • [ ] lightness($color)
    • [ ] adjust-hue($color, $degrees)
    • [ ] lighten($color, $amount)
    • [ ] darken($color, $amount)
    • [ ] saturate($color, $amount)
    • [ ] desaturate($color, $amount)
    • [ ] grayscale($color)
    • [ ] complement($color)
    • [ ] invert($color)
    • [ ] Opacity Functions
    • [ ] alpha($color) / opacity($color)
    • [ ] rgba($color, $alpha)
    • [ ] opacify($color, $amount) / fade-in($color, $amount)
    • [ ] transparentize($color, $amount) / fade-out($color, $amount)
    • [ ] Other Color Functions
    • [ ] adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])
    • [ ] scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])
    • [ ] change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])
    • [ ] ie-hex-str($color)
    • [ ] String Functions
    • [ ] unquote($string)
    • [ ] quote($string)
    • [ ] str-length($string)
    • [ ] str-insert($string, $insert, $index)
    • [ ] str-index($string, $substring)
    • [ ] str-slice($string, $start-at, [$end-at])
    • [ ] to-upper-case($string)
    • [ ] to-lower-case($string)
    • [ ] Number Functions
    • [ ] percentage($number)
    • [ ] round($number)
    • [ ] ceil($number)
    • [ ] floor($number)
    • [ ] abs($number)
    • [ ] min($numbers…)
    • [ ] max($numbers…)
    • [ ] random([$limit])
    • [ ] List Functions
    • [ ] length($list)
    • [ ] nth($list, $n)
    • [ ] set-nth($list, $n, $value)
    • [ ] join($list1, $list2, [$separator])
    • [ ] append($list1, $val, [$separator])
    • [ ] zip($lists…)
    • [ ] index($list, $value)
    • [ ] list-separator(#list)
    • [ ] Map Functions
    • [ ] map-get($map, $key)
    • [ ] map-merge($map1, $map2)
    • [ ] map-remove($map, $keys…)
    • [ ] map-keys($map)
    • [ ] map-values($map)
    • [ ] map-has-key($map, $key)
    • [ ] keywords($args)
    • [ ] Selector Functions
    • .... to be expanded ...
  • [ ] CodeGen

    • [ ] CompactCompiler
    • [ ] CompileCssImportStmt: @import url(...);
    • [ ] CompileRuleSet
    • [ ] CompileSelectors
      • [ ] CoimpileParentSelector
    • [ ] CompileSubRuleSet
    • [ ] CompileCommentBlock
    • [ ] CompileDeclBlock
    • [ ] CompileMediaQuery: @media
    • [ ] CompileSupportrQuery: @support
    • [ ] CompileFontFace: @support
    • [ ] CompileForStmt
    • [ ] CompileIfStmt
      • [ ] CompileElseIfStmt
    • [ ] CompileWhileStmt
    • [ ] CompileEachStmt
    • [ ] ... list more ast nodes here ...
  • [ ] Syntax

    • [ ] built-in @import-once

<!--

Features

Ambiguity

The original design of SASS contains a lot of grammar ambiguity.

for example, as SASS uses interpolation:

#{$name}:before {

}

Since nested properties are allowed, in the above code, we don't know if it's a selector or a property namespace if we don't know the $name variable.

Where before might be a property value or a part of the selector.

links:

To handle this kind of interpolation, we define a type of token named template:

#{$name}:before a {

}

In the above code, #{$name}:before a is treated as T_SELECTOR_TEMPLATE token, which type will be resolved at the runtime.

Self Benchmarking

BenchViz

FAQ

Why do you want to implement another SASS compiler?

The original SASS is written in Ruby and it's really slow, we take 11 seconds to compile the stylesheets of our application, libsass is fast but it does not catch up the ruby sass implementation , and you can't compile them with Compass. Since Go is simple, easy & fast, thus we implement SASS in Go to move faster.

Further, we want to design a new language (ECSS temporarily named) that is compatible with SASS 3.4 or even SASS 4.0 with more powerful features.

Reference

SASS Reference http://sass-lang.com/documentation/file.SASS_REFERENCE.html

A feature check list from libsass:

Standards:

SASS/CSS Frameworks, libraries:

Articles:

Contribution

Please open up an issue on GitHub before you put a lot efforts on pull request.

The code submitting to PR must be filtered with gofmt

Community

License

MPL License https://www.mozilla.org/MPL/2.0/

(MPL is like LGPL but with static/dynamic linking exception, which allows you to either dynamic/static link this library without permissions)

Bitdeli Badge


*Note that all licence references and agreements mentioned in the c6 README section above are relevant to that project's source code only.