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(material/schematics): Switch custom theme schematic to use theme mixin instead of define-theme and add high contrast override mixins #29642

Merged

Conversation

amysorto
Copy link
Contributor

No description provided.

@amysorto amysorto added Accessibility This issue is related to accessibility (a11y) target: major This PR is targeted for the next major release area: ng-generate Schematics that generate code in user projects labels Aug 26, 2024
@amysorto amysorto requested a review from a team as a code owner August 26, 2024 15:42
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Aug 26, 2024
@amysorto amysorto force-pushed the high-contrast-define-theme-schematic branch from 2d7fe98 to 0514fcc Compare August 27, 2024 16:10
src/material/schematics/ng-generate/m3-theme/README.md Outdated Show resolved Hide resolved
src/material/schematics/ng-generate/m3-theme/README.md Outdated Show resolved Hide resolved
src/material/schematics/ng-generate/m3-theme/README.md Outdated Show resolved Hide resolved
): DynamicScheme {
return new DynamicScheme({
sourceColorArgb: primaryPalette.keyColor.toInt(),
variant: 6, // Variant enum is not accessible outside of @material/material-color-utilities
Copy link
Contributor

Choose a reason for hiding this comment

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

What is "6"? Should include this in comments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the comment, variant is supposed to take a Variant enum but it isn't exposed outside the package

src/material/schematics/ng-generate/m3-theme/index.ts Outdated Show resolved Hide resolved
@amysorto amysorto force-pushed the high-contrast-define-theme-schematic branch from 0514fcc to aa3ef13 Compare August 27, 2024 21:10
Copy link
Contributor

@andrewseguin andrewseguin left a comment

Choose a reason for hiding this comment

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

I think we can remove the m3 prefix from this schematic. Also I wonder if another name makes more sense now that it isn't creating a config. Maybe theme-color or just color

Let's also wait on merging this pull request until the theme mixin is renamed

src/material/schematics/ng-generate/m3-theme/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

The first sentence of the README says it makes theme configurations - let's reword that to say it makes theme colors

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 renamed it to palettes since that's what users are importing from the generated file

@amysorto amysorto force-pushed the high-contrast-define-theme-schematic branch 2 times, most recently from 84cdc16 to a3cbcfc Compare August 28, 2024 16:09
@amysorto amysorto requested a review from a team as a code owner August 28, 2024 16:09
@amysorto
Copy link
Contributor Author

I renamed the schematic to theme-color instead of m3-theme. Although the generated file is still m3-theme.scss which doesn't feel right. @andrewseguin What do you think about renaming the generated file to something like custom-theme-colors.scss instead?

@josephperrott josephperrott removed the request for review from a team August 29, 2024 15:50
@amysorto amysorto force-pushed the high-contrast-define-theme-schematic branch 2 times, most recently from 1067ecd to 0ff4ba3 Compare October 10, 2024 19:13
// Apply the light theme by default
@include mat.core-theme(m3-theme.$light-theme);
@include mat.button-theme(m3-theme.$light-theme);
@include mat.private-experimental-theme(
Copy link
Contributor

Choose a reason for hiding this comment

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

update to theme

@andrewseguin
Copy link
Contributor

Yeah we should rename the file. Maybe just _theme-colors.scss?

… mixin instead of define-theme and add high contrast override mixins
@amysorto amysorto force-pushed the high-contrast-define-theme-schematic branch from 0ff4ba3 to 7d62958 Compare October 10, 2024 19:57
@amysorto amysorto removed the request for review from crisbeto October 11, 2024 14:13
@amysorto amysorto added the action: merge The PR is ready for merge by the caretaker label Oct 11, 2024
@amysorto amysorto merged commit 9c3af28 into angular:main Oct 11, 2024
21 of 24 checks passed
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Accessibility This issue is related to accessibility (a11y) action: merge The PR is ready for merge by the caretaker area: ng-generate Schematics that generate code in user projects detected: feature PR contains a feature commit target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants