I want to add css in ion-searchbar’s input
This is ionic code.
html view
how can I add ?
ion-searchbar {
input {
// your stylings
}
}
Don’t working in ionic 5
@Syalcindag i’m using v5 here the code from my app & –ion-color-headerbg is just a custom color
ion-searchbar{
background: var(--ion-color-headerbg);
color: white;
border: none;
}
ı want to add padding css for input in ion-searchbar
before
after
this is not working
Is this Image of the html from ionic 5? I think in v5 it uses shadow dom as well
this image is browser view in ionic 5 project.
This is how I done it in ionic 5.
To remove the input pudding you have to place the custom css in global.scss, don’t use ion-searchbar or it will effect all the searchbars in the project.
Global.scss
input-searchbar {
input {
padding-inline-start: 10px !important;
padding-inline-end: 10px !important;
}
}
To remove search icon use search-icon as none:
<ion-searchbar search-icon="none" class="input-searchbar"></ion-searchbar>