Skip to content
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

move rel="alternate stylesheet" from CSS guide to HTML attribute #38146

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

estelle
Copy link
Member

@estelle estelle commented Feb 13, 2025

This is an HTML feature (and contains no CSS), so it belongs under HTML.

The moved page defines "Alternative style sheet", which is the main place where the term is defined, so link terms my read "alternate stylesheet" which is the slug value and attribute value, while others read Alternative style sheet, which is defined in the intro, so can't link to a #heading.

@estelle estelle requested review from a team as code owners February 13, 2025 20:09
@estelle estelle requested review from chrisdavidmills and wbamberg and removed request for a team February 13, 2025 20:09
@github-actions github-actions bot added Content:HTML Hypertext Markup Language docs Content:WebAPI Web API docs Content:SVG SVG docs size/s [PR only] 6-50 LoC changed labels Feb 13, 2025
Copy link
Contributor

github-actions bot commented Feb 13, 2025

Preview URLs (7 pages)
Flaws (17)

URL: /en-US/docs/Web/API/SVGStyleElement/title
Title: SVGStyleElement: title property
Flaw count: 1

  • broken_links:
    • /en-US/docs/Web/HTML/Attributes/rel/Alternate_stylesheet is ill cased

URL: /en-US/docs/Web/API/StyleSheet/disabled
Title: StyleSheet: disabled property
Flaw count: 1

  • broken_links:
    • /en-US/docs/Web/HTML/Attributes/rel/Alternate_stylesheet is ill cased

URL: /en-US/docs/Web/HTML/Attributes/rel
Title: HTML attribute: rel
Flaw count: 3

  • broken_links:
    • /en-US/docs/Glossary/prefetch is ill cased
    • /en-US/docs/Web/HTML/Attributes/rel/Alternate_stylesheet is ill cased
  • macros:
    • Macro produces link /en-US/docs/Glossary/prefetch which is a redirect

URL: /en-US/docs/Web/HTML/Attributes/rel/alternate_stylesheet
Title: Alternate stylesheet
Flaw count: 2

  • broken_links:
    • /en-US/docs/Glossary/stylesheet is ill cased
  • macros:
    • Macro produces link /en-US/docs/Glossary/stylesheet which is a redirect

URL: /en-US/docs/Web/HTML/Element/link
Title: <link>: The External Resource Link element
Flaw count: 6

  • broken_links:
    • /en-US/docs/Glossary/void_element is ill cased
    • /en-US/docs/Glossary/void_element is ill cased
    • /en-US/docs/Web/HTML/Attributes/rel/Alternate_stylesheet is ill cased
    • /en-US/docs/Web/HTML/Attributes/rel/Alternate_stylesheet is ill cased
  • macros:
    • Macro produces link /en-US/docs/Glossary/void_element which is a redirect
    • Macro produces link /en-US/docs/Glossary/void_element which is a redirect

URL: /en-US/docs/Web/HTML/Element/style
Title: <style>: The Style Information element
Flaw count: 2

  • broken_links:
    • /en-US/docs/Web/HTML/Attributes/rel/Alternate_stylesheet is ill cased
    • /en-US/docs/Web/HTML/Attributes/rel/Alternate_stylesheet is ill cased

URL: /en-US/docs/Web/SVG/Element/style
Title: <style>
Flaw count: 2

  • broken_links:
    • /en-US/docs/Web/HTML/Attributes/rel/Alternate_stylesheet is ill cased
  • macros:
    • Can't resolve /en-US/docs/Web/SVG/Attribute/title
External URLs (1)

URL: /en-US/docs/Web/HTML/Attributes/rel/alternate_stylesheet
Title: Alternate stylesheet

(comment last updated: 2025-02-14 23:34:15)

Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@estelle Again, this makes sense. Few comments for you, but nothing major.

@@ -28,7 +28,7 @@ The alternate stylesheets are commonly specified using a {{HTMLElement("link")}}

In this example, the styles "Default Style", "Fancy", and "Basic" will be listed in the _Page Style_ submenu, with "Default Style" pre-selected. When the user selects a different style, the page will immediately be re-rendered using that style sheet.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is Firefox-specific. Make that clear?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up — looking at the BCD table, this is now only supported in Firefox, although it is still a standard. This might affect how you decide to update this wording, if at all.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is, so added.

@@ -42,7 +42,7 @@ Any stylesheet in a document falls into one of the following categories:
- **Preferred** (has `rel="stylesheet"`, with `title="…"` specified): applied by default, but {{domxref("StyleSheet.disabled", "disabled", "", 1)}} if an alternate stylesheet is selected. **There can only be one preferred stylesheet**, so providing stylesheets with different title attributes will cause some of them to be ignored.
- **Alternate** (`rel="alternate stylesheet"`, with `title="…"` specified): disabled by default, can be selected.

When style sheets are referenced with a `title` attribute on the {{HTMLElement("link", "&lt;link rel=\"stylesheet\"&gt;")}} or {{HTMLElement("style")}} element, the title becomes one of the choices offered to the user. Style sheets linked with the same `title` are part of the same choice. Style sheets linked without a `title` attribute are always applied.
When style sheets are referenced with a `title` attribute on the {{HTMLElement("link", "&lt;link rel=\"stylesheet\"&gt;")}} or {{HTMLElement("style")}} element, the title becomes one of the choices offered to the user. Style sheets linked with the same [`title`](/en-US/docs/Web/HTML/Global_attributes/title) are part of the same choice. Style sheets linked without a `title` attribute are always applied.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, Firefox-specific, in terms of how this is offered to the user?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extensions exists, so edited to reflect that.

Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs size/m [PR only] 51-500 LoC changed and removed size/s [PR only] 6-50 LoC changed labels Feb 14, 2025
@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Feb 14, 2025
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs Content:HTML Hypertext Markup Language docs Content:SVG SVG docs Content:WebAPI Web API docs merge conflicts 🚧 [PR only] size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants