• Stars
    star
    430
  • Rank 97,248 (Top 2 %)
  • Language
    Go
  • License
    Other
  • Created about 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Compile SASS Faster ! C6 is a SASS-compatible compiler

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

    • @import
    • simple selector.
      • type selector.
      • child selector.
      • attribute selector.
      • adjacent selector.
      • descendant selector.
      • class selector.
      • ID selector.
    • Ruleset
    • Sub-ruleset
    • Interpolation
    • Property name
    • Property value list
    • Nested properties.
    • Comma-separated list
    • Space-separated list
    • @if , @else , @else if
    • @for, from, through statement
    • @while
    • @mixin
    • @mixin with arguments
    • @include
    • Flags: !default, !important, !optional, !global
    • Hex color
    • Functions
    • Vendor prefix properties
    • MS filter. progid:DXImageTransform.Microsoft....
    • Variable names
    • Variable assignment
    • Time unit support. s second, ms ... etc
    • Angle unit support.
    • Resolution unit support.
    • Unicode Range support: https://developer.mozilla.org/en-US/docs/Web/CSS/unicode-range
    • Media Query
  • Built-in Functions

    • .... to be listed
  • Parser

    • Parse @import
    • Parse Expr
    • Parse Space-Sep List
    • Parse Comma-Sep List
    • Parse Map (tests required)
    • Parse Selector
    • Parse Selector with interpolation
    • Parse RuleSet
    • Parse DeclBlock
    • Parse Variable Assignment Stmt
    • Parse PropertyName
    • Parse PropertyName with interpolation
    • Parse PropertyValue
    • Parse PropertyValue with interpolation
    • Parse conditions
    • Parse @media statement
    • Parse Nested RuleSet
    • Parse Nested Properties
    • Parse options: !default, !global, !optional
    • Parse CSS Hack for different browser (support more syntax sugar for this)
    • Parse @font-face block
    • Parse @if statement
    • Parse @for statement
    • Parse @while statement
    • Parse @mixin statement
    • Parse @include statement
    • Parse @function statement
    • Parse @return statement
    • Parse @extend statement
    • Parse keyword arguments for @function
    • Parse @switch statement
    • Parse @case statement
    • Parse @use statement
  • Building AST

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

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

More Repositories

1

Pux

Pux is a fast PHP Router and includes out-of-box controller tools
C
1,272
star
2

bbgo

The modern cryptocurrency trading bot framework written in Go.
Go
1,100
star
3

r3

libr3 is a high-performance path dispatching library. It compiles your route paths into a prefix tree (trie). By using the constructed prefix trie in the start-up time, you may dispatch your routes with efficiency
C
799
star
4

goprocinfo

Linux /proc info parser for Go
Go
725
star
5

CLIFramework

A powerful command line application framework for PHP. It's an extensible, flexible component, You can build your command-based application in seconds!
PHP
433
star
6

gomon

Monitor for any changes in your go package and automatically restart commands (run, build, server or anything)
Go
210
star
7

vikube.vim

Operating Kubernetes Cluster from Vim, in Vim
Vim Script
195
star
8

Vimana

Vimana is an easy to use system for searching , installing, and downloading vim script. Vimana provides a command-line interface such like aptitude programe on Debian linux, for you to search , download , install , upgrade scripts from http://www.vim.org (vimonline site).
Perl
182
star
9

guts

Guts is a new language beyonds PHP.
Go
155
star
10

GetOptionKit

An object-oriented option parser library for PHP, which supports type constraints, flag, multiple flag, multiple values, required value checking
PHP
144
star
11

SQLBuilder

A powerful, fast, cross-platform SQL Builder for PHP. Convert your structured data into SQL queries with a fluent style interface and targeting on all the mainstream database (MySQL, PostgreSQL, SQLite)
PHP
142
star
12

h3

The Fast HTTP header parser library
C
130
star
13

perlomni.vim

perl omnicompletion for vim (including base class function compleltions .. etc)
Vim Script
128
star
14

github-taiwan

Taiwan Developers on Github
Perl
117
star
15

Roller

A simple, fast router for PHP5.3/4, support APC cache, RESTful, highly extendable and flexible.
PHP
86
star
16

hypergit.vim

This git plugin provides many awesome features so that you don't need to type commands anymore..
Vim Script
61
star
17

App-gh

GitHub Command-line Utility.
Perl
53
star
18

AssetKit

A Modular Asset Toolkit for PHP Applications
HTML
52
star
19

fsrename

FSRename V2 - A simple, powerful rename tool supports complex filtering
Go
51
star
20

xarray

The missing PHP array functions you are looking for, implemented in extension
C
41
star
21

ts-webpack-starter

Template project based on TypeScript, Typings, Babel and Webpack
JavaScript
41
star
22

GenPHP

A Powerful,Flexible Code Generator for PHP, can generate anything what you want for your project.
PHP
40
star
23

CodeGen

Transform your dynamic calls to static calls!
PHP
37
star
24

PHPRelease

PHPRelease manages your package release process.
PHP
32
star
25

cpan.vim

vim plugin for perl hackers. for you to search installed module/all modules and integrated with perldoc window
Vim Script
29
star
26

requestgen

request builder generator for Go!
Go
28
star
27

Plack-Middleware-OAuth

Plack Middleware for OAuth1 and OAuth2
Perl
27
star
28

goenv

Go project environment builder - build isolated workspace for your go project
27
star
29

php-ext-skeleton

The minimal PHP extension skeleton
C
27
star
30

reducer

Fast Map & Reduce php7 extension for large array
C
26
star
31

phpunit.vim

phpunit plugin for Vim editor
Vim Script
25
star
32

vim-dev-plugin

A Vim plugin for developing VimL.
Vim Script
25
star
33

vim-makefile

A lightweight non-dependency Makefile for install, uninstall, bundle, distribute Vim plugin scripts.
Vim Script
24
star
34

GoTray

Go application manager in your system status bar. (for Mac OS X)
24
star
35

typeloy

typeloy is a meteor application deployment tool written in typescript.
TypeScript
24
star
36

gsession.vim

gsession.vim saves your session files into the same directory (~/.vim/session/) by default. and auto-detect your session file to load session file when you are opening vim editor without arguments.
Vim Script
24
star
37

callbackgen

callbackgen generates callback pattern for your callback fields.
Go
23
star
38

cpansearch

CPAN module search in C.
C
23
star
39

FastCommit

Integrating GIT commit flow with your own editor easily!
23
star
40

zh-stroke-data

εΈΈη”¨εœ‹ε­—ζ¨™ζΊ–ε­—ι«”η­†εŠƒ XML 資料ζͺ”
JavaScript
22
star
41

gatsby

Gatsby Database Toolkit For Go (ORM, SQL Builder and SQLUtils)
Go
20
star
42

SimpleBench

SimpleBench provides suckless benchmark tools for PHP5.3
PHP
20
star
43

WebUI

Abstract PHP interface for building common HTML components with microdata
PHP
20
star
44

WireRoom

Collaborative Chatroom For Hackers
JavaScript
19
star
45

markdown-git-wiki

This is a pure git wiki (not a web server or web app), this utility only provides the functionbility of translating markdown pages into web pages. links between pages can be named by "[[Link]]". so your git wiki is just a git repository.
Perl
19
star
46

LazyBone

MicroFramework: LazyRecord + BackBone + Roller RESTful Router
JavaScript
18
star
47

gitorbit

GitHub-like Git Server, let you control the permission via mongodb or LDAP
Go
17
star
48

jira.sh

JIRA Client for Bash Scripts
Shell
17
star
49

perldoc-zhtw-translation

Perldoc Translation in zh-tw
Perl
17
star
50

php-r3

high performance r3 router extension for PHP
C
17
star
51

colorselector.vim

provide emacs-like colorscheme selector buffer.
Makefile
17
star
52

ClassMap

Generate class mapping file in PHP, to improve classloader performance.
PHP
16
star
53

jchash

Jump Consistent Hashing Algorithm implemented in PHP 7 Extension
C
15
star
54

router-benchmark

PHP Router Benchmark
PHP
14
star
55

go-aes-crypt

Go
13
star
56

php-FastRequire

SPL class loader is slow! Now you can skip the SPL functions to load your minimal class requirements directly.
13
star
57

GrindKit

PHP GrindKit for reading cachegrind compatible file.
PHP
13
star
58

MiniPear

MiniPear creates local pear channel mirrors for offline usage.
PHP
12
star
59

simple-commenter.vim

simple commenter plugin
Vim Script
11
star
60

cascading.vim

Vim Script
11
star
61

rockhopper

rockhopper is an embeddable migration tool written by Go
Go
11
star
62

ConfigKit

Toolkit for Config Files, use fast but readable YAML config file for your PHP project.
PHP
11
star
63

ClassTemplate

Class template for PHP
PHP
11
star
64

umobi

Β΅Mobi - Micro Mobile Web Framework for Smartphones & Tablets.
JavaScript
10
star
65

xfile

PHP Extension for file operations
C
9
star
66

PJSON

PJSONEncoder implements a JSON encoder with PHP object to JavaScript object translation support.
PHP
9
star
67

Git-Release

A Git Release Manager
Perl
8
star
68

ZLogger

A Simple Logger for PHP based on ZeroMQ
PHP
8
star
69

perl-poppler

basic porting of poppler
Perl
8
star
70

lftp-sync.vim

lftp sync plugin for vim.
Vim Script
8
star
71

vimomni.vim

a better completion for VimL.
Vim Script
8
star
72

kubernetes-term

Connecting xterm.js to kubernetes exec spdy stream with socket.io
Go
8
star
73

phpkmp

Knuth-Morris-Pratt algorithm implemented in C, PHP and PHP Extension
C
8
star
74

PerlTW-Planet

Perl Taiwan Planet
CSS
8
star
75

inflect

Inflector for Go
Go
7
star
76

vagrant-kubeadm

Vagrant for kubeadm
Shell
7
star
77

chrome-extension-template

7
star
78

bufexplorer

Vim Script
7
star
79

more.vim

δΈ€η”¨ε°±ζ„›δΈŠηš„δΈ­ζ–‡ε‡ζ–‡η”’η”Ÿε™¨δΉ‹ Vim Plugin
Vim Script
7
star
80

sid

Sequential ID generator as a micro-service, implemented in Go
Go
7
star
81

d3-kmeans

A simple, lightweight, single-dimension k-means clustering algorithm implemented in javascript for d3.
JavaScript
7
star
82

alpine-dlib

base image for dlib application
Shell
7
star
83

Kendo

The Powerful Access Control Framework
PHP
7
star
84

CacheKit

Generic cache interface for FileSystem cache, Memcached, ApcCache, ... etc
PHP
7
star
85

requestgen-tutorial

Go
7
star
86

universal

The general purpose standard library for PHP.
PHP
7
star
87

PHPUnit_TestMore

let you define Test::More-like unit tests and base on the great PHPUnit testing framework.
PHP
7
star
88

CurlKit

A tiny curl based library for managing request/response/download task.
PHP
7
star
89

glusterfs-deploy

Shell
6
star
90

taipei.pm

Taipei.pm
Perl
6
star
91

ssh-authorizedkey

AuthorizedKey Encoder implemented in Go
Go
6
star
92

action-js

The powerful javascript library for connecting form components with backend protocols.
JavaScript
6
star
93

zhwrap.vim

Chinese text wrapping vim plugin.
Vim Script
6
star
94

c9s

6
star
95

go-duck

Duck Typing for Go
Go
6
star
96

OAuthProvider

PHP
6
star
97

php-fileutil

Fast File Utility Functions in PHP Extension and Pure PHP.
C
6
star
98

cssmin

Fast & Simple CSS Minify C extension for PHP
C
6
star
99

VersionKit

Version String Utilities
PHP
6
star
100

dlib-serving

Run dlib model inference as a gRPC server
CMake
6
star