You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would support a more compact, visually focussed styleguide if the code blocks could be displayed collapsed by default and be dynamically expanded if the user wishes to review them.
Is there any current way to do this? Would it be of interest to others?
The text was updated successfully, but these errors were encountered:
And then some code I inserted after it that creates the styling and functionality for the toggleable code block. I've commented the snippet so it's clear what it does.
<!-- Import jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
// Prepend a clickable area and hide code by default
$(".lsg-code-block").prepend('<div class="toggle-code">Toggle Code</div>');
$(".lsg-code").hide();
// Make all code blocks toggle the inner code on click
$(".lsg-code-block").click(function() {
$(this).children(".lsg-code").slideToggle();
});
</script>
@scss {
.lsg-code-block {
padding: 0px;
> * { padding: 10px; }
.toggle-code { background: #c1c1c1; }
}
}
Not sure if the issue creator still needs this solved, but hopefully this helps out anyone else looking for something like this.
It would support a more compact, visually focussed styleguide if the code blocks could be displayed collapsed by default and be dynamically expanded if the user wishes to review them.
Is there any current way to do this? Would it be of interest to others?
The text was updated successfully, but these errors were encountered: