w3c / specberus

Checker used at W3C to validate the compliance of Technical Reports with publication rules
https://www.w3.org/pubrules/
MIT License
72 stars 45 forks source link

Specberus rejects documents linking to the W3C's darkmode stylesheet #1739

Closed tabatkins closed 1 year ago

tabatkins commented 1 year ago

The dark-mode stylesheet has to be loaded after the base stylesheet, because the darkmode sheet sets colors with a :root selector that needs to override the :root selector in the base sheet.

However, Specberus rejects documents doing this:

Specberus Errors:
694    W3C TR style sheet must be last.
695      { name: 'style.sheet', section: 'metadata', rule: 'lastStylesheet' }
696  
697  Details: https://labs.w3.org/echidna/api/status?id=f37a4708-ff03-407a-a3c2-b967abaf0fe2
698  💥 Echidna publish has failed.

Either Specberus needs to allow the W3C's darkmode styles to come after base, or the darkmode sheet needs to have its selector adjusted so it'll override regardless of load order.

deniak commented 1 year ago

Indeed, specberus needs to be updated to allow that stylesheet to come after the regular one. I'll take care of that.

On a side note, I looked at the document submitted to echidna and while it's using the 2021 style, the link to the dark mode stylesheet was from the 2016 style, i.e. https://www.w3.org/StyleSheets/TR/2016/dark.css. To allow the user to switch from one mode to another, it needs to load the stylesheet from the same year (https://www.w3.org/StyleSheets/TR/2021/dark.css). I can probably update pubrules to check that as well.

tabatkins commented 1 year ago

Note that the logo links in the 2021 stylesheet don't work.

deniak commented 1 year ago

Note that the logo links in the 2021 stylesheet don't work.

Indeed, the files were missing. This is now fixed and the patch for the dark mode stylesheet has been deployed. Thanks for the report.