Why do you have <style>
tag within your home template file? Angular (what Ionic has underneath) template compiler doesn't allow it and will remove any <style>
tag you add.
If you have a global .css or .scss file (e.g. index.scss) than you can simply put your .searchbar-input
style there, and it should work.
Another way I can think of is, adding encapsulation: ViewEncapsulation.None
to your HomePage
component, which would be not ideal or could break some things, but still should work.
Check the demo: https://stackblitz.com/edit/ionic-ionsearchbar-styling-vda1eu
What I mean is this:
home.ts
@Component({
selector: 'page-home',
templateUrl: 'home.html',
styleUrls: ['./home.scss'], // added
encapsulation: ViewEncapsulation.None // added
})
export class HomePage { /*... */ }
home.scss
.searchbar-input {
font-size: 10px !important;
}