/*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
const require_index = require('../../css-tokens/dist/index.cjs');
const require_index$1 = require('../../modes/dist/index.cjs');
const require_getColorModeStyles = require('../utils/getColorModeStyles.cjs');
let lodash_isString_js = require("lodash/isString.js");
lodash_isString_js = require_runtime.__toESM(lodash_isString_js);

//#region src/tailwind/base/addColorModeVarsV2.ts
function addColorModeVarsV2(tokens, { addBase, config }) {
	const parentConfigImportant = config().important;
	const rootSelector = (0, lodash_isString_js.default)(parentConfigImportant) ? parentConfigImportant : ":root";
	const styles = require_getColorModeStyles.getColorModeStyles(tokens);
	const stylesWithInvert = (key) => {
		const { colorScheme: _, ...stylesDefault } = styles[key];
		const { colorScheme: __, ...stylesInvert } = styles[key === "light" ? "dark" : "light"];
		return {
			...stylesDefault,
			[`.${require_index.INVERT_COLOR_MODE_CLASSNAME}`]: stylesInvert
		};
	};
	const lightWithInvert = stylesWithInvert("light");
	const darkWithInvert = stylesWithInvert("dark");
	addBase({
		[rootSelector]: {
			colorScheme: require_index$1.DEFAULT_COLOR_MODE,
			...stylesWithInvert(require_index$1.DEFAULT_COLOR_MODE)
		},
		[`.${require_index.SYSTEM_COLOR_MODE_CLASSNAME}`]: {
			colorScheme: "light dark",
			"@media (prefers-color-scheme: dark)": darkWithInvert
		},
		[`.${require_index.LIGHT_COLOR_MODE_CLASSNAME}`]: {
			colorScheme: "light",
			...lightWithInvert
		},
		[`.${require_index.DARK_COLOR_MODE_CLASSNAME}`]: {
			colorScheme: "dark",
			...darkWithInvert
		}
	});
}

//#endregion
exports.addColorModeVarsV2 = addColorModeVarsV2;