docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a CSS processor that uses PostCSS to handle CSS Modules composition declarations, specifically processing global scope references.
Create a function that processes CSS content using PostCSS to transform composes declarations that reference global classes. The processor should handle the transformation of global class references into the proper global() wrapped format.
Your solution should:
When processing CSS with global compositions:
.alert { composes: warning from global; } becomes .alert { composes: global(warning); }.alert { composes: warning error from global; } becomes .alert { composes: global(warning) global(error); }/**
* Processes CSS content to transform global compose declarations
* @param {string} cssContent - The CSS content to process
* @returns {Promise<string>} Promise resolving to the transformed CSS content
*/
async function processGlobalComposes(cssContent) {
// Implementation here
}
module.exports = { processGlobalComposes };PostCSS framework for transforming CSS with JavaScript plugins.
PostCSS plugin that transforms CSS Modules compose declarations and extracts imports.