Re: [csswg-drafts] Proposal: CSS @sheet (#11509)

> The CSSWG decided at the F2F last week to not go with URL fragments for binding to `@sheet` identifiers, so we're now looking into adding an attribute to `<link>` tags to specify which sheet is being imported as well as adding an optional identifier to `@import` for similar functionality there (e.g. `@import sheet1 from "style.css";`).

@KurtCattiSchmidt Is there a link to a resolution somewhere? And does this mean CSSWG is walking back on its [previous resolution](https://github.com/w3c/csswg-drafts/issues/5629#issuecomment-1498299448)?

Just for clarification, are all three of the following cases disallowed now?

1. `<link rel="stylesheet" href="/styles.css#sheet1">`
2. `import sheet1 from "/styles.css#sheet1" with { type: "css" };`
3. `<link rel="stylesheet" href="#sheet-in-same-document">`

My previous understanding was that 1 and 2 were fine, but only 3 was problematic.

---

In the updated explainer, I'm seeing this snippet:

```html
<link rel="stylesheet" href="#sheet" sheet="foo" />
```

If you ignore the `sheet` attribute, doesn't `href="#sheet"` imply that you can link a `<style id="sheet">` in the same document? That should probably be its own proposal/issue, as it seems useful even without `@sheet`.

-- 
GitHub Notification of comment by mayank99
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11509#issuecomment-2640221200 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 6 February 2025 15:55:06 UTC