CSSMinifier

@JSExportTopLevel("CSSMinifier")
object CSSMinifier extends DataURLPat
class Object
trait Matchable
class Any

Type members

Classlikes

Value members

Concrete methods

def handleColors: Unit
@tailrec
def handleCommentsAndStrings(s: List[Char], done: StringBuilder, preservedComments: List[String], preservedStrings: List[String], charset: Option[String]): (String, List[String], List[String], Option[String])

Assume s is a complete css content or valid css content just after comment block; This function removes comments except ones starting with !, preserve comments starts with !, string literals and the fisrt charset.

Assume s is a complete css content or valid css content just after comment block; This function removes comments except ones starting with !, preserve comments starts with !, string literals and the fisrt charset.

Returns:

(text without comments and strings to be removed,comments to be preserved,strings to be preserved,charset)

@tailrec
def handleEmptyLike(str: List[Char], prev: Option[Char], result: List[Char]): List[Char]

remove redundant leading and trailing whitespace-like chars, repeated semi-colons, repeated 0s(like margin: 0 0 0 0) and empty rules

remove redundant leading and trailing whitespace-like chars, repeated semi-colons, repeated 0s(like margin: 0 0 0 0) and empty rules

def handleZeros: Unit
@tailrec
def preserveURLs(s: String, done: StringBuilder, preservedURLs: List[String]): (String, List[String])

Leave data urls alone to increase parse performance.

Leave data urls alone to increase parse performance.

@tailrec
def readUntilClosingPairOrEOF(s: List[Char], close: Char, result: StringBuilder, prev: Option[Char]): Option[(String, List[Char])]
def run(css: String): String
@tailrec
def splitWhereAfter(str: List[Char], matcher: (Option[Char], Char) => Boolean, cursor: Int, consumed: List[Char], prev: Option[Char]): (Int, List[Char], List[Char])
@tailrec
def splitWhereBefore(str: List[Char], matcher: (Option[Char], Char) => Boolean, cursor: Int, consumed: List[Char], prev: Option[Char], shouldReverseBack: Boolean): (Int, List[Char], List[Char])

Inherited methods

def matchDataURLStart(str: String): Option[(Option[String], Int)]
Inherited from:
DataURLPat

Concrete fields

final val startComment: Regex