{"@context":"https://w3id.org/codemeta/3.0","@type":"SoftwareSourceCode","identifier":"pkg:golang/github.com/benbjohnson/css","name":"github.com/benbjohnson/css","description":"Package css implements a CSS3 compliant scanner and parser. This is meant to\nbe a low-level library for extracting a CSS3 abstract syntax tree from raw\nCSS text.\n\nThis package can be used for building tools to validate, optimize and format\nCSS text.\n\nCSS parsing occurs in two steps. First the scanner breaks up a stream of code\npoints (runes) into tokens. These tokens represent the most basic units of\nthe CSS syntax tree such as identifiers, whitespace, and strings. The second\nstep is to feed these tokens into the parser which creates the abstract syntax\ntree (AST) based on the context of the tokens.\n\nUnlike many language parsers, the abstract syntax tree for CSS saves many of the\noriginal tokens in the stream so they can be reparsed at different levels. For\nexample, parsing a @media query will save off the raw tokens found in the\n{-block so they can be reparsed as a full style sheet. This package doesn't\nunderstand the specifics of how to parse different types of at-rules (such as\n@media queries) so it defers that to the user to handle parsing.\n\nThe CSS3 syntax defines a syntax tree of several types. At the top-level there\nis a StyleSheet. The style sheet is simply a collection of Rules. A Rule can be\neither an AtRule or a QualifiedRule.\n\nAn AtRule is defined as a rule starting with an \"@\" symbol and an identifier,\nthen it's followed by zero or more component values and finally ends with either\na {-block or a semicolon. The block is parsed simply as a collection of tokens\nand it is up to the user to define the exact grammar.\n\nA QualifiedRule is defined as a rule starting with one or more component values\nand ending with a {-block.\n\nInside the {-blocks are a list of declarations. Despite the name, a list of\ndeclarations can be either an AtRule or a Declaration. A Declaration is an\nidentifier followed by a colon followed by one or more component values. The\ndeclaration can also have it's Important flag set if the last two non-whitespace\ntokens are a case-insensitive \"!important\".\n\nComponentValues are the basic unit inside rules and declarations. A\nComponentValue can be either a SimpleBlock, a Function, or a Token. A simple\nblock starts with either a {, [, or (, has zero or more component values, and\nthen ends with the mirror of the starting token (}, ], or )). A Function is\nan identifier immediately followed by a left parenthesis, then zero or more\ncomponent values, and then ending with a right parenthesis.","version":"v0.0.0-20141214004234-6538f8623a6a","softwareVersion":"v0.0.0-20141214004234-6538f8623a6a","license":"https://spdx.org/licenses/MIT","codeRepository":"https://github.com/benbjohnson/css","issueTracker":"https://github.com/benbjohnson/css/issues","url":"https://github.com/benbjohnson/css","programmingLanguage":{"@type":"ComputerLanguage","name":"Go"},"dateCreated":"2014-12-14","dateModified":"2014-12-14","datePublished":"2014-12-14","copyrightYear":2014,"downloadUrl":"https://proxy.golang.org/cached-only/github.com/benbjohnson/css/@v/v0.0.0-20141214004234-6538f8623a6a.zip","softwareHelp":{"@type":"WebSite","url":"https://pkg.go.dev/github.com/benbjohnson/css#section-documentation"},"applicationCategory":"go","runtimePlatform":"go","developmentStatus":"active","sameAs":["https://pkg.go.dev/github.com/benbjohnson/css"],"https://www.w3.org/ns/activitystreams#likes":84,"https://forgefed.org/ns#forks":8}