Notable Changes
Support animation-name property (#389)
Support resolving references from animation-name: foo; to @keyframes foo {...}.
2026-05-10.1.39.16.mov
@css-modules-kit/codegen@1.2.0
Patch Changes
-
#399
f758c23- refactor(core, codegen): do not emit token reference statements in generated.d.tsfilesStatements like
styles['a_1'];and__self['a_1'];(emitted foranimation-namereferences to@keyframes) used to appear in the.d.tsfiles written by codegen. These statements exist solely to wire up editor language features such as Go to Definition, Find All References, and Rename, and are not needed at compile time. The visible types exported by these files are unchanged, but codegen output is no longer cluttered with statements that look meaningless to a reader of the type definition file. The statements are still emitted by the TS plugin, where the language features are actually served. -
Updated dependencies [
f758c23,2d672a6,bf028b1,ab602bf,feff13f,d0c1750]:- @css-modules-kit/core@1.2.0
@css-modules-kit/core@1.2.0
Minor Changes
-
#389
ab602bf- feat(core, ts-plugin, eslint-plugin, stylelint-plugin): support animation-name propertyanimation-name: foo;is now linked back to the@keyframes foo {...}declaration. Go to Definition jumps from a reference to the declaration, Find All References lists every reference site, and Rename updates the declaration and every reference together. Comma-separated names (animation-name: foo, bar;),local()/global()notation, and vendor prefixes (-webkit-animation-name) are all supported. References to@keyframesdefined in another file via@importare resolved as well.Two diagnostics are also emitted for invalid usage:
- Parse phase: malformed
local(...)calls (empty, multiple identifiers, or non-identifier nodes such as a nested function) are reported. - Check phase: token references that resolve to neither a locally defined token nor an imported token are reported as
Cannot find token '<name>'..
The
no-unused-class-namesrule in eslint-plugin and stylelint-plugin now treats names referenced viaanimation-namefrom within the same CSS as used, so they are no longer reported as unused. - Parse phase: malformed
Patch Changes
-
#399
f758c23- refactor(core, codegen): do not emit token reference statements in generated.d.tsfilesStatements like
styles['a_1'];and__self['a_1'];(emitted foranimation-namereferences to@keyframes) used to appear in the.d.tsfiles written by codegen. These statements exist solely to wire up editor language features such as Go to Definition, Find All References, and Rename, and are not needed at compile time. The visible types exported by these files are unchanged, but codegen output is no longer cluttered with statements that look meaningless to a reader of the type definition file. The statements are still emitted by the TS plugin, where the language features are actually served. -
#395
2d672a6- fix(core): make default-exportstylestype-readonly viaas constThe default-export
.d.tspreviously emitted each token as'<name>': '' as readonly string,. Thereadonlymodifier is only valid on array/tuple types, so this was a TypeScript syntax error silently suppressed by@ts-nocheck—styleswas not actually readonly and writes likestyles.foo = '...'were accepted bytsc. The generator now emits'<name>': '' as string,per token and closes the object literal with} as const, sotypeof stylesisReadonly<{ ... }>and writes to it are now correctly reported as type errors. -
#386
bf028b1- fix(core): use the alias name when collecting re-exported tokens via@value ... as ... from ...createExportBuilderwas recording the source-side name (entry.name) into the importing module'sExportRecordinstead of the alias the importing module actually exposes (entry.localName). This caused downstream consumers to look up the wrong name, e.g.checkCSSModulewould emit a false "no exported token" diagnostic for an aliased token re-imported from another module. -
#390
feff13f- fix(core): ensure the.d.tsgenerated in named exports mode is always treated as a moduleWhen a CSS Module file had no exported tokens or importers (e.g. an empty file), the generated
.d.tsin named exports mode contained no top-levelexport/import, so TypeScript treated it as a global script and reportedTS2306onimport * as styles from './a.module.css'. The generator now appendsexport {};whenever it does not emit any other top-levelexport/import, so the generated.d.tsis always treated as a module. -
#384
d0c1750- refactor(core): rename TokenImporter variants to ESTree-style namesRename the public types so they describe the abstract shape of the import
(matching ESTree'sExportAllDeclaration/ExportNamedDeclaration)
rather than the CSS syntax that produced them:AtImportTokenImporter→AllTokenImporter(type: 'all')AtValueTokenImporter→NamedTokenImporter(type: 'named')AtValueTokenImporterValue→NamedTokenImporterEntryNamedTokenImporter.values→NamedTokenImporter.entries
The
corepackage is an internal building block — end users interact
with CSS Modules Kit throughts-plugin,codegen,eslint-plugin,
andstylelint-plugin, none of which reference the renamed names. This
change is therefore released as a patch.
@css-modules-kit/eslint-plugin@1.2.0
Patch Changes
-
#389
ab602bf- feat(core, ts-plugin, eslint-plugin, stylelint-plugin): support animation-name propertyanimation-name: foo;is now linked back to the@keyframes foo {...}declaration. Go to Definition jumps from a reference to the declaration, Find All References lists every reference site, and Rename updates the declaration and every reference together. Comma-separated names (animation-name: foo, bar;),local()/global()notation, and vendor prefixes (-webkit-animation-name) are all supported. References to@keyframesdefined in another file via@importare resolved as well.Two diagnostics are also emitted for invalid usage:
- Parse phase: malformed
local(...)calls (empty, multiple identifiers, or non-identifier nodes such as a nested function) are reported. - Check phase: token references that resolve to neither a locally defined token nor an imported token are reported as
Cannot find token '<name>'..
The
no-unused-class-namesrule in eslint-plugin and stylelint-plugin now treats names referenced viaanimation-namefrom within the same CSS as used, so they are no longer reported as unused. - Parse phase: malformed
-
Updated dependencies [
f758c23,2d672a6,bf028b1,ab602bf,feff13f,d0c1750]:- @css-modules-kit/core@1.2.0
@css-modules-kit/stylelint-plugin@1.2.0
Patch Changes
-
#389
ab602bf- feat(core, ts-plugin, eslint-plugin, stylelint-plugin): support animation-name propertyanimation-name: foo;is now linked back to the@keyframes foo {...}declaration. Go to Definition jumps from a reference to the declaration, Find All References lists every reference site, and Rename updates the declaration and every reference together. Comma-separated names (animation-name: foo, bar;),local()/global()notation, and vendor prefixes (-webkit-animation-name) are all supported. References to@keyframesdefined in another file via@importare resolved as well.Two diagnostics are also emitted for invalid usage:
- Parse phase: malformed
local(...)calls (empty, multiple identifiers, or non-identifier nodes such as a nested function) are reported. - Check phase: token references that resolve to neither a locally defined token nor an imported token are reported as
Cannot find token '<name>'..
The
no-unused-class-namesrule in eslint-plugin and stylelint-plugin now treats names referenced viaanimation-namefrom within the same CSS as used, so they are no longer reported as unused. - Parse phase: malformed
-
Updated dependencies [
f758c23,2d672a6,bf028b1,ab602bf,feff13f,d0c1750]:- @css-modules-kit/core@1.2.0
@css-modules-kit/ts-plugin@1.2.0
Minor Changes
-
#389
ab602bf- feat(core, ts-plugin, eslint-plugin, stylelint-plugin): support animation-name propertyanimation-name: foo;is now linked back to the@keyframes foo {...}declaration. Go to Definition jumps from a reference to the declaration, Find All References lists every reference site, and Rename updates the declaration and every reference together. Comma-separated names (animation-name: foo, bar;),local()/global()notation, and vendor prefixes (-webkit-animation-name) are all supported. References to@keyframesdefined in another file via@importare resolved as well.Two diagnostics are also emitted for invalid usage:
- Parse phase: malformed
local(...)calls (empty, multiple identifiers, or non-identifier nodes such as a nested function) are reported. - Check phase: token references that resolve to neither a locally defined token nor an imported token are reported as
Cannot find token '<name>'..
The
no-unused-class-namesrule in eslint-plugin and stylelint-plugin now treats names referenced viaanimation-namefrom within the same CSS as used, so they are no longer reported as unused. - Parse phase: malformed
Patch Changes
-
#397
53793dd- fix(vscode, ts-plugin): support file rename from a CSS module@import/@value ... fromspecifierRenaming a CSS module via the import specifier in VS Code (e.g. invoking Rename Symbol on
b.module.cssinside@import './b.module.css';) now performs a real file rename and updates every importer of the renamed file. Previously the located text span was blindly replaced with the user's input, which dropped the path prefix ('./b.module.css'became'bb.module.css') and left the file on disk unchanged.ts-plugin exposes a new internal protocol handler
_css-modules-kit:getEditsForFileRenamethat wraps the standard tsservergetEditsForFileRenameso the request can be reached throughtypescript.tsserverRequest. -
Updated dependencies [
f758c23,2d672a6,bf028b1,ab602bf,feff13f,d0c1750]:- @css-modules-kit/core@1.2.0
css-modules-kit-vscode@1.2.0
Patch Changes
-
#397
53793dd- fix(vscode, ts-plugin): support file rename from a CSS module@import/@value ... fromspecifierRenaming a CSS module via the import specifier in VS Code (e.g. invoking Rename Symbol on
b.module.cssinside@import './b.module.css';) now performs a real file rename and updates every importer of the renamed file. Previously the located text span was blindly replaced with the user's input, which dropped the path prefix ('./b.module.css'became'bb.module.css') and left the file on disk unchanged.ts-plugin exposes a new internal protocol handler
_css-modules-kit:getEditsForFileRenamethat wraps the standard tsservergetEditsForFileRenameso the request can be reached throughtypescript.tsserverRequest. -
Updated dependencies [
53793dd,ab602bf]:- @css-modules-kit/ts-plugin@1.2.0