Mangling Selectors

When you want to mangle selectors, you must set the compiler option => mangleSelectors: true.

The example bellow is for a case when you would want to do some custom compilation. Packages like @stylify/bundler, @stylify/unplugin, @stylify/nuxt, @stylify/astro uses the same process internaly (automaticaly).

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

const content = '';

const compiler = new Compiler({
    mangleSelectors: true
});

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