-
Notifications
You must be signed in to change notification settings - Fork 23k
chore(cssxref): Update markdown links with cssxref in /web/css
#42346
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
base: main
Are you sure you want to change the base?
Conversation
Search: \[`([^`]+?)`\]\(/en-US/docs/Web/CSS/Reference/Properties/\1\)
Replace: {{cssxref("$1")}}
Search: \[`([^`]+?)`\]\(/en-US/docs/Web/CSS/Reference/Properties/([^#)]+?)\)
Replace: {{cssxref("$2", "$1")}}
Search: \[`([^`]+?)`\]\(/en-US/docs/Web/CSS/Reference/Selectors/\1\)
Replace: {{cssxref("$1")}}
Search: \[`([^`]+?)`\]\(/en-US/docs/Web/CSS/Reference/At-rules/\1\)
Replace: {{cssxref("$1")}}
Search: \[`([^`]+?)`\]\(/en-US/docs/Web/CSS/Reference/Values/\1\)
Replace: {{cssxref("$1")}}
Search: \[`<([^`]+?)>`\]\(/en-US/docs/Web/CSS/Reference/Values/\1\)
Replace: {{cssxref("")}}
Search: \{\{cssxref\("([^"(]+)", "\1\(\)"\)\}\}
Replace: {{cssxref("$1()")}}
Preview URLs (245 pages)
Flaws (5456)Note! 85 documents with no flaws that don't need to be listed. 🎉 URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
URL:
TRUNCATED! (comment last updated: 2025-12-11 16:12:56) |
|
This pull request has merge conflicts that must be resolved before it can be merged. |
Description
This PR replaces the markdown links in
/files/en-us/web/css/with{{cssxref}}macro (the Search and Replace patterns are in the commit messages):/en-US/docs/Web/CSS/Reference/Properties/→{{cssxref("property")}}/en-US/docs/Web/CSS/Reference/Selectors/→{{cssxref(":selector")}}and{{cssxref("::selector")}}/en-US/docs/Web/CSS/Reference/At-rules/→{{cssxref("@at-rule")}}/en-US/docs/Web/CSS/Reference/Values/→{{cssxref("keyword")}},{{cssxref("function()")}}, and{{cssxref("data-type")}}For the already existing macro calls to functions, functional pseudo-classes, and functional pseudo-elements, I've simplified the macro to remove the first parameter because the macro can recognize functions and format them appropriately.
For example, updated
{{cssxref("calc", "calc()")}}to{{cssxref("calc()")}}.Additional details
The updated cssxref macro now automatically handles several cases.
URL generation based on prefix and suffix, then properties, then values:
(from cssxref code:)
So,
{{cssxref(":hover")}},{{cssxref("@media")}},{{cssxref("calc()")}},{{cssxref("unset")}}and{{cssxref("image")}}route to the respective directory withinWeb/CSS/Reference.Special mappings:
(from cssxref code:)
"<color>"|"<color>"=>"color_value""<flex>"|"<flex>"=>"flex_value""<overflow>"|"<overflow>"=>"overflow_value""<position>"|"<position>"=>"position_value"":host()"=>":host_function""fit-content()"=>"fit-content_function"So while the macro call for the
<image>data type is{{cssxref("image")}}, for<color>data type it is{{cssxref("<color>")}}to disambiguate from thecolorproperty.Note:
url_valueandurl_functionare not yet part of this treatment.Auto-formatting based on page type
The macro takes
page-typeinto account for formatting the display text. So, data types like{{cssxref("length")}}and keywords like{{cssxref("unset")}}get correctly formatted as<length>andunsetbased on their page types, even though the location of both resolves toWeb/CSS/Reference/Values. So additional html encodings (<and>) for data types is probably not needed. A lot ofcssxrefmacro instances for data types do have these encodings, some even with only<and>(instead of>). I've removed the html encodings from some but left the remaining as-is for now; the macro works with or without them.Related issues and pull requests
fit-content()slug andcalc()example anchor rari#431