rcs.process.css(src[, options][, callback])
Store all matched selectors into the library and saves the new generated file with all renamed selectors.
Sync: process.cssSync
Parameters:
- src
<String | Array>
- options
<Object>
optional - callback
<Function>
optional
Options:
- optimize
<Boolean>
: checks if the selectors should be optimized. Default istrue
- all options of rcs.process
- plus options rcsCore.fillLibrary
Example:
const rcs = require('rename-css-selectors');
// callback
rcs.process.css('**/*.css', options, (err) => {
if (err) {
return console.error(err);
}
console.log('Successfully wrote new files and stored values');
});
// promise
rcs.process.css('**/*.css', options)
.then(() => console.log('Successfully wrote new files and stored values'));
.catch(console.error);
// async/await
(async () => {
try {
await rcs.process.css('**/*.css', options);
console.log('Successfully wrote new files and stored values')
} catch (err) {
console.error(err);
}
})();