docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A CSS processing utility that transforms CSS Modules composes declarations into :import() rules with proper import deduplication.
When multiple CSS rules compose classes from the same external file, the processor should reuse generated identifiers instead of creating duplicate import entries.
button class from ./components.css, the processed output contains exactly one :import() rule for that file and class, with the same generated identifier used in both composes declarations @testWhen composing multiple classes where some are duplicated and some are unique, the processor should deduplicate identical imports while creating separate identifiers for different classes.
.primary { composes: button icon from "./ui.css"; } and .secondary { composes: button badge from "./ui.css"; }, the output has one :import() rule for ./ui.css containing three unique identifiers (button, icon, badge), with the button identifier reused in both rules @testWhen classes with the same name are composed from different files, the processor should create separate import rules and identifiers for each source file.
.one { composes: button from "./buttons.css"; } and .two { composes: button from "./controls.css"; }, the output contains two separate :import() rules with different generated identifiers for each file @test/**
* Processes CSS content containing composes declarations.
* Transforms them into :import() rules with deduplicated identifiers.
*
* @param {string} inputCSS - The CSS content with composes declarations
* @returns {Promise<string>} The processed CSS with :import() rules
*/
async function processCompositions(inputCSS) {
// IMPLEMENTATION HERE
}
module.exports = { processCompositions };Provides CSS Modules import extraction and deduplication capabilities.