CSS

Watch User Created Playlist (12)

This playlist is user created.

pro-course-rss-logo

PRO RSS Feed

Write Custom Functions with the SCSS @function Directive

Write similar classes with the SCSS @for Control Directive

Organize SCSS into Multiple Files with Partials

Reuse Styles with the SCSS @extend Directive

Use Standard Built-in SCSS Functions for Common Operations:

Reuse Styles with the SCSS @mixin Directive

Organize Styles with SCSS Nesting and the Parent Selector

Use SCSS Variables for Readable and Maintainable Stylesheets

Transpile SCSS to CSS using node-sass

Loop Over Data with the SCSS @each Control Directive

Automate SVG Sprite Background Image Variations with a SCSS Mixin

P

Reuse Flexbox Styles With A Sass Mixin

P
scss tutorial about Write Custom Functions with the SCSS @function Directive

Write Custom Functions with the SCSS @function Directive

5:14 scss

Writing SCSS @functions is similar to writing functions in other programming languages; they can accept arguments and have return statements. SCSS provides a ton of great features, but sometimes we need to roll our own function. We can do that too! They’re useful when the desired functionality isn’t available from the built in SCSS functions and a mixin just won’t do. In this lesson, we learn how and when to use SCSS function directives.

scss tutorial about Write similar classes with the SCSS @for Control Directive

Write similar classes with the SCSS @for Control Directive

5:10 scss

Writing similar classes with minor variations, like utility classes, can be a pain to write and update. Sometimes just a single character is the only difference between classes and updating the defining parameter means we need to change it for every class name and value. We can write a class one time and the @for directive can write all the minor variations for us. If the similar classes need to be updated, with the help of the @for directive, they only need to be updated once. In this lesson we learn how to leverage the power of the SCSS @for control directive to relieve the pain.

scss tutorial about Organize SCSS into Multiple Files with Partials

Organize SCSS into Multiple Files with Partials

3:22 scss

Tired of dealing with monolithic CSS files? Are requests for multiple CSS files hurting your performance? In this lesson we learn how to separate our styles with SCSS partials, and how SCSS imports compile to one file so there's only one request.

scss tutorial about Reuse Styles with the SCSS @extend Directive

Reuse Styles with the SCSS @extend Directive

5:48 scss

We can write reusable styles with the SCSS @extend or @mixin directives. Which one is better? It depends. A better question is, how do they differ?
Extends:
change the source order, mixins don’t.
maintain relationships, mixins don’t.
share inherited traits, mixins don’t.
can extend multiple classes, mixins don’t.
can create multiple class declarations in the compiled CSS, mixins don’t.
can use the placeholder selector, mixins don’t.

Mixins:
can accept arguments, extends don’t.
can pass additional content, extends don’t.
repeat code when compiled, extends group class names together.
work well wIth media queries, extends have a limited interaction wIth media queries.

In this lesson we learn about writing reusable styles with the @extend directive and how it compares to the @mixin directive.

scss tutorial about Use Standard Built-in SCSS Functions for Common Operations:

Use Standard Built-in SCSS Functions for Common Operations:

3:51 scss

We can use javascript for color and opacity variations, math, list and map logic or to see if something exists. SCSS includes functions for a wide range of common use cases for logic in our styles. In this lesson we look at some of the more useful color functions to improve development velocity, readability, and simplify the code. Be sure to checkout all the SCSS functions: http://sass-lang.com/documentation/Sass/Script/Functions.html

scss tutorial about Reuse Styles with the SCSS @mixin Directive

Reuse Styles with the SCSS @mixin Directive

5:24 scss

Copy/pasting the same code is redundant and updating copy/pasted code slows development velocity. Mixins are reusable chunks of code that are included, similar to calling a function, instead of copy/pasted.

Mixins have some nice features:
- Arguments just like functions.
- Arguments can have default values and optional values.
- Named arguments allow us to use optional and default arguments when the mixin is included.
- Variable arguments allow us to have a dynamic number of arguments when the mixin is included.
- The @content directive allow us to add additional styles when the mixin is included.

In this lesson we learn how to DRY up the code with the SCSS @mixin directive and make copy/paste a thing of the past.

scss tutorial about Organize Styles with SCSS Nesting and the Parent Selector

Organize Styles with SCSS Nesting and the Parent Selector

3:06 scss

SCSS nesting can produce DRYer code by targeting child elements without having to write the parent class. Nesting up to 3 levels deep can help us understand relationships between styles. The SCSS parent selector represents the parent class, so it can DRY up targeting pseudo-elements/classes and be an asset for naming conventions. In this lesson we learn how to remove the redundancy of targeting pseudo-elements/classes, and child elements by taking advantage of SCSS’s nesting and parent selectors.

scss tutorial about Use SCSS Variables for Readable and Maintainable Stylesheets

Use SCSS Variables for Readable and Maintainable Stylesheets

2:00 scss

Updating the same color or metric multiple times is no fun. SCSS variables improve maintainability by allowing one name to represent a value that can be used anywhere. SCSS variables also give us the power of creating our own naming conventions to express the intent of specific values. In this lesson we learn how to use SCSS variables to assign user friendly names to colors/metrics so one value change will update that value in all the right places.

scss tutorial about Transpile SCSS to CSS using node-sass

Transpile SCSS to CSS using node-sass

0:45 scss

In this lesson we learn how to set up SCSS and transpile your SCSS code into CSS with node-sass.

scss tutorial about Loop Over Data with the SCSS @each Control Directive

Loop Over Data with the SCSS @each Control Directive

5:06 scss

The SCSS @for directive is great when we know how many iterations are required and we only need 1 variable. What if we need multiple variables to iterate over data sets? Hello SCSS maps and the @each control directive! In this lesson, we’ll check out iterating with lists and looping over data sets with maps and the @each directive.

scss tutorial about Automate SVG Sprite Background Image Variations with a SCSS Mixin

Automate SVG Sprite Background Image Variations with a SCSS Mixin

4:12 scss PRO

n this lesson, you’ll learn how to write a SCSS mixin to generate styles for variations of background-images. We’ll look at using SCSS lists to interpolate dynamic class names and property attributes and output icons at different sizes.

If you need the ability to add or edit icons on a regular basis, having a SCSS mixin do the heavy lifting of calculating background-position, background-size and creating selectors will save you lots of time and manual work.

Note: this lesson assumes you have an understanding of SCSS, mixins and already have a process to compile SCSS.

scss tutorial about Reuse Flexbox Styles With A Sass Mixin

Reuse Flexbox Styles With A Sass Mixin

4:54 scss PRO

This lesson covers flexbox in a reusable mixin that should cover most layout situations on your site. With variables and common defaults, this mixin will cover most alignment issues and replace the need for tables for all time. Need a column with each item evenly spaced but starting their alignment on the top? No problem! How about a row with the items evenly spaced out as well as equal spacing around the edges? We have you covered!

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?