Skip to content

Commit

Permalink
Accordion documentation for single item expander
Browse files Browse the repository at this point in the history
  • Loading branch information
ygoe committed Jan 5, 2023
1 parent 78815cf commit 3740c4a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions doc/frontfire-ui-accordion.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,24 @@ <h2 id="no-background">No background</h2>
</div>
</div>

<h2 id="single-item">Single item expander</h2>
<p>
The accordion can also be used as a simple expander for a single item.
It might contain details or additional settings that might not be of interest all the time.
</p>
<div class="example p no-frontfire" data-source-highlight="no-background">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vestibulum, sem a pellentesque lacinia, dui lacus mollis arcu, vitae tristique ante elit at neque. Suspendisse potenti.</p>
<div class="accordion no-background">
<div>
<div>Additional information</div>
<div style="opacity: 0.6;">
Sed nec consequat odio. Aliquam erat volutpat. Morbi sed interdum metus. Nam feugiat dolor nisl, gravida varius tortor laoreet eget. Cras aliquet mattis metus, eget vestibulum mi sollicitudin eu. Morbi aliquam luctus orci. In eget justo vehicula, sodales felis non, vestibulum orci. Nunc a interdum lectus.
</div>
</div>
</div>
<p>Vestibulum dolor est, dignissim sed enim porttitor, interdum sagittis sem. Morbi sit amet ornare libero. Mauris scelerisque nulla vitae placerat efficitur. Donec cursus blandit tellus, et elementum tellus tincidunt sed. Donec congue urna a nunc cursus commodo.</p>
</div>

<h2 id="indent">Indent content</h2>
<p>
The <code class="css-class">indent</code> CSS class can be added to an item to indent the content of the section to the same horizontal position as the header.
Expand Down
2 changes: 1 addition & 1 deletion src/js/frontfire-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,7 @@
// keep: (Boolean) Indicates whether the final state should be persisted (true) or reverted
// (false). Defaults to true if unset.
//
// TODO: Keeping the final state keeps the animation alive, using memory and blocking further style updates. Find another solution. See MDN for Element.animate(). Note that offCanvas needs the animation to later reverse() it.
// TODO: Keeping the final state keeps the animation alive, using memory and blocking further style updates. Find another solution. See MDN for Element.animate(). Note that offCanvas needs the animation to later reverse() it. - https://developer.mozilla.org/en-US/docs/Web/API/Animation#automatically_removing_filling_animations
Frontfire_prototype.animateFromTo = function (data, duration, easing, keep) {
let keyframes = [{}, {}];
for (let key in data) {
Expand Down

0 comments on commit 3740c4a

Please sign in to comment.