ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.02k stars 13.51k forks source link

feat: CSS Variable for setting icon color on ion-back-button #20785

Closed torgnywalin closed 2 years ago

torgnywalin commented 4 years ago

Feature Request

Ionic version:

[x] 4.x / 5.x

Describe the Feature Request

A CSS variable for setting the color of the icon in ion-back-button element. Suggestion: --icon-color

Describe Preferred Solution

New CSS variable for setting icon color: --icon-color

Describe Alternatives

Related Code

Additional Context

liamdebeasi commented 4 years ago

Thanks for the issue. You can control the color of the icon with the --color CSS Variable. Does this work for your use case?

torgnywalin commented 4 years ago

That changes both the text and icon, I want to be able to have separate color on icon and text. I would suggest to use --color variable if --icon-color is not available.

jernesto91 commented 3 years ago

can be done using ::part

ion-back-button::part(icon) { 
    color: #ea0000!important;
}
liamdebeasi commented 2 years ago

Thanks for the issue. We added the icon Shadow Part to ion-back-button which allows you to customize the color of the button:

ion-back-button::part(icon) {
  color: red;
}

See https://ionicframework.com/docs/api/back-button#css-shadow-parts for more information.

ionitron-bot[bot] commented 2 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.