Skip to content

fix(label): keep label styles off igxButton - 21.2.x - #18062

Merged
kdinev merged 1 commit into
21.2.xfrom
simeonoff/fix-18009-label-button-color-21.2.x
Nov 25, 2026
Merged

kdinev merged 1 commit into
21.2.xfrom
simeonoff/fix-18009-label-button-color-21.2.x

Conversation

@simeonoff

Copy link
Copy Markdown
Member

Related to #18009

Partial backport of #18055 to 21.2.x: only the label style fix.

Description

The label styles ([igxLabel] base rule, tokens and typography) now skip .igx-button. The selector is [igxLabel]:where(:not(.igx-button)), so specificity stays at (0,1,0).

Motivation / Context

The button's igxLabel input shares its name with the [igxLabel] selector of IgxLabelDirective. A button written as igxLabel="...", as the button's JSDoc shows, matched the label CSS. The label rule has the same specificity as the button's resting color rule and comes later, so the button took the label text color. #17990 (in 21.2.27) made this visible in apps that exclude igx-label, because the label styles are now kept when an included component depends on them.

The aria-label part of #18009 doesn't apply here: on 21.2.x the button sets aria-label only when igxLabel has a value and never removes one set in the template. The igxLabel deprecation is left out of this patch line.

Type of Change (check all that apply):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

Component(s) / Area(s) Affected:

Button, Theming (label)

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

I compiled the light and dark Material, Indigo, Bootstrap and Fluent presets before and after. Before, [igxLabel] { color } came after .igx-button--contained { color }. The only changes are the [igxLabel] selectors (base, tokens, RTL and typography rules). npm run test:styles passes.

Test Configuration:

  • Angular version: 21.2
  • Browser(s): Chrome
  • OS: macOS

Checklist:

  • All relevant labels have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

Copilot AI balanced review requested due to automatic review settings November 25, 2026 14:32
@simeonoff simeonoff added 🐛 bug Any issue that describes a bug button-theme version: 21.2.x labels Nov 25, 2026
@simeonoff
simeonoff requested a review from kdinev November 25, 2026 14:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block approval of the label-style backport.

No open issues 🎉

What changed in this PR

Backports the label-style fix from #18055 to 21.2.x, addressing #18009 without changing button accessibility behavior or deprecating igxLabel.

Changes:

  • Excludes .igx-button from label base styles and theme tokens using :where(:not(...)), preserving selector specificity.
  • Documents the button styling fix in the 21.2.28 changelog.
File Description
projects/​igniteui-angular/​core/​src/​core/​styles/​components/​label/​_label-theme.scss Excludes buttons from label theme token styles.
projects/​igniteui-angular/​core/​src/​core/​styles/​components/​label/​_label-component.scss Excludes buttons from label base styles.
CHANGELOG.md Records the igxLabel button styling fix for 21.2.28.

Review effort: Balanced

@kdinev
kdinev enabled auto-merge (squash) November 25, 2026 14:34
@kdinev
kdinev disabled auto-merge November 25, 2026 15:07
@kdinev
kdinev merged commit dc2ae83 into 21.2.x Nov 25, 2026
6 checks passed
@kdinev
kdinev deleted the simeonoff/fix-18009-label-button-color-21.2.x branch November 25, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants