Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic 2: Remove background from custom component button in navbar

Q) How do I fix the styling on the custom component below so it looks like the plus sign, with inherited styling from the <ion-buttons> directive?

I'm using a custom component in my navbar: <notifications-bell></notifications-bell>, like so:

<ion-navbar *navbar header-colour>
  <button menuToggle>
    <ion-icon name="menu"></ion-icon>
  </button>  
  <ion-buttons end>
    <notifications-bell></notifications-bell>
    <button>
      <ion-icon name="add"></ion-icon>
    </button>
  </ion-buttons>  
  <ion-title>Clients</ion-title>
</ion-navbar>

But it's rendering with a background colour:

enter image description here

Here's my component:

import {Component} from 'angular2/core';

@Component({
    selector: 'notifications-bell',
    directives: [],
    template: `<button><ion-icon name="notifications-outline"></ion-icon></button>`
})
export class NotificationsBellComponent {
    constructor() {
    }
}

Thanks.

like image 417
Dave Avatar asked May 08 '26 16:05

Dave


1 Answers

I'd assume it's as simple as removing background and shadow?

button{
  background: none !important;
  background-color: none !important;
  box-shadow: none !important;
}
like image 74
Greg Avatar answered May 11 '26 06:05

Greg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!