Skip to content
Snippets Groups Projects
Commit b207415f authored by Ekaterina Kondareva's avatar Ekaterina Kondareva
Browse files

Merge branch 'NXSTAGE-918-accordion-improvements' into 'development'

NXSTAGE-918: Accordion improvements

See merge request julkiset-sivut/design-system-lib!127
parents f06b0da2 51f1bd55
No related branches found
No related tags found
No related merge requests found
...@@ -104,6 +104,21 @@ ...@@ -104,6 +104,21 @@
span { span {
text-align: left; text-align: left;
} }
// When accordion item is open.
&[aria-expanded='true'] {
position: relative;
&:after {
background: linear-gradient(to right, var(--grayscale-medium), var(--grayscale-white));
bottom: 0;
content: '';
height: 2px;
left: 0;
position: absolute;
width: 100%;
}
}
} }
.hy-accordion--heading__icon { .hy-accordion--heading__icon {
...@@ -187,9 +202,15 @@ ...@@ -187,9 +202,15 @@
display: block; display: block;
} }
hy-box { > hy-box {
padding: 20px 16px 0;
@include breakpoint($narrow) { @include breakpoint($narrow) {
padding: 0 2rem; padding: 20px 24px 0;
}
@include breakpoint($extrawide) {
padding: 24px 32px 0;
} }
} }
} }
......
...@@ -29,18 +29,35 @@ ...@@ -29,18 +29,35 @@
flex-direction: row-reverse; flex-direction: row-reverse;
} }
.hy-two-columns--side { .hy-two-columns__item--side {
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
@include breakpoint($narrow) { @include breakpoint($narrow) {
margin-right: 5.79%; margin-right: 5.79%;
} }
@include breakpoint($wide) { @include breakpoint($wide) {
margin-right: 8.5%; margin-right: 8.5%;
} }
} }
} }
}
.hy-two-columns__item {
width: 100%;
[slot='main'] {
width: 100%;
.hy-paragraph-text {
width: 100% !important;
}
}
[slot='side'] {
width: 100%;
}
&--main { &--main {
display: flex; display: flex;
...@@ -50,16 +67,10 @@ ...@@ -50,16 +67,10 @@
@include breakpoint($narrow) { @include breakpoint($narrow) {
flex-basis: 67.01%; flex-basis: 67.01%;
} }
@include breakpoint($wide) { @include breakpoint($wide) {
flex-basis: 63%; flex-basis: 63%;
} }
[slot='main'] {
width: 100%;
.hy-paragraph-text {
width: 100% !important;
}
}
} }
&--side { &--side {
...@@ -75,16 +86,13 @@ ...@@ -75,16 +86,13 @@
flex-basis: 32.99%; // sidebar width is always 4.5 column of the global 12-col content area grid. flex-basis: 32.99%; // sidebar width is always 4.5 column of the global 12-col content area grid.
margin-left: 5.79%; // (half of the column+gutter) of global 12-col grid = gap between main and sidebar margin-left: 5.79%; // (half of the column+gutter) of global 12-col grid = gap between main and sidebar
} }
@include breakpoint($wide) { @include breakpoint($wide) {
flex-basis: 37%; flex-basis: 37%;
margin-left: 8.5%; // (1 column + gutter) of global 12-col grid = gap between main and sidebar margin-left: 8.5%; // (1 column + gutter) of global 12-col grid = gap between main and sidebar
padding: 0; padding: 0;
} }
[slot='side'] {
width: 100%;
}
// Key figure block inside Sidebar // Key figure block inside Sidebar
hy-key-figure { hy-key-figure {
padding: 0 10.67%; padding: 0 10.67%;
......
...@@ -14,10 +14,10 @@ export class HyTwoColumns { ...@@ -14,10 +14,10 @@ export class HyTwoColumns {
return ( return (
<Host> <Host>
<div class={classAttributes}> <div class={classAttributes}>
<div class="hy-two-columns--main"> <div class="hy-two-columns__item hy-two-columns__item--main">
<slot name="main"></slot> <slot name="main"></slot>
</div> </div>
<div class="hy-two-columns--side"> <div class="hy-two-columns__item hy-two-columns__item--side">
<slot name="side"></slot> <slot name="side"></slot>
</div> </div>
</div> </div>
......
...@@ -14,10 +14,10 @@ describe('hy-two-columns', () => { ...@@ -14,10 +14,10 @@ describe('hy-two-columns', () => {
expect(page.root).toEqualHtml(` expect(page.root).toEqualHtml(`
<hy-two-columns> <hy-two-columns>
<div class="hy-two-columns"> <div class="hy-two-columns">
<div class="hy-two-columns--main"> <div class="hy-two-columns__item hy-two-columns__item--main">
<div slot="main"></div> <div slot="main"></div>
</div> </div>
<div class="hy-two-columns--side"> <div class="hy-two-columns__item hy-two-columns__item--side">
<div slot="side"></div> <div slot="side"></div>
</div> </div>
</div> </div>
......
...@@ -65,6 +65,10 @@ ...@@ -65,6 +65,10 @@
p { p {
margin-top: 0; margin-top: 0;
padding-top: 0; padding-top: 0;
&:last-of-type {
margin-bottom: 0;
}
} }
// When hy-paragraph-text is the first child it will not add spacing to top. Will fix heading + text spacing issue. // When hy-paragraph-text is the first child it will not add spacing to top. Will fix heading + text spacing issue.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment