read0more/post-css-module

Get postCSS module classname from json

0.1.0 2022-01-27 07:18 UTC

This package is auto-updated.

Last update: 2025-05-27 14:38:44 UTC


README

Get CSS classname transformed by postCSS-module using the json file that comes out when transforming postCSS-module.

use PostCSSModule\Transformer;

$cssPath = '/css';
$jsonPathFromPostCSSModule = '/json';
$transformer = new Transformer($cssPath, $jsonPathFromPostCSSModule);

// css filename in $cssPath
$cssName = 'button';
$transformer->getTransformedCssInfo($cssName);

// You can get transformed class name.
// e.g. $transformedClassNames['button'] you can get transformed class name "button"
$transformedClassNames = $transformedCssInfo->classNames;