Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change ion-input underline color in Ionic 4

How can we change the default underline color of a ion-text in only a single page in Ionic 4?

like image 783
akshay ramesh Avatar asked Nov 08 '18 19:11

akshay ramesh


2 Answers

Ionic 4.x uses CSS Custom Properties for most of the time.

src/app/pages/test/test.page.scss

:host {
    ion-item {
        --border-color: white; // default underline color
        --highlight-color-invalid: red; // invalid underline color
        --highlight-color-valid: green; // valid underline color
    }
}

If necessary, please check the other custom properties here.

like image 75
Milan Chandro Avatar answered Sep 18 '22 22:09

Milan Chandro


Try this css

.item-has-focus{
   --highlight-background: #e2e2e2;
}
like image 38
Shurvir Mori Avatar answered Sep 19 '22 22:09

Shurvir Mori