go-sass

module
v0.0.0-...-05ae0ce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2021 License: MIT

README

go-sass (No use, in progress)

License Go Report Card GoDoc

A Golang implementation of Sass.

Why

This is a project for learning AST syntax analysis tree. It is not recommended to use it in production for the time being. The project is not stable enough

Using Golang Sass

Form go get
go install github.com/aimuz/go-sass/cmd/sass@latest

If you are a golang user, you can install it globally through go get, which only provides cli usage

go get github.com/aimuz/go-sass/sass

If you want to import the library, just go get in your project

package main

import (
	"fmt"
	"github.com/aimuz/go-sass/sass"
)

func main() {
	fmt.Println(sass.Compile("input.scss", nil))
	fmt.Println(sass.CompileString("h1 {font-size: 40px}", nil))
}
From npm

We compile the core library into wasm, and then provide the NTP package through typescript wrapper

npm -i go-sass

Provides the same API as dart sass

From Homebrew (OS X)
brew install go-sass

TODO

  • CSS Parser
  • SCSS Parser
  • SASS Parser
  • WASM - NPM Package
  • tinygo
  • Built in functions
    • xxx
    • ...
  • Compress
    • Minimum color value

Acknowledgments

  • Thanks,csstree Provide ast reference

Directories

Path Synopsis
cmd
ast
Package ast declares the types used to represent syntax trees for Go packages.
Package ast declares the types used to represent syntax trees for Go packages.
token
Package token defines constants representing the lexical tokens of the Go programming language and basic operations on tokens (printing, predicates).
Package token defines constants representing the lexical tokens of the Go programming language and basic operations on tokens (printing, predicates).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL