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

[@sheet] If a stylesheet contains named @sheet references and rules outside of the @sheet references, what happens in all cases when a fragment identifier is not specified? #940

Open
aluhrs13 opened this issue Jan 22, 2025 · 1 comment
Assignees
Labels

Comments

@aluhrs13
Copy link
Contributor

If a stylesheet contains named @sheet references and rules outside of the @sheet references, what happens in all cases when a fragment identifier is not specified? For example:

@sheet foo {
  div{
    color: red;
  }
}
div {
  color: blue;
}
<style>
  @import "sheet.css" /* Does the @sheet "foo" get dropped? */
</style>
<link rel="stylesheet" href="sheet.css"> <!-- Does the @sheet "foo" get dropped? -->
@aluhrs13 aluhrs13 self-assigned this Jan 22, 2025
@kbabbitt
Copy link
Member

By "dropped" do you mean "style rules within @sheet are not applied"? If so, I think the answer is "yes," but I'd imagine the contents of @sheet are still reachable in some way via CSSOM.

(My general mental model for @sheet is similar to SVG <defs>, where the content is fully part of the object model but doesn't participate in rendering unless explicitly referenced.)

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

No branches or pull requests

2 participants