You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ee47dc2
Browse filesBrowse the repository at this point in the historyBrowse files
fix(css): resolve an imported @value, then scope it like a local one (#22443)
* fix(css): export a @value-named at-rule under its resolved name
* fix(css): export a @value-named at-rule only under a single resolved ident
* fix(css): resolve an imported @value, then scope it like a local one
* refactor(css): resolve imported @value declarations through one path
* chore(changeset): follow the changeset naming and length rules
* fix(css): point an imported @value at the name its defining module scoped
* fix(css): keep an imported @value keyword as text even when its module scoped that name
* Add the export entry for an ident a declaration site (an at-rule prelude, `local()`) localizes. A `@value` is resolved first: a local one exports under the ident it names, an imported one is left for `CssIcssExportDependency` to name once the import resolves.
1750
+
* @param {string} identifier ident as written in the source
1751
+
* @param {number} start ident start offset
1752
+
* @param {number} end ident end offset
1753
+
* @param {string | undefined} kind export kind for conflict tracking, undefined for a usage
1754
+
* @param {import("../dependencies/css/CssIcssExportDependency").ExportType} exportType export type
* Process a `local(...)` / `global(...)` pseudo-function: strip the call (and a leading legacy `:`) via a presentational dep, then emit `local()`'s inner top-level idents as ICSS exports.
1719
1814
* @param {FunctionNode} fn parsed local/global function node
@@ -1733,18 +1828,22 @@ class CssParser extends Parser {
1733
1828
for(constcvofA.children(fn)){
1734
1829
if(A.type(cv)!==NodeType.Ident)continue;
1735
1830
letidentifier=A.unescaped(cv);
1831
+
if(!isDashedIdentifier(identifier)){
1832
+
addLocalizedExport(
1833
+
identifier,
1834
+
A.start(cv),
1835
+
A.end(cv),
1836
+
declarationKind,
1837
+
CssIcssExportDependency.EXPORT_TYPE.NORMAL
1838
+
);
1839
+
continue;
1840
+
}
1736
1841
// Cursor reads instead of `A.loc` — no location objects allocated.
0 commit comments