Using Stylify CSS in Node.js

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.

Stylify can be used directly @stylify/stylify or via the @stylify/bundler package.

Integration example for the Node.js can be found in integrations examples repository .

How to integrate the Stylify CSS into the Node.js

You can create your own compliation process or use the @stylify/bundler package.

Using @stylify/stylify directly

For more information see Stylify documentation:

import { Compiler } from '@stylify/stylify';

const content = '';

// Compiler config info https://stylifycss.com/docs/stylify/compiler#configuration
const compiler = new Compiler({
    // https://stylifycss.com/docs/stylify/compiler#variables
    variables: {},
    // https://stylifycss.com/docs/stylify/compiler#macros
    macros: {},
    // https://stylifycss.com/docs/stylify/compiler#components
    components: {},
    // ...
});

const compilationResult = compiler.compile(content);
const css = compilationResult.generateCss();
const mangledContent = compiler.rewriteSelectors(content, compilationResult);

Using @stylify/bundler package

For more information see bundler documentation.