Exercise: Building out the Header & Footer
Instructions
Styling the Header using the interface
Adding the borders
- Add a Group block inside of the Header template part.
- Group settings: Toggle the Inner blocks use content width Layout setting off.
- Drag the Site Title block into this Group.
- Group Styles:
- Set the Block Spacing to
0px.
- Add a 5px top border using the Accent color.
- Add a 1px bottom border using the Contrast / Three color.
- Set the Block Spacing to
Adding the spacing around the Site Title
Add a level 3 padding top and bottom to the Site Title block.
Implementing the navigation
- Add a Group inside of the first Group we added to the Header template part.
- Group settings: Toggle the Inner blocks use content width Layout setting off.
- Group Styles:
- Add a 1px top border using the Contrast / Three color.
- Add a level 1 padding top and bottom.
- Add a Navigation block into this Group.
Styling Navigation blocks
- Open the Styles panel.
- Go to Blocks.
- Search for Navigation.
- Set the following styles:
- Letter case: uppercase
- Appearance: bold
Aligning navigation items
- Inspect the Navigation block
- In the Layout Settings, under Justification, set Justify Items Center.
Implementing Block Type styles in theme.json
In theme.json, under styles, blocks:
- Add a core/site-title selector.
- Add an elements section inside of core/site-title.
- Add a link section inside of elements.
- Add a typography section inside of link.
- Set textDecoration to none.
- A a color section inside of link.
- Add a text key, and set it to var(--wp--preset--color--accent)
Styling the Footer
Adding the borders
- Add a Group block inside of the Footer template part.
- Group settings: Toggle the Inner blocks use content width Layout setting off.
- Drag the paragraph into this Group.
- Group Styles:
- Set the padding top to level 1.
- Add a 1px top border using the Contrast / Three color.
- Add a 5px bottom border using the Accent color.