Skip to content

docs(multiple): fix links to theming guide sections that no longer exist - #34199

Open
andretorresdg wants to merge 1 commit into
angular:mainfrom
andretorresdg:theming-guide-anchors
Open

andretorresdg wants to merge 1 commit into
angular:mainfrom
andretorresdg:theming-guide-anchors

Conversation

@andretorresdg

Copy link
Copy Markdown
Contributor

Two docs pages link to sections of the theming guide that were removed when the guide was rewritten
for the mat.theme API in v19:

  • src/material/form-field/form-field.md ("Theming") links to
    /guide/theming#using-component-color-variants
  • guides/material-2.md ("How to migrate...") links to
    https://material.angular.dev/guide/theming#theme-your-own-components-using-a-material-3-theme

Neither anchor exists in the current guides/theming.md, so both links land at the top of the
theming guide, which no longer covers these topics. Both topics, the $color-variant parameter of
the component theme mixins and reading values from a theme built with mat.define-theme, are still
documented in the v18 theming guide. The current theming guide already points readers there for
define-theme based themes (guides/theming.md, lines 10-14).

This points both links at the matching sections on v18.material.angular.dev. Docs-only change.

How I tested

  • Rendered the heading IDs of guides/theming.md on main with the same slug function the docs
    renderer uses (slugify(text, {lower: true, strict: true})). Neither anchor exists.
  • Rendered the heading IDs of guides/theming.md on the 18.2.x branch with the slugger the 18.x
    renderer used (marked@2 Slugger). Both anchors exist (## Using component color variants,
    ## Theme your own components using a Material 3 theme).
  • Rendered both changed files with the repo's tools/markdown-to-html renderer (locked
    marked/slugify versions): no errors, and the rendered hrefs are the new URLs. I did not run the
    Bazel docs build.
The form field overview links to `/guide/theming#using-component-color-variants`
and the Material 2 theming guide links to
`/guide/theming#theme-your-own-components-using-a-material-3-theme`. Both sections were
removed from the theming guide when it was rewritten for the `mat.theme` API in v19, so
the links land at the top of an unrelated page.

The content they describe (the `$color-variant` parameter and reading values from a theme
created with `mat.define-theme`) still lives in the v18 theming guide, which the current
theming guide already points to for `define-theme` based themes. Point both links there.
@angular-robot angular-robot Bot added the area: docs Related to the documentation label Nov 29, 2026
@pullapprove
pullapprove Bot requested review from andrewseguin and ok7sai November 29, 2026 23:20
Comment thread guides/material-2.md
for M2 vs M3. You can check the theme version using the `get-theme-version` function from
`@angular/material`. The function will return `0` for an M2 theme or `1` for an M3 theme (see
[theme your own components using a Material 3 theme](https://material.angular.dev/guide/theming#theme-your-own-components-using-a-material-3-theme)
[theme your own components using a Material 3 theme](https://v18.material.angular.dev/guide/theming#theme-your-own-components-using-a-material-3-theme)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We shouldn't be linking to old versions of the docs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Related to the documentation

2 participants