# posthtml-css-modules **Repository Path**: mirrors_posthtml/posthtml-css-modules ## Basic Information - **Project Name**: posthtml-css-modules - **Description**: Use CSS modules in HTML - **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-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # posthtml-css-modules [](http://badge.fury.io/js/posthtml-css-modules) [](https://travis-ci.org/posthtml/posthtml-css-modules) [PostHTML](https://github.com/posthtml/posthtml) plugin that inlines [CSS modules](https://github.com/css-modules/css-modules) in HTML. ## Usage I suggest using [postcss-modules](https://github.com/outpunk/postcss-modules) to generate CSS modules. Check [the PostHTML documentation](https://github.com/posthtml/posthtml#usage) for integration examples with grunt, gulp, and other build systems. If you're more into webpack then you don't need all these modules at all. With `css`, `style`, and `html` loaders you can achieve the same result: [css-modules-webpack-example](https://github.com/maltsev/css-modules-webpack-example) ### Global file Let's say we have `cssClasses.json` with all CSS modules inside: ```json { "title": "_title_116zl_1 _heading_9dkf", "profile": { "user": "_profile_user_f93j" } } ``` Now we can inline these CSS modules in our HTML: ```js var posthtml = require('posthtml'); posthtml([require('posthtml-css-modules')('./cssClasses.json')]) .process( '