background preloader

SASS

Facebook Twitter

The Complete Guide to SCSS/SASS. Subscribe to my tutorial newsletter to get notified of my next article!

The Complete Guide to SCSS/SASS

In this tutorial Sassy, Sass and SCSS will refer to roughly the same thing. Conceptually, there isn’t much difference. You will learn the difference as you learn more, but basically SCSS is the one most people use now. Le préprocesseur SASS. Sass Tutorials. Sass Guidelines. Getting Sassy with CSS ~ Julie Cameron. The Complete Guide to SCSS/SASS. The 80-20 Approach to Sustainable SCSS. Nesting in Less and Sass. A code should be organized.

Nesting in Less and Sass

That’s the fact and I think is a very good one for the opening of the text about nesting. So... CSS is used for describing the presentation of a document written in a markup language. There are few more texts to check on CSS, e.g. positions in CSS, text underline, relative units. Every one of us is familiar with that and knows that you first need a selector to detect an element and after that comes the styling. For the best way to select the desired element, we should use every trick there is - selectors. Webdesign.tutsplus. Le blog Webnet – blog.webnet.fr via @Webnet_France. Webdesign.tutsplus. Guide d'installation de SASS avec Sublime Text 3. Sublime Text 3.

Guide d'installation de SASS avec Sublime Text 3

Responsive Web Design. Sass is the most popular and well supported CSS preprocessor.

Responsive Web Design

At its basics Sass allows you to write CSS in a more dynamic way through the introduction of variables and nested rules. One of the best things about Sass is that you can write pure CSS within the .scss files without any issues, and only when you want to take advantage of Sass capabilities do you have to then start getting more advance. A very powerful capability of Sass is the ability to use Mixins. To take the perfect explanation from the Sass reference: Mixins allow you to define styles that can be re-used throughout the stylesheet without needing to resort to non-semantic classes like .float-left.

I have a few favourite mixins that I like to use in my projects (and have been used on this site). Getting Started with Sass and Breakpoint Mixin. My colleague Chris was one of those people until recently and is currently finding the delight that comes with scss over css.

Getting Started with Sass and Breakpoint Mixin

My one tip for him when he got started was to break up his Sass files into modules by creating _module.scss files, and to use a breakpoint mixin to write the media query changes to the module inline with the rest of the rules. Chris is now much happier with life, so let’s take a look at what I’m talking about in more detail. Tutoriel Vidéo HTML-CSS Compiler ses fichiers SCSS avec libSASS. Comme vous le savez je suis un très grand fan du préprocesseur SASS, je l'utilise dans tous mes projets et je l'acompagne aussi de la librairie Compass.

Tutoriel Vidéo HTML-CSS Compiler ses fichiers SCSS avec libSASS

Malheureusement, j'ai toujours été frustré par la lenteur du système et le besoin de devoir installer Ruby pour le faire fonctionner (les gens qui comme moi sont sur Windows comprendront :)). Un portage de SASS a été fait en C pour permettre une compilation plus rapide et un portage plus simple du compilateur : libSASS. Il y a encore quelques incohérences entrer SASS et libSASS mais on peut déjà l'utiliser sans rencontrer ces cas spéciaux. Par contre, il n'est pas possible d'utiliser des librairies tiers comme compass car dépendant de Ruby. Sass functions cheat sheet. ##Sass Functions Cheat Sheet ####RGB Functions rgb(­$red, $green, $blue) Creates a color from red, green, and blue values. rgba­($red, $green, $blue, $alpha) Creates a color from red, green, blue, and alpha values. red(­$co­lor) Gets the red component of a color. gree­n($­col­or) Gets the green component of a color. blue­($c­olor) Gets the blue component of a color. mix(­$co­lor1, $color2, [$weig­ht]) Mixes two colors together. ========== ####HSL Functions hsl(­$hue, $satur­ation, $light­ness) Creates a color from hue, satura­tion, and lightness values. hsla­($hue, $satur­ation, $light­ness, $alpha) Creates a color from hue, satura­tion, lightness, and alpha values.

Sass functions cheat sheet

Using pure Sass functions to make reusable logic more useful. Sass gladly lets you add calculations and logic in a way that CSS would never abide.

Using pure Sass functions to make reusable logic more useful

But does that mean you should go around adding and dividing just anywhere? Find out how you can use pure Sass functions to make reusable logic more useful and your working Sass file more readable. Sass adds Functions Sass has mixins, we all know that. And because they accept arguments I always thought of them as Sass's version of functions. Mixins and Functions: Kissing Cousins. 10 SASS (SCSS) mixins you should be using in your projects. Writing in SCSS lets you use features that don't exist in CSS yet like variables and nesting.

10 SASS (SCSS) mixins you should be using in your projects

The biggest feature though, in my opinion, is mixins. I'm not going to go into depth of what they are, or how they work, as there are other articles out there in the wild for that. What I am going to do is share a few of our favourites that we use on pretty much every project we do here at Engage. 1. CSS Preprocessors - Sass vs LESS. There are three primary CSS preprocessors on the market today, Sass, LESS, and Stylus.

CSS Preprocessors - Sass vs LESS

In this post, we will be comparing the two preprocessors which seem to be the most widely used among developers, Sass vs LESS. By switching to a preprocessor can help streamline your development process. What is a CSS Preprocessor? Writing CSS can become quite repetitive and little tasks such as having to look up hex color values, closing your tags, etc. can become time-consuming. And so that is where a preprocessor comes into play. Ashley Nolan polled developers in a recent case study to see which preprocessors they preferred. 689 people voted for Sass while LESS received 140 votes.

Source: 2015 Survey from ashleynolan.co.uk Disclaimer: these are just responses from a small portion of developers. Rounding decimals in Sass. Sass Introduction: Take your CSS to the next level - Let's Code Better. Comprendre et utiliser Sass – Puce et Média. Semantic CSS vs OOCSS vs Grid Systems vs Preprocessors (Less, Sass, etc) Writing Modular CSS With Sass and BEM. How to make your CSS awesome with Bourbon, Neat, Bitters and Refills! Keeping Your HTML Semantic with SASS with Ray Villalobos. Release the docs! Learn Sass In 15 Minutes.

Danny Markov If you write copious amounts of CSS, a pre-processor can greatly decrease your stress levels and save you a lot of precious time. Using tools such as Sass, Less, Stylus or PostCSS makes large and complicated stylesheets clearer to understand and easier to maintain. Thanks to features like variables, functions and mixins the code becomes more organized, allowing developers to work quicker and make less mistakes. We’ve worked with pre-processors before as you may remember from our article about Less. The Sass Playground! La grille vue et corrigée par Sass - agence AntheDesign. Découvrir Susy. Susy vous permet de créer vos layouts à partir de grilles. Guide to using Sass. Introduction I agree that 'pre-processors' such as LESS, Sass, Compass etc are normally a bad idea because generally they are used badly by developers/designers who could do better without them (see: Object-Oriented CSS).

That being said, there are some areas where pre-processors can really help out, such as being able to use @import without worrying about the browser loading the stylesheet synchronously and thus making the page slower to load. Or being able to create a variable to hold your client's branding colours for easy re-use. In this post I've purposely not included details on everything that Sass can do because I don't believe they are useful.

Getting Started with Sass and Breakpoint Mixin. My colleague Chris was one of those people until recently and is currently finding the delight that comes with scss over css. My one tip for him when he got started was to break up his Sass files into modules by creating _module.scss files, and to use a breakpoint mixin to write the media query changes to the module inline with the rest of the rules. Chris is now much happier with life, so let's take a look at what I'm talking about in more detail. Structuring your Sass When I first started working with Sass I set my project up in the same way that I would usually approach my standard CSS file. NormaliseTypographicalLayoutGeneral@media query overrides. LiveStyle Analyzer. Using Source Maps to Debug Sass in Chrome. If you use Sass in your front-end projects, chances are your partials are split in a clean and logical fashion based on a reliable Sass architecture.

In such cases, debugging the compiled CSS could be both troublesome and time consuming. Sass provides a flag to enable line numbers (--line-numbers), which includes comments (like below) in your CSS. Although this is helpful, you would still have to trace the bug in your CSS back to the source file manually. And editing the CSS in the browser using the developer tools cannot be persisted, since it will get overwritten by the next Sass compile.

The Sass Way. Scout - Compass and Sass without all the hassle. Le blog Webnet – blog.webnet.fr via @Webnet_France. Bourbon - A Lightweight Sass Tool Set. Object Oriented CSS (OOCSS) with Sass. The concept of Object Oriented CSS was conceived by Nicole Sullivan and has since become one of the most widely adopted methodology of writing neat and manageable CSS. The objective of this methodology is to make CSS as reusable as possible by making it modular and generic. The mantra is Don’t Repeat Yourself (DRY). “Object Oriented” CSS The term “object oriented” is rooted in software engineering where it means organising code around ‘objects’ rather than procedural actions, and data rather than procedural logic. The term is applied to CSS not in the strictest engineering sense, but almost as a metaphor.

In OOCSS, a CSS object is a repeating visual pattern, i.e. a pattern that would produce the same results visually regardless of where it is placed. Sass & Compass, mes compagnions de route - nicecoder. Sass. Un article de Wikipédia, l'encyclopédie libre. Se lancer dans Sass. Sass Guidelines — French translation. Vous avez cherché sass - Ice Development. Les préprocesseurs CSS, c’est senSass ! Un préprocesseur CSS est un outil (ou programme) permettant de générer dynamiquement des fichiers CSS. L’objectif est d’améliorer l’écriture de ces fichiers, en apportant plus de flexibilité au développeur web (source : Wikipedia).

Les préprocesseurs CSS les plus couramment employés sont aujourd’hui Sass, LESS (dont nous avons déjà parlé), PostCSS et Stylus. Dans le cadre de cet article, j’ai fait le choix de ne couvrir que le préprocesseur “Sass”, largement majoritaire parmi les développeurs web en ce moment. Functions — Sass Documentation. Methods in this module are accessible from the SassScript context. For example, you can write $color: hsl(120deg, 100%, 50%) and it will call #hsl. The following functions are provided: Note: These functions are described in more detail below.

Sass: Syntactically Awesome Style Sheets.