Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compose class named default #908

Open
mrginglymus opened this issue Feb 4, 2025 · 1 comment
Open

Unable to compose class named default #908

mrginglymus opened this issue Feb 4, 2025 · 1 comment

Comments

@mrginglymus
Copy link

input:

.default {
  color: blue;
}

.foo {
  composes: default;
  color: red;
}

expected output:

{
  "default": {
    "name": "EgL3uq_default",
    "composes": [],
    "isReferenced": false
  },
  "foo": {
    "name": "EgL3uq_foo",
    "composes": [
      {
        "type": "local",
        "name": "EgL3uq_default"
      }
    ],
    "isReferenced": false
  }
}

actual output:

{
  "default": {
    "name": "EgL3uq_default",
    "composes": [],
    "isReferenced": false
  },
  "foo": {
    "name": "EgL3uq_foo",
    "composes": [],
    "isReferenced": false
  }
}

Playground Reproduction

@mrginglymus
Copy link
Author

Ah, it appears the problem is that

let valid = match_ignore_ascii_case! { &ident,
"initial" | "inherit" | "unset" | "default" | "revert" | "revert-layer" => false,
_ => true
};
disallows idents with these reserved names. However, I'm not sure that that is required by the css modules spec; it's certainly not explicitly mentioned, and the class references aren't really custom idents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant