You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

go.baoshuo.dev/css-parser

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

go.baoshuo.dev/css-parser

v0.0.6
Go
Version published
Created
Source

go-css-parser

Installation

go get go.baoshuo.dev/css-parser

Usage

package main

import "go.baoshuo.dev/css-parser"

func main() {
  // Parse CSS declarations (e.g., from style attribute)
  declarations, err := cssparser.ParseDeclarations(`
    color: red;
    font-size: 16px;
  `)

  // Parse CSS stylesheet (e.g., from a <style> tag)
  stylesheet, err := cssparser.ParseStylesheet(`
    .example {
      color: blue;
      font-size: 14px;
    }
  `)
}

Credits

  • https://github.com/tdewolff/parse
  • https://github.com/aymerick/douceur
  • https://github.com/csstree/csstree

Author

go-css-parser © Baoshuo, Released under the MIT License.

Personal Homepage · Blog · GitHub @renbaoshuo

FAQs

Package last updated on 18 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts