generated from Bixal/uswds-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Layouts
Philip Levy edited this page Jan 24, 2022
·
2 revisions
- This is the master layout that all other layouts feed into. It contains the main HTML "shell" that is used for all pages.
- There is no styling included in this layout, but you can add design tokens and utility classes to the
bodyelement by including thebody-styleelement on your content page. It would look something like this:
---
layout: default
body-style: bg-base-light
---
- This layout places the page content in a container using the
grid-containerclass before including it in the Default template. - It provides a simple, centered column with a maximum width and some built-in padding.
- This is a good option for most single-column content.
- If you need a single, centered column with more control use this template.
- You can add design tokens and utility classes to the content container using the
layout-stylesetting on your content page. - The width of the column is based on the content. Consider adding a width utility class that sets a maximum width at larger screen sizes, like this:
---
layout: centered-column
layout-style: tablet:width-tablet
---
In this example, the content will adapt to the screen size at smaller sizes, but at the tablet width, it will have a maximum width based on the tablet width breakpoint defined in the Design System.
- This is a two-column layout to add content or components to the side of the main content.
- The sidebar will automatically resize to fit the content.
- The main content area will fill the rest of the available space.
- The
sidebarsetting looks for Markdown files in theincludes/contentfolder.
To use this, set the layout to sidebar and use the sidebar setting to determine which content you want to include, for example:
---
layout: sidebar
sidebar: page-nav.md
sidebar-reverse: true
---
- You can also reverse the order of the sidebar and main content using the
sidebar-reversesetting, also included in the snippet above.
- This layout is like having a double sidebar, one "before" and one "after" the main content.
- Like the Sidebar template, the
left-columnandright-columnsettings look for Markdown files in theincludes/contentfolder. - The settings look like this:
---
layout: three-column
left-column: page-nav.md
right-column: signup.md
---