Where did we start from?

This was a project done with Lidia Ruiz Olmedo & Elisabetta Lanzafame for Ironhack’s UX/UI bootcamp course in Barcelona. We chose a small business and using information architecture, branding and…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Understanding Sass Basics With Practical Examples

Learn how to use Sass on your projects.

Sass basics.
Image created with ❤️️ By Mehdi Aoussiad.

Sass stands for Syntactically Awesome Stylesheets. It is a CSS pre-processor that makes it easier to work with CSS, reduce repetition, and save time. This will help to style your pages easily with fewer lines of code. It’s like CSS with superpowers. In addition to that, Sass also has some amazing new features that we will cover in this article. That’s why it’s a good skill to have as a web developer.

In this article, we will learn about some Sass basics that you need to know in order to improve your CSS. Let’s get right into it.

Sass works Just like regular CSS, but the browser does not understand it, you will need a Sass pre-processor to convert Sass code into CSS. There is an extension in the popular text editor VsCode called “Live Sass Compiler”, it does all the job for you, just install it from your VsCode and you will be good to go.

Live Sass compiler.
Live Sass compiler.

Another way to compile Sass is by using NPM, but you have to make sure that you have Node installed in your system. Once you have done that, you can use the command below in your terminal.

Before we start with Sass comments, we will need to create a Sass file. We will use Scss because that’s what most people do. So we create Sass files as we do in CSS, but now make sure to put instead of .css => .scss .

We create Sass comments as we do in JavaScript. Have a look at the example below:

Variables in Sass are just like properties where you store values to use them again somewhere on your code by calling that variable name. In JavaScript, variables are defined using the let and const keywords. In Sass, variables start with a $ followed by the variable name.

Here is an example:

Add a comment

Related posts:

What the Heck Is This Relationship About?

What the Heck Is This Relationship About?. A relationship without trust is like a car without gas, you can stay in it all you want, but it won’t go anywhere.-unknown.

La rete ai tempi del Coronavirus

La pandemia da Covid-19 ha portato a fissare delle norme sulla circolazione. Fino a qualche settimana fa, gli spostamenti erano solo permessi in caso di emergenza, per ragioni lavorative, di salute e…

Our Devoxx Java Puzzler

This year Expedia Group sponsored Devoxx UK and I joined the Expedia booth as one of the representatives from Hotels.com (part of Expedia Group). As part of our booth, we created a Java puzzler which…