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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 from aa3ef13 to 84cdc16 Compare August 28, 2024 15:46
… mixin instead of define-theme and add high contrast override mixins
@amysorto amysorto force-pushed the high-contrast-define-theme-schematic branch 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility This issue is related to accessibility (a11y) 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