Skip to content

Configuration

Set up your Yumma CSS project with the CLI.

Initializing configuration file

To create a new yumma.config.js file in your project, run the following command:

Terminal
npx yummacss init

This command will create a new yumma.config.js file in the root of your project using ESM.

If you’re using export default, make sure "type": "module" is set in your package.json.
yumma.config.js
export default {
source: [""],
output: "",
};

Using CommonJS

If your project does not use ESM, you can use CommonJS instead:

yumma.config.cjs
module.exports = {
source: [""],
output: "",
};

Configuration options

The yumma.config.js file contains several options that you can use to configure the Yumma CSS CLI.

yumma.config.js
export default {
source: [""],
output: "",
buildOptions: {
reset: true, // default: true
minify: false, // default: false
},
};

source

The source array is collection of paths for your project files. This lets the CLI find the Yumma CSS utilities.

Use glob patterns to include subfolders and specific file types.
yumma.config.js
export default {
source: ["./src/**/*.html"],
};

output

The output option is a string that tells where the compiled CSS files should be saved.

yumma.config.js
export default {
output: "./src/styles.css",
};

buildOptions.reset

The reset option is a boolean that determines whether the inclusion of the Stylecent reset system. By default, the reset system is included.

This is an optional feature.
yumma.config.js
export default {
buildOptions: {
reset: true, // default: true
},
};

buildOptions.minify

The minify option is a boolean that determines whether the compiled CSS files should be minified. By default, the files are not minified.

This is an optional feature.
yumma.config.js
export default {
buildOptions: {
minify: true, // default: false
},
};

Building and watching

The Yumma CSS CLI provides several commands to help you work with your Yumma CSS files.

Make sure you have a yumma.config.js file set up before running these commands. If you haven’t, run npx yummacss init first.

Build

The build command will compile your Yumma CSS files once.

Building styles...
npx yummacss build

Watch

The watch command will watch for changes in your Yumma CSS files and recompile them automatically.

Building styles...
npx yummacss watch