Skip to content

MatStepper Doesn't Allow Styling #25872

@marc-wilson

Description

@marc-wilson

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I am trying to apply basic styling to the MatStepper. However, the styles seem to get completely stripped out. If I use the deprecated ::ng-deep, things work just fine. But, ::ng-deep is being (or is) deprecated. What is the proper way to do this?

Example:
Trying to hide the .mat-horizontal-stepper-header-container and change the background of .mat-horizontal-content-container to red.

.mat-horizontal-stepper-header-container {
  display: none !important;
}

.mat-horizontal-content-container {
  background: red !important;
}

But this works just fine:

::ng-deep .mat-horizontal-stepper-header-container {
  display: none !important;
}

::ng-deep .mat-horizontal-content-container {
  background: red !important;
}

Repro:
https://stackblitz.com/edit/angular-ylfbfk?file=src/app/stepper-overview-example.css

Expected result:
image

Actual result:
image

Reproduction

https://stackblitz.com/edit/angular-ylfbfk?file=src/app/stepper-overview-example.css

Expected Behavior

Basic styling should apply to components without needing to use the deprecated ::ng-deep

Actual Behavior

No styles apply to the component without specifying ::ng-deep

Environment

  • Angular: 14.2.1
  • CDK/Material: 14.2.1
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions