As you’ve been doing, you will first migrate over the media queries into the footer widget partial. Then we’ll discuss different variable naming for media query device widths. You’ll look at two different examples, including WebDevStudio’s wd_s theme and Tonya’s personal blog theme. You want the variables to be general enough to be relevant for each project that you build while still being purposeful and declarative.
Labs
Labs are hands-on coding projects that you build along with Tonya as she explains the code, concepts, and thought processes behind it. You can use the labs to further your code knowledge or to use right in your projects. Each lab ties into the Docx to ensure you have the information you need.
Each lab is designed to further your understanding and mastery of code. You learn more about how to think about its construction, quality, maintainability, programmatic and logical thought, and problem-solving. While you may be building a specific thing, Tonya presents the why of it to make it adaptable far beyond that specific implementation, thereby giving you the means to make it your own, in any context.
Site Footer Styles
Let’s start by migrating the media queries for the site footer. Then you will walk through the thought process and exercise of refactoring these styles.
Part 2a – Modular CSS Using Sass – Developer’s Genesis Starter Child Theme
Stylesheets by their very nature do not comply with clean, quality principles as everything is one gigantic file that is filled with redundancies. It’s inefficient and error-prone to work with a stylesheet. But just like what you learned in Part 1, the stylesheets can be broken up into modules and partials using Sass. In this lab, you will take your first steps to working with Sass by splitting up the Genesis starter theme’s stylesheet and converting it to Sass.
Lab Introduction
In this lab, you and I are going to finish the footer module by bringing in the media queries, refactoring, and assigning new variables. Why don’t you try to finish this module on your own using the strategies that you learned so far? Then watch these videos to see how Tonya thinks about refactoring.
Push the Theme to GitHub
Have you been pushing your theme to a version control service such as GitHub, GitLab, or Bitbucket? You should be. As you complete a module, you will want to save those changes and have a record of what changed. The preferred strategy is to put your theme under version control by creating a repository on one of the services and then using Git to document and push your latest work. This episode assumes that you have Git installed on your machine and a repository is already created and synched. All of the services give you instructions on how to do […]
Header Right Styles
While working on refactoring, we discover that the search form is within the base partial. Hum, but that is a widget. Therefore, it should be a separate partial within the Widgets Module and not in the Header Module. Let’s refactor and create a new partial. Then you’ll finish up the header right styles refactoring. Once you get this episode complete, you will have a completed Header Module.
Title Area Styles Part 2
Now you will continue refactoring by identifying potential variables to remove the hardcoded literals within the partials. Good candidates are colors, font sizes, and dimensions such as width and height.
Title Area Styles – Part 1
There are multiple strategies for refactoring. I will show you multiple ways to accomplish the same objective. We will walk through the thought process of why you might want to use one over another. The point is: use what works best for you. For example, where do you put .header-image styles? Do you embed them into each sub-component such as the .title-area? Or do you make a separate partial just for the specific use case of .header-image? Let’s talk our way through it for you to determine what works best for you. A rule of thumb for deciding where to […]
Dividing Up the Title Area Styles
In this episode, you will walk through a couple of different approaches to handling the title area. Notice that it is comprised of the base styles for the title area plus the site title, site description, and header image styles. Ah, each of those is sub-components within the sub-module. So how would you handle the Sass styles? A good rule of thumb is: can you quickly and easily find the styles. By breaking them up into partials for each of the sub-components, you can more easily find what you are looking for just by reading the partial’s file name. All […]
Base Styles
Let’s start by migrating the media queries into the base styles of the site header. Then you will walk through the thought process and exercise of refactoring the base styles.