From 92beffbf848a09c4bab05101f42f0ae7872a196d Mon Sep 17 00:00:00 2001 From: Julian Nymark Date: Thu, 23 Jan 2025 12:22:06 +0100 Subject: [PATCH] accordion: remove border-bottom on content, add on item --- .../core/css/darkside/accordion.darkside.css | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/@navikt/core/css/darkside/accordion.darkside.css b/@navikt/core/css/darkside/accordion.darkside.css index 2b668cacee..30b1b8271e 100644 --- a/@navikt/core/css/darkside/accordion.darkside.css +++ b/@navikt/core/css/darkside/accordion.darkside.css @@ -73,10 +73,6 @@ background-color: var(--ax-border-subtleA); } -.navds-accordion__item:last-child > .navds-accordion__content { - border-bottom: 1px solid transparent; -} - .navds-accordion__header::after { top: initial; bottom: 0; @@ -146,16 +142,23 @@ } } - &[data-expanded="true"] > .navds-accordion__content { - grid-template-rows: 1fr; - visibility: visible; - margin-block: var(--ax-space-8); - margin-block-end: var(--ax-space-24); - border-color: var(--ax-border-subtleA); - opacity: 1; + &[data-expanded="true"] { + & > .navds-accordion__content { + grid-template-rows: 1fr; + visibility: visible; + margin-block: var(--ax-space-8); + margin-block-end: var(--ax-space-24); + border-color: var(--ax-border-subtleA); + opacity: 1; + + & .navds-accordion__content-inner { + min-height: fit-content; + } + } - & .navds-accordion__content-inner { - min-height: fit-content; + &:last-child { + margin-block-end: var(--ax-space-24); + border-bottom: 1px solid var(--ax-border-subtleA); } } }