Uikit: Can I replace the icons in the accordion?

Created on 18 Jan 2018  路  3Comments  路  Source: uikit/uikit

Hi, The default accordion use + and - for open and close the accordion. Can I replace that with something else like arrow up and down?

image

https://getuikit.com/docs/accordion

Thanks,

Most helpful comment

@aarongerig Thanks for giving me the ideas. I am afraid that it could be lost when I update UiKit to next version. So did a better version by using CSS. It also works.

.uk-accordion-title:after{
      background-image: url('../../bower_components/uikit/src/images/icons/chevron-down.svg');
}
.uk-open{
      .uk-accordion-title:after{
              background-image: url('../../bower_components/uikit/src/images/icons/chevron-up.svg');
      }
}

All 3 comments

@aarongerig Thanks for giving me the ideas. I am afraid that it could be lost when I update UiKit to next version. So did a better version by using CSS. It also works.

.uk-accordion-title:after{
      background-image: url('../../bower_components/uikit/src/images/icons/chevron-down.svg');
}
.uk-open{
      .uk-accordion-title:after{
              background-image: url('../../bower_components/uikit/src/images/icons/chevron-up.svg');
      }
}

hi you can use something like this .. hope its will be help full to someone

.uk-accordion li.uk-open .uk-accordion-title:before {
content: url('data:image/svg+xml; utf8, ');
}

.uk-accordion li .uk-accordion-title:before{
content: url('data:image/svg+xml; utf8, ');
}

content: url("data:image/svg+xml; utf8, svg code here ");

and for the svg
https://css.gg/app

you can find signal svg code

Was this page helpful?
0 / 5 - 0 ratings

Related issues

papazetis picture papazetis  路  3Comments

kirlat picture kirlat  路  3Comments

wozzup picture wozzup  路  4Comments

albeaver picture albeaver  路  3Comments

DamirPecnik picture DamirPecnik  路  3Comments