Replies: 1 comment 1 reply
-
Sounds like a good idea to me! I wonder if there are currently any instances of a single parameter containing "/". It sounds unlikely. I mean, I would obviously prefer it if we had a sensible hierarchy for CSS, but since that discussion isn't going anywhere... 🤷 . |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Note: There's a thematically similar discussion, but this discussion focuses on
{{CSSXref}}
and attempts to materialize its refactoring due to the simpler structure of CSS pages (before this discussion gets momentum again). For anyone that has read the first discussion, the first section below can be skipped.Many CSS functions now reside under a CSS data type, e.g:
rgb()
is under<color>
;linear-gradient()
is under<gradient>
.Apart from this, all descriptors are under their respective ar-rules, e.g:
font-display
is under@font-face
.prefers-color-scheme
is under@media
.To refer to these functions and descriptors per current page structures using
{{CSSXref}}
, it's necessary to use a rather repetitive invocation like{{CSSXref("color_value/rgb", "rgb()")}}
, which almost defeats the purpose of the macro.Therefore, I propose to refactor
{{CSSXref}}
as below:No change for CSS functions right under
/CSS
, e.g.abs()
.Note: (1) CurrentlySee fix(macros/cssxref): correct URL generation for data types and functions yari#8766.{{CSSXref("abs()")}}
would generate a link pointing tohttps://developer.mozilla.org/en-US/docs/Web/CSS/abs()
, and the extraneous parentheses in the URL needs removing. (2){{CSSXref("fit-content()")}}
fails to be handled correctly like the way<color>
is.For any invocation with a single parameter containing
/
, set the link text as the content after/
. Ifpage-type
iscss-function
, postfix with parentheses.This means the following change to
{{CSSXref}}
on Line 34:Note: (1) Postfixing is gracefully handled by existing Line 62 to 64. (2)
lastIndexOf()
is used future-proof instead ofindexOf()
.If there's consensus on moving forward, I'd be happy to open a PR in mdn/yari.
Beta Was this translation helpful? Give feedback.
All reactions