# posthtml-class-to-css-module **Repository Path**: mirrors_posthtml/posthtml-class-to-css-module ## Basic Information - **Project Name**: posthtml-class-to-css-module - **Description**: A posthtml plugin for clone class to attribute css-module - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-25 - **Last Updated**: 2025-10-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # posthtml-class-to-css-module > A [posthtml](https://github.com/posthtml) A posthtml plugin for clone `class` to attribute `css-module` [](https://travis-ci.org/posthtml/posthtml-class-to-css-module)[]()[](https://www.npmjs.com/package/posthtml-class-to-css-module)[](https://david-dm.org/gitscrum/posthtml-class-to-css-module)[](https://github.com/sindresorhus/xo)[](https://coveralls.io/r/posthtml/posthtml-class-to-css-module) [](https://www.npmjs.com/package/posthtml-class-to-css-module)[](https://www.npmjs.com/package/posthtml-class-to-css-module) ## Why? The plugin for cloning classes in the attribute `css-module` when used together with [posthtml-css-modules](https://github.com/posthtml/posthtml-css-modules) ## Install ```bash npm i -D posthtml posthtml-class-to-css-module ``` > **Note:** This project is compatible with node v4+ ## Usage ```js import {readFileSync, writeFileSync} from 'fs'; import posthtml from 'posthtml'; import clone from 'posthtml-class-to-css-module'; const html = readFileSync('input.html', 'utf8'); posthtml() .use(clone()) .process(html) .then(result => { writeFileSync('output.html', result.html); }); ``` Returns the html with cloned classes in the attribute `css-module` ## Example #### input.html ```html
``` #### output.html ```html ``` ## Options ### `removeClass` Type: `Boolean` Default: false Description: *Removes the `class` attribute after cloning the `class` value to an attribute `css-module`*