Skip to content

build: prevent markdown styling from bleeding into examples #31358

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

Merged
merged 1 commit into from
Jun 14, 2025

Conversation

crisbeto
Copy link
Member

Currently we style the content in the docs by setting a docs-markdown class around it which then targets element tags that can be produced by the markdown renderer like p and h1. The problem with this is that some components use these elements for their own styling, e.g. the main mat-card example looks off because its p tag styling is overridden by docs-markdown.

These changes update the docs generation script to exclude the component styles from the markdown styles.

Example of the card docs now:
image

After the changes:
image

@crisbeto crisbeto requested a review from a team as a code owner June 14, 2025 08:53
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Jun 14, 2025
@angular-robot angular-robot bot added the area: build & ci Related the build and CI infrastructure of the project label Jun 14, 2025
Currently we style the content in the docs by setting a `docs-markdown` class around it which then targets element tags that can be produced by the markdown renderer like `p` and `h1`. The problem with this is that some components use these elements for their own styling, e.g. the main `mat-card` example looks off because its `p` tag styling is overridden by `docs-markdown`.

These changes update the docs generation script to exclude the component styles from the markdown styles.
@crisbeto crisbeto force-pushed the docs-paragraph-style branch from 9d2f82b to e54429a Compare June 14, 2025 08:55
@crisbeto crisbeto requested a review from andrewseguin June 14, 2025 08:55
@crisbeto crisbeto removed the request for review from a team June 14, 2025 11:53
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Jun 14, 2025
@crisbeto crisbeto merged commit c771a01 into angular:main Jun 14, 2025
24 of 25 checks passed
@crisbeto
Copy link
Member Author

The changes were merged into the following branches: main, 20.0.x

crisbeto added a commit that referenced this pull request Jun 14, 2025
Currently we style the content in the docs by setting a `docs-markdown` class around it which then targets element tags that can be produced by the markdown renderer like `p` and `h1`. The problem with this is that some components use these elements for their own styling, e.g. the main `mat-card` example looks off because its `p` tag styling is overridden by `docs-markdown`.

These changes update the docs generation script to exclude the component styles from the markdown styles.

(cherry picked from commit c771a01)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: build & ci Related the build and CI infrastructure of the project target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants