Skip to content

Commit

Permalink
fix(accordion): fix accordion border-radius and shadow (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
nnixaa authored Jul 27, 2018
1 parent 60bb79e commit 22ba6ef
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
border-bottom-width: nb-theme(accordion-header-border-width);
border-bottom-style: nb-theme(accordion-header-border-type);
border-bottom-color: nb-theme(accordion-header-border-color);
border-top-left-radius: nb-theme(accordion-border-radius);
border-top-right-radius: nb-theme(accordion-border-radius);
color: nb-theme(accordion-header-fg-heading);

font-family: nb-theme(accordion-header-font-family);
Expand All @@ -23,6 +21,10 @@
@mixin nb-accordion-theme() {

nb-accordion {
display: block;
box-shadow: nb-theme(accordion-item-shadow);
border-radius: nb-theme(accordion-border-radius);

nb-accordion-item-header {
position: relative;
@include nb-accordion-item-header();
Expand All @@ -39,12 +41,29 @@
font-weight: nb-theme(accordion-item-font-weight);
background: nb-theme(accordion-item-bg);
color: nb-theme(accordion-item-fg-text);
box-shadow: nb-theme(accordion-item-shadow);

&.disabled nb-accordion-item-header {
color: nb-theme(accordion-header-disabled-fg);
cursor: default;
}

&:first-child {
border-top-left-radius: nb-theme(accordion-border-radius);
border-top-right-radius: nb-theme(accordion-border-radius);
}
&:last-child {
border-bottom-left-radius: nb-theme(accordion-border-radius);
border-bottom-right-radius: nb-theme(accordion-border-radius);

&.collapsed nb-accordion-item-header {
border-bottom: none;
}
}
}
nb-accordion-item:not(.collapsed) + nb-accordion-item nb-accordion-item-header {
border-top-width: nb-theme(accordion-header-border-width);
border-top-style: nb-theme(accordion-header-border-type);
border-top-color: nb-theme(accordion-header-border-color);
}

nb-accordion-item-body .item-body {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@
:host {
display: flex;
flex-direction: column;

&.collapsed + ::ng-deep nb-accordion-item.collapsed {
border-radius: 0;
}
}
1 change: 1 addition & 0 deletions src/framework/theme/styles/themes/_default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ $theme: (
accordion-header-border-width: 1px,
accordion-header-border-type: solid,
accordion-header-border-color: accordion-separator,
accordion-border-radius: radius,
accordion-item-bg: color-bg,
accordion-item-font-size: font-size,
accordion-item-font-weight: font-weight-normal,
Expand Down

0 comments on commit 22ba6ef

Please sign in to comment.