Page 2 of 2

Re: ionic4 css button text color setting

Posted: Wed Mar 01, 2023 8:57 am
by gosen11

DLS MOD 23To set the text color of an Ionic 4 button, you can use the color attribute to specify a pre-defined color or use custom CSS to define your own text color.

Here's an example of setting the text color of an Ionic 4 button using a pre-defined color:

Code: Select all

<ion-button color="primary">Click me</ion-button>

In this example, the text color of the button will be set to the primary color, which is usually a shade of blue.

If you want to use a custom text color, you can define it using CSS:

Code: Select all

<ion-button style="--color-text: #ff0000;">Click me</ion-button>

In this example, the --color-text CSS variable is used to define the text color of the button as red (#ff0000). You can replace the color value with any color you prefer.