Compare commits
3 commits
main
...
horizontal
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e19bad03ab | ||
|
|
8485c0f144 | ||
|
|
b1aa75e07a |
4 changed files with 35 additions and 1 deletions
|
|
@ -7,13 +7,27 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.collapse {
|
.collapse {
|
||||||
|
visibility: hidden;
|
||||||
|
|
||||||
|
&.show {
|
||||||
|
// display: block;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
&:not(.show) {
|
&:not(.show) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.collapsing {
|
.collapsing {
|
||||||
|
position: relative;
|
||||||
height: 0;
|
height: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@include transition($transition-collapse);
|
@include transition($transition-collapse);
|
||||||
|
|
||||||
|
&.collapse-horizontal {
|
||||||
|
width: 0;
|
||||||
|
height: auto !important; // stylelint-disable-line declaration-no-important
|
||||||
|
@include transition($transition-horizontal-collapse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -378,7 +378,8 @@ $caret-spacing: $caret-width * .85 !default;
|
||||||
|
|
||||||
$transition-base: all .2s ease-in-out !default;
|
$transition-base: all .2s ease-in-out !default;
|
||||||
$transition-fade: opacity .15s linear !default;
|
$transition-fade: opacity .15s linear !default;
|
||||||
$transition-collapse: height .35s ease !default;
|
$transition-collapse: height .35s ease, visibility .35s ease !default;
|
||||||
|
$transition-horizontal-collapse: width .35s ease, visibility .35s ease !default;
|
||||||
|
|
||||||
// stylelint-disable function-disallowed-list
|
// stylelint-disable function-disallowed-list
|
||||||
// scss-docs-start aspect-ratios
|
// scss-docs-start aspect-ratios
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
margin-top: .125rem;
|
margin-top: .125rem;
|
||||||
color: rgba($black, .65);
|
color: rgba($black, .65);
|
||||||
text-decoration: if($link-decoration == none, null, none);
|
text-decoration: if($link-decoration == none, null, none);
|
||||||
|
visibility: visible;
|
||||||
|
|
||||||
&:hover,
|
&:hover,
|
||||||
&:focus {
|
&:focus {
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,24 @@ You can use a link with the `href` attribute, or a button with the `data-target`
|
||||||
</div>
|
</div>
|
||||||
{{< /example >}}
|
{{< /example >}}
|
||||||
|
|
||||||
|
## Horizontal
|
||||||
|
|
||||||
|
{{< example >}}
|
||||||
|
<p>
|
||||||
|
<a class="btn btn-primary" data-toggle="collapse" href="#collapseHorizontalExample" role="button" aria-expanded="true" aria-controls="collapseHorizontalExample">
|
||||||
|
Link with href
|
||||||
|
</a>
|
||||||
|
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseHorizontalExample" aria-expanded="true" aria-controls="collapseHorizontalExample">
|
||||||
|
Button with data-target
|
||||||
|
</button>
|
||||||
|
</p>
|
||||||
|
<div class="collapse show collapse-horizontal" id="collapseHorizontalExample">
|
||||||
|
<div style="width: 400px;">
|
||||||
|
<p>Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{< /example >}}
|
||||||
|
|
||||||
## Multiple targets
|
## Multiple targets
|
||||||
|
|
||||||
A `<button>` or `<a>` can show and hide multiple elements by referencing them with a selector in its `href` or `data-target` attribute.
|
A `<button>` or `<a>` can show and hide multiple elements by referencing them with a selector in its `href` or `data-target` attribute.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue