LukaszWatroba / v-accordion

Multi-level accordion component for AngularJS.
http://lukaszwatroba.github.io/v-accordion
MIT License
310 stars 100 forks source link

How to hide the + / - icons? #31

Closed felixfbecker closed 8 years ago

felixfbecker commented 8 years ago

I need custom buttons (for editing / deleting) in the place of the + / - icons. I did not find a way to hide them, neither in the CSS nor as an attribute option.

kylealwyn commented 8 years ago

@felixfbecker: The +/- buttons are the pseudo-elements of v-pane-header

Below is how I overwrote them using a font library, customize as you desire:

v-pane-header::before {
  content: none;
}

v-pane-header::after {
  content: '\f104';
  font-family: 'Ionicons';
  display: block;
  position: absolute;
  top: calc(50% - 16px);
  left: 1rem;
  font-size: 22px;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
  transition: all $v-pane-hover-duration;
}
felixfbecker commented 8 years ago

I suspected that these were added with pseudo elements, but what confuses me is that https://github.com/LukaszWatroba/v-accordion/blob/master/src/vAccordion/styles/_theme.scss#L50 the content is set to empty. I expected them to be set to + / - or something like that.

kylealwyn commented 8 years ago

You'll come to know that's the "hack" you have to do in order for your pseudo elements to show up. You'll see a few lines down that he sets the height and width to 10px and 1px respectively, then rotates one of the elements 90deg to form the plus.

On Thursday, November 19, 2015, Felix Becker notifications@github.com wrote:

I suspected that these were added with pseudo elements, but what confuses me is that https://github.com/LukaszWatroba/v-accordion/blob/master/src/vAccordion/styles/_theme.scss#L50 the content is set to empty. I expected them to be set to + / - or something like that.

— Reply to this email directly or view it on GitHub https://github.com/LukaszWatroba/v-accordion/issues/31#issuecomment-158036211 .

This message may contain information which is legally privileged and confidential. If you are not the intended recipient any unauthorized disclosure, copying, retention or use of this information is strictly prohibited.

felixfbecker commented 8 years ago

That is one hell of a clever hack.