Skip to content

docs-bug(COMPONENT): Missing Source Traceability for CSS Variable Overrides in DevTools #30920

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

Closed
151forShizzle opened this issue Apr 22, 2025 · 1 comment
Labels
docs This issue is related to documentation needs triage This issue needs to be triaged by the team

Comments

@151forShizzle
Copy link

Documentation Feedback

Problem
When customizing component styles in Angular Material v19 using the new theming API (@use '@angular/material/theming' and mixins like mat.button-overrides()), all CSS variables get injected into a generated utility file, typically shown in DevTools as: utils.css:xxx

This makes it impossible to trace where a style override came from when inspecting an element. Even if a developer defines a style override like this:

// src/theme/components/_button-theme.scss
@include mat.button-overrides((
filled-label-text-weight: 600;
));

The resulting CSS variable is injected into the final CSS bundle without any mapping to the original source file.

Is there any documentation about this or information how to trace back scss files and line numbers?

Affected documentation page

https://material.angular.io/components/button/api

@151forShizzle 151forShizzle added docs This issue is related to documentation needs triage This issue needs to be triaged by the team labels Apr 22, 2025
@crisbeto
Copy link
Member

We don't have much control over this. Source maps should help, but they'll only point you to the call site of the mixin, not the specific variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is related to documentation needs triage This issue needs to be triaged by the team
Projects
None yet
Development

No branches or pull requests

2 participants