Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@master/css-compiler

Package Overview
Dependencies
Maintainers
2
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@master/css-compiler

The ahead-of-time compiler of Master CSS

  • 2.0.0-beta.113
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44
decreased by-54.17%
Maintainers
2
Weekly downloads
 
Created
Source

Master CSS

The ahead-of-time compiler of Master CSS

NPM Version NPM Version NPM package ( download / month ) Discord online Follow @mastercorg Github release actions

Usage

npm install @master/css-compiler
const compiler = await new MasterCSSCompiler()

Options

{
    // specify virtual CSS module id (e.g. virtual:master.css)
    module: 'master.css',
    // specify config file path or set `Config`
    config: 'master.css.{ts,js,mjs,cjs}',
    // forcibly specify sources for scanning, not excluded by `options.exclude`
    sources: [],
    // specify sources for scanning
    include: ['**/*.{html,js,jsx,ts,tsx,svelte,astro,vue,md,mdx,pug,php}'],
    // specify sources to exclude
    exclude: [
        '**/node_modules/**',
        '**/*.d.ts',
        '**/*.test.*',
        'node_modules',
        'master.css.{js,ts,mjs,cjs}',
        'dist',
        'out',
        'README.md'
    ],
    classes: {
        // whitelist of class names for unpredictable dynamics
        fixed: [],
        // blacklist of class names to exclude accidentally captured
        ignored: []  // or RegExp[]
    },
    cwd: process.cwd()
}

Methods

// Reload the compiler and MasterCSS
refresh(): this
// Scan sources, extract class names, and generate CSS rules
compile()
// Extract potential class names from the given file content
extract(name: string, content: string): string[]
// `extract(name, content)`, insert extractions, and generate CSS rules
insert(name: string, content: string): boolean
// Read file source paths by `options.include` and `options.exclude`
get sources(): string[]
// Check source file path by `options.include` and `options.exclude`
checkSourcePath(name: string): boolean
// Read user config file by `options.config`
readConfig(): Config
// Get user config path
get configPath(): string
// Get resolved user config path
get resolvedConfigPath(): string

Properties

export default class MasterCSSCompiler {
    css: MasterCSS
    extractions = new Set<string>()
    ...
}

Keywords

FAQs

Package last updated on 22 Feb 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc