Skip to content

Commit

Permalink
feat(Accordion): change sbanken expand icon to chevron (#2854)
Browse files Browse the repository at this point in the history
  • Loading branch information
snorrekim authored Nov 9, 2023
1 parent a20a764 commit a7cb8b9
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 21 deletions.
12 changes: 0 additions & 12 deletions packages/dnb-eufemia/src/components/accordion/AccordionHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
validateDOMAttributes,
extendPropsWithContext,
} from '../../shared/component-helper'
import { useTheme } from '../../shared'
import IconPrimary from '../icon-primary/IconPrimary'
import classnames from 'classnames'
import AccordionContext from './AccordionContext'
Expand Down Expand Up @@ -106,21 +105,10 @@ function AccordionHeaderIcon({
size = 'medium',
icon_position,
}: AccordionHeaderIconProps) {
const theme = useTheme()
let animateIcon = true
if (!icon && theme?.name === 'sbanken') {
animateIcon = false
icon = {
expanded: 'subtract-medium',
closed: 'add-medium',
}
}

return (
<span
className={classnames(
'dnb-accordion__header__icon',
!animateIcon && 'dnb-accordion__header__icon--no-animation',
icon_position && `dnb-accordion__header__icon--${icon_position}`
)}
>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ p > .dnb-icon {
.dnb-accordion__header__description + .dnb-accordion__header__title {
margin-top: 0.25rem;
}
.dnb-accordion--expanded > .dnb-accordion__header .dnb-accordion__header__icon:not(.dnb-accordion__header__icon--no-animation) {
.dnb-accordion--expanded > .dnb-accordion__header .dnb-accordion__header__icon {
transform: rotate(-180deg);
}
.dnb-accordion__content {
Expand Down Expand Up @@ -231,7 +231,7 @@ p > .dnb-icon {
}
}
@media screen and (min-width: 40em) {
.dnb-accordion-group--single-container .dnb-accordion > .dnb-accordion__header .dnb-accordion__header__icon:not(.dnb-accordion__header__icon--no-animation) {
.dnb-accordion-group--single-container .dnb-accordion > .dnb-accordion__header .dnb-accordion__header__icon {
transform: rotate(-90deg);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@
}
}

&--expanded
> &__header
&__header__icon:not(#{&}__header__icon--no-animation) {
&--expanded > &__header &__header__icon {
transform: rotate(-180deg);
}

Expand Down Expand Up @@ -188,10 +186,7 @@
// }
// }
}
&-group--single-container
&
> &__header
&__header__icon:not(#{&}__header__icon--no-animation) {
&-group--single-container & > &__header &__header__icon {
@include allAbove(small) {
transform: rotate(-90deg);
}
Expand Down

0 comments on commit a7cb8b9

Please sign in to comment.