Using Stylify CSS in Node.js
Shortcuts:How to integrate the Stylify CSS into the Node.jsUsing @stylify/stylify directlyUsing @stylify/bundler package
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/en/docs/stylify/compiler#configuration
const compiler = new Compiler({
// https://stylifycss.com/en/docs/stylify/compiler#variables
variables: {},
// https://stylifycss.com/en/docs/stylify/compiler#macros
macros: {},
// https://stylifycss.com/en/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.