Ngx-bootstrap: Accordion Styling

Created on 31 Jul 2017  路  4Comments  路  Source: valor-software/ngx-bootstrap

Hi!
I want to style the accordion component as explained here, but it does not work at all.

Any help on this?
Thanks (Sorry for my bad english)

comp(accordion) question

Most helpful comment

to deal with angular's view encapsulation, you have to write your styles with :host >>> if you're using an external stylesheet for a component.

:host >>> .card.customClass,.card.customClass .card-header,.panel.customClass {
background-color: #5bc0de;
color: #fff;}
:host >>> .panel.customClass .panel-body {
background-color: #337aa7;
}

Or you can add your styles to global stylesheet or add encapsulation: ViewEncapsulation.None to your component definition.
We'll probably update the demo to make this moment clear

All 4 comments

Hi. What exactly doesn't work? I think the demo is quite straightforward:

  1. Add your css class to accordion-group
  2. Write css rules for this class like this
.panel.customClass {
  background-color: #5bc0de;
  color: #fff;
}

If this doesn't help you, create a simple repo or plunkr so we'll be able to help you

I did but the CSS doesn't apply. this is my component.html code:
here

my component.ts:
here

and my css :
here

to deal with angular's view encapsulation, you have to write your styles with :host >>> if you're using an external stylesheet for a component.

:host >>> .card.customClass,.card.customClass .card-header,.panel.customClass {
background-color: #5bc0de;
color: #fff;}
:host >>> .panel.customClass .panel-body {
background-color: #337aa7;
}

Or you can add your styles to global stylesheet or add encapsulation: ViewEncapsulation.None to your component definition.
We'll probably update the demo to make this moment clear

Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ctrl-brk picture ctrl-brk  路  3Comments

webdev48 picture webdev48  路  3Comments

PascalHonegger picture PascalHonegger  路  3Comments

ghiscoding picture ghiscoding  路  3Comments

pgeyman picture pgeyman  路  3Comments