css

package
v0.0.0-...-69391d1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2015 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

package 'css' helps to reduce the file-size of a given .css-file. it takes a very simple and naive approach to css-minification:

  • ignore linebreaks

  • condense multiples spaces/tabs into one " "

  • ignore whitespace before/after "{", ",", ":", ".", ";"

  • ignore comments

  • add linebreaks after "}" (optional)

Index

Constants

View Source
const PREFIX_EXCL_COMMENT = "/*!"

Variables

This section is empty.

Functions

func AddLineBreaks

func AddLineBreaks(r *reducer) error

add linebreaks after each rule

func KeepExclamationComments

func KeepExclamationComments(r *reducer) error

keeps comments like /*! this */

func Reduce

func Reduce(out io.Writer, in io.Reader, configs ...Config) (err error)

reads from 'in' and applies the rules sketched out above to reduce the bytes written to 'out' by not break anything. the output can be tweaked by adding several config functions, see css.AddLineBreaks and css.KeepExclamationComments

Types

type Config

type Config func(*reducer) error

func-type to tweak the way css.Reduce() works

Jump to

Keyboard shortcuts

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