Restores primary text color declarations#532
Open
Helge Johnsen (hj-inmeta) wants to merge 2 commits into
Open
Conversation
This reverts a previous commit that inadvertently removed explicit primary text color assignments from various UI components and typography styles. Re-applies `var(--md-color-text-primary)` to ensure correct and consistent text coloring across these elements. Reverts commit daf3b4f.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores explicit primary text color styling across the CSS package by adding color: var(--md-color-text-primary) to typography utilities and multiple component element selectors, ensuring consistent text color when browser defaults (e.g., for buttons) don’t inherit as expected.
Changes:
- Add primary text color to shared typography utility classes (headings, labels, body).
- Add explicit primary text color to various component roots / labels / buttons (e.g., Tabs, Tooltip, Toggle, Stepper, AlertMessage).
- Add explicit primary text color to several form-element labels and interactive parts (e.g., Select, Combobox, Checkbox, Radio).
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/css/src/typography.css | Sets primary text color on typography utility classes. |
| packages/css/src/tooltip/tooltip.css | Sets tooltip text color explicitly. |
| packages/css/src/toggle/toggle.css | Sets toggle label text color explicitly. |
| packages/css/src/tabs/tabs.css | Sets tab panel and tab button text color explicitly. |
| packages/css/src/stepper/stepper.css | Sets stepper title/content text color explicitly. |
| packages/css/src/messages/alertMessage.css | Sets alert message container/label text color explicitly. |
| packages/css/src/infoTag/infoTag.css | Sets info tag label text color explicitly. |
| packages/css/src/formElements/textarea/textarea.css | Sets textarea label text color explicitly. |
| packages/css/src/formElements/select/select.css | Sets select label/button/item text color explicitly. |
| packages/css/src/formElements/radiogroup/radiogroup.css | Sets radiogroup label text color explicitly. |
| packages/css/src/formElements/radiobutton/radiobutton.css | Sets radiobutton label text color explicitly. |
| packages/css/src/formElements/multiselect/multiselect.css | Sets multiselect label/dropdown label text color explicitly. |
| packages/css/src/formElements/multiautocomplete/multiautocomplete.css | Sets multiautocomplete label text color explicitly. |
| packages/css/src/formElements/inputsearch/inputsearch.css | Sets inputsearch label text color explicitly. |
| packages/css/src/formElements/input/input.css | Sets input label text color explicitly. |
| packages/css/src/formElements/fileupload/fileupload.css | Sets fileupload droparea content text color explicitly. |
| packages/css/src/formElements/combobox/combobox.css | Sets combobox label/input text color explicitly. |
| packages/css/src/formElements/checkboxgroup/checkboxgroup.css | Sets checkboxgroup label text color explicitly. |
| packages/css/src/formElements/checkbox/checkbox.css | Sets checkbox label text color explicitly. |
| packages/css/src/filelist/filelist.css | Sets filelist text color explicitly. |
| packages/css/src/descriptionList/descriptionList.css | Sets description list text color explicitly. |
| packages/css/src/accordionitem/accordionitem.css | Sets accordion header label/close button text color explicitly. |
Comments suppressed due to low confidence (2)
packages/css/src/accordionitem/accordionitem.css:113
md-accordion-item--disabledsetscoloron the header/content, but these new explicitcolor: var(--md-color-text-primary)declarations prevent.md-accordion-item__header-labelfrom inheriting the disabled text color, so disabled accordions will still show primary-colored label text.
}
.md-accordion-item:not(.md-accordion-item--disabled) .md-accordion-item__header:hover .md-accordion-item__header-label {
text-decoration: underline;
}
packages/css/src/accordionitem/accordionitem.css:138
- This new explicit
color: var(--md-color-text-primary)on.md-accordion-item__close-buttonoverrides the disabled styling (.md-accordion-item--disabled .md-accordion-item__content { color: var(--md-color-text-disabled); }), so the close button text will remain primary-colored even when the accordion is disabled.
background: none;
border: 0;
margin: 2rem 0 0 -0.2rem;
cursor: pointer;
font-size: var(--md-typography-size-16);
color: var(--md-color-text-primary);
}
.md-accordion-item__close-button:hover {
text-decoration: underline;
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Added specific text color to elements.
Checklist before requesting a review
major,minororpatch)stories-folder?packages/react/index.tsx?packages/css/index.css?