
These guidelines are meant to give you a consistent and documented approach to writing Sass code. That being said, there are many ways to use these features. Because of this, getting started with Sass is no harder than learning CSS: it simply adds a couple of extra features on top of it.

The point is not to turn CSS into a fully featured programming language Sass only wants to help where CSS fails. Meanwhile, Sass wants to be conservative regarding the CSS language. This is where Sass comes in, as a meta-language, to improve CSS’ syntax in order to provide extra features and handy tools. While very simple to learn, it can quickly get quite messy, especially on large projects. CSS, as we all know, is not the best language in the world. Sass’ ultimate objective is to fix CSS’ flaws. Sass is an extension of CSS that adds power and elegance to the basic language. This is how Sass describes itself in its documentation: To do this, we’ll apply styles to our element.Support Sass Guidelines Spread the word Table of Contents We’ll begin by updating the font on all of our text. In Practiceĭiving back into our Styles Conference website, let’s start adding some font-based properties.

Now our elements will change color upon being hovered over. When used with the element, as shown here, all elements will receive unique styles when they are hovered over. The :hover pseudo-class styles an element when a user hovers over that element. For reference, pseudo-classes are keywords that may be added to the end of a selector to style an element when it’s in a unique state. The demonstration here uses the :hover CSS pseudo-class, something we’ve never seen before. The font-family property in action looks like this: 1īody Additionally, the last font should be a keyword value, which will use the system default font for the specified type, most commonly either sans-serif or serif. Should the first font be unavailable, alternative fonts are declared after it in order of preference from left to right.įont names consisting of two or more words need to be wrapped in quotation marks. The first declared font, starting from the left, is the primary font choice. The value of the font-family property contains multiple font names, all comma separated. The font-family property is used to declare which font-as well as which fallback or substitute fonts-should be used to display text. To begin we’ll discuss the font-based properties. Most of these properties will be prefaced with either font-* or text-*. These properties fit into two categories: font-based properties and text-based properties. Let’s take a look at the CSS required to change the color of all the text within the element on a page: 1ĬSS offers a lot of different properties for editing the look and feel of text on a page. Hexadecimal values are the most prevalent, as they provide the most control with the least amount of effort. These formats, as we discussed in Lesson 3, “ Getting to Know CSS,” include keywords, hexadecimal values, and RGB, RGBa, HSL, and HSLa values. The color property accepts one color value, but in many different formats. The only property we need to set the color of text is the color property. Getting rid of the browser defaults and using our own typeface and text color immediately begins setting the tone of our page. While there are a number of other properties that can be changed-size, weight, and so on-the typeface and text color generally have the largest impact on the look and legibility of a page. Typically one of the first decisions we’ll make when building a website is choosing the primary typeface and text color to be used.

A font, on the other hand, is very similar to an MP3 in that it is not the artistic impression itself, but only a method of delivering the artistic value.

It is created by an artist or artists and is open to public interpretation. A typeface is very similar to a song in that it is a work of art. One way to help clarify the difference between a typeface and a font is to compare them to a song and an MP3. Using a font on a computer allows the computer to access the typeface. It is the artistic impression of how text looks, feels, and reads.Ī font is a file that contains a typeface. Here is a breakdown of exactly what each term means.Ī typeface is what we see. The terms “typeface” and “font” are often interchanged, causing confusion.
