API Reference
Create Master CSS
Set up or create a modern web app by running one command.
Setup
Create a config file
Initialize Master CSS in an existing project.
npm create @master/css@rc
Create a new app
Or you can specify an argument to create a new project, which by default uses the blank example.
npm create @master/css@rc project
Options
--ext esm
Specify creating a master.css.mjs
file in ECMAScript Modules format. If package.json
is set "type": "module"
will be enabled automatically.
Default | auto |
---|---|
Type | boolean |
npm create @master/css@rc --ext esm
View the generated file
/** @type {import('@master/css').Config} */export default { styles: {}, rules: {}, variables: {}, semantics: {}, mediaQueries: {}, animations: {}, selectors: {}, functions: {}}
--ext cjs
Specify creating a master.css.js
file in CommonJS format.
Default | auto |
---|---|
Type | boolean |
npm create @master/css@rc --ext cjs
View the generated file
/** @type {import('@master/css').Config} */module.exports = { styles: {}, rules: {}, variables: {}, semantics: {}, mediaQueries: {}, animations: {}, selectors: {}, functions: {}}
--ext ts
Specify creating a master.css.ts
file in TypeScript format. Automatically enabled if tsconfig.json
exists.
Default | auto |
---|---|
Type | boolean |
npm create @master/css@rc --ext ts
View the generated file
import type { Config } from '@master/css' export default { styles: {}, rules: {}, variables: {}, semantics: {}, mediaQueries: {}, animations: {}, selectors: {}, functions: {}} as Config
--example
Create a Master CSS App using official examples.
Default | 'blank' |
---|---|
Type | string |
npm create @master/css@rc project --example react
--pm
Manually specify the package manager you are using.
Default | auto |
---|---|
Type | string |
npm create @master/css@rc --pm bun
-o, --override
Override the existing Master CSS config file.
Default | false |
---|---|
Type | boolean |
npm create @master/css@rc --override