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

feat(cdk/private): create cdk-visually-hidden style loader #29757

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

Conversation

wagnermaciel
Copy link
Contributor

@wagnermaciel wagnermaciel commented Sep 18, 2024

This is part of a larger effort to remove the mat.core() mixin. The goal of this PR is to provide a way for components to load the styles for the .cdk-visually-hidden class without needing it to be loaded via mat.core()'s call to cdk.a11y-visually-hidden().

@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Sep 18, 2024
@wagnermaciel wagnermaciel marked this pull request as ready for review September 18, 2024 21:11
@wagnermaciel wagnermaciel requested a review from a team as a code owner September 18, 2024 21:11
src/cdk/private/visually-hidden/visually-hidden.scss Outdated Show resolved Hide resolved
@Component({
standalone: true,
styleUrl: 'visually-hidden.css',
exportAs: 'cdkVisuallyHidden',
Copy link
Member

Choose a reason for hiding this comment

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

We can drop the exportAs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to add this in because if I drop the exportAs I get a duplicate component ID error :( Is there another way to resolve this error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The full error is:

Detected identical metadata between following components:
- _MatBadgeStyleLoader and _VisuallyHiddenLoader

The metadata of one of each of these components should be changed to be slightly different in order to avoid conflicts at runtime.

Copy link
Member

Choose a reason for hiding this comment

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

I see, then it should be fine. Another way to work around it is to add a host binding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
detected: feature PR contains a feature commit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants