[css-page-3] Should `@page` declarations be hoisted?
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 24
Description
Current version of Chrome and FF hoist declarations in @page:
const sheet = new CSSStyleSheet
sheet.replaceSync(`
@page {
@top-left {
content: "green";
color: green;
}
color: red;
}
style {
@media {
color: green;
}
color: red;
}
`)
sheet.cssRules[0].cssText; // @page { color: red; @top-left { ...; color: green; } }
sheet.cssRules[1].cssText; // style { @media { color: green } color: red; }
If I am not mistaken, @page (with no page selector) and margin rules have the same specificity. So this might be unexpected, like in style rules.
Should they be wrapped in CSSNestedDeclarations whose style attribute is a CSSPageDescriptors?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the issue's CSSStyleSheet example and comparing the described @page and margin-rule behavior with CSSNestedDeclarations and CSSPageDescriptors. The work is complete when the CSS Working Group resolves whether @page declarations should be hoisted and records the resulting behavior in the relevant specification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100