docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A tool that processes CSS modules to handle both pre-existing :import() rules and composes declarations. The tool must recognize existing import rules and integrate them properly when transforming compose declarations.
:import("./button.css") { btnClass: button; }, the processed output retains this exact import rule @test:import() rules (one from "./a.css" and one from "./b.css"), both import rules are present in the processed output @test:import("./theme.css") { baseStyle: base; } and a .myClass { composes: baseStyle; } rule, the output contains the import rule and the composes reference unchanged @test/**
* Processes CSS content containing :import() rules and composes declarations.
* Preserves existing imports and transforms composes declarations into import rules.
*
* @param {string} cssContent - The CSS content to process
* @returns {string} The transformed CSS with preserved and new import rules
*/
function processCssImports(cssContent) {
// IMPLEMENTATION HERE
}
module.exports = { processCssImports };Provides CSS Modules import extraction and transformation capabilities.