diff --git a/packages/next-yak/loaders/cssloader.cjs b/packages/next-yak/loaders/cssloader.cjs index e7fe97ec..2ad3b9c9 100644 --- a/packages/next-yak/loaders/cssloader.cjs +++ b/packages/next-yak/loaders/cssloader.cjs @@ -221,8 +221,7 @@ module.exports = async function cssLoader(source) { }); } - // Store reference to AST node to allow other components to target the styled literal inside css like - // e.g. `& ${Button} { ... }` + // Store class name of the created variable if (isStyledLiteral || isStyledCall || isAttrsCall) { const variableName = getStyledComponentName(path); // TODO: reuse existing class name if possible