Skip to content

Instantly share code, notes, and snippets.

@akalata
Created August 24, 2021 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akalata/beb36414c0aeaa1f21b673221628fc09 to your computer and use it in GitHub Desktop.
Save akalata/beb36414c0aeaa1f21b673221628fc09 to your computer and use it in GitHub Desktop.
SML Layout containers
Current state: Full bleed by default, anything in the main content area needs to set a class to fix-width and center its content.
<div>
<main>
<div class="bg-color-bleeds">
<div class="container mx-auto">Content is fixed width and centered</div>
</div>
</main>
<div>
Pages with a sidebar (right now, only search results) include a container to wrap the sidebar and main content areas
<div class="container mx-auto">
<main class="order-2">
<div>Main content</div>
</main>
<aside class="order-first">
<div>Sidebar content</div>
</aside>
</div>
Proposal: Always include the container classes, except where we know the page components will be full-bleed and have their own containers applied.
{% if page_full_bleed != true %}
<div class="container mx-auto">
{% else %}
<div>
{% endif %}
<main>
<div>Main content, centered without us needing to specify anything</div>
</main>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment