6. Defining Media Queries

There are many benefits to using Sass when building or refactoring responsive layouts. In this video, we’ll cover some the […]

Read More

5. Convert Repeating Declaration Groups Into Mixins

Mixins are a smart way of reusing our code. One of the last steps in refactoring is replacing common patterns […]

Read More

4. Create Variables for Repetitive Values

Styles File Structures The _extends.scss file contains all the placeholders that you’ll @extend in your partials. scss |__ style.scss |__ base | _index.scss | […]

Read More

3. Nest Where It Makes Sense

Don’t over-nest code! Refer to the following page for more details on Nested Selectors Ampersand (&)

Read More

2. Extract Repeating Patterns Into Extends

Common Sass Structures The _extends.scss file contains all the placeholders that you’ll @extend in your partials. scss |__ style.scss |__ base | _index.scss | […]

Read More

1. Break Related Sections Into Partials

Common Sass Structures An example would be scss |__ style.scss |__ base | _index.scss | _base.scss |__components | _index.scss | […]

Read More

Refactoring CSS to Sass

Break related sections into partials Extract repeating patterns into extends Nest where it makes sense Create variables for repetitive values […]

Read More

Ampersand (&)

Sass lets you reference the parent selector of a nested rule using the ampersand (&) symbol. The & becomes the parent […]

Read More

Nested Selectors

Nested selectors make writing descendant and complex selectors fast and simple. .card { display: flex; h1 { color: $color-primary; } […]

Read More

Variables

Style reusability with Sass variables makes you save a lot of time and confusion. .card h1 { color: #278da4; } […]

Read More

Compile & Watch

Compile Sass sass input.scss ouput.css Watch Changes If you run the following command, you wont have to compile sass every […]

Read More

Installing Sass

What is Sass? A CSS preprocessor. A program that takes source code written in one type of language as input, […]

Read More

Full Test Code for dice.py

This is the final version of the tests.py script that we have reached so far for Python Testing lessons to […]

Read More

Coverage HTML Reports

Coverage’s reports are great but sometimes you want something more visual or a page you can share with other people. […]

Read More

Coverage

coverage.py is an amazing library for determining how much of your code is covered by your tests and how much still […]

Read More

Exception Assertion

If your code raises exceptions it’s a good idea to test them to make sure they get raised properly. Luckily unittest provides […]

Read More

Membership Assertions

The unittest library has many different assertions but some are more commonly used than others. Let’s look at how to […]

Read More

Logical Assertions

Assertions test a condition in your code that must be met. A lot of the assertions you’ll write in your […]

Read More

Unit Tests

Most of the power of testing in Python comes from the unittestframework and it’s TestCase class. Technically, unittest is Python’s library for writing tests.   […]

Read More

Doctests

Doctests are the simplest tests to write in Python since they’re written in plain text in the docstrings you’re already […]

Read More