Questions tagged [sass]

Sass (Syntactically Awesome Style Sheets) is an extension of CSS adding features like nested rules, variables, mixins and class extensions. This enables developers to write structured, manageable and reusable CSS. Sass is compiled into standard CSS. It is primarily a CSS pre-processor language that accepts both the CSS and its personalised syntax of writing visual design codes.

Overview:

Sass is a meta-language on top of that describes the style of a document cleanly and structurally, with more power than flat CSS allows.

Sass is an extension of written in . It adds nested rules, variables, mixins, selector inheritance, and useful functions like color manipulation or conditional statements2. It's translated to well-formatted, standard CSS using the command-line tool or a web-framework plugin.

It is the only language that can store design tokens (e.g. colors, font sizes, spacing) and use the value types9 natively; i.e. numbers, colors, strings, lists, and booleans.

Sass has two syntaxes:

  1. SCSS (Sassy CSS): As of Sass3, this is the main syntax. It is a superset of CSS3, so all valid CSS files are also valid SCSS. Files with this syntax have the extension .scss.

Example SCSS:

$margin: 12px;

li {
  .border {
    margin: $margin / 2;
  }
}
  1. SASS: The indented syntax. Instead of braces and semicolons, it uses line indentation to specify blocks (similar to Ruby's syntax). Files with this syntax have the extension .sass.

Example SASS:

$margin: 12px

li
  .border
    margin: $margin / 2

Frameworks / Extensions:

  • 4 is an extension of Sass which provides pre-defined cross-browser mixins and additional functionality like automated sprite-generation.
  • 5 is a simple and lightweight mixin library for Sass.

Flavors:

  • Ruby Sass1 is the original Ruby-based version of Sass.
  • LibSass6 is C/C++ port of the Sass precompiler. It compiles very quickly, can be embedded in other languages and binaries, and aims for feature parity with the original Ruby Sass.
  • Node Sass7 uses LibSass to compile .scss files using Node.

Links:


Resources:

27250 questions
7
votes
1 answer

Yeoman angular: Sass compilation extremly slow

I'm using the latest Yeoman angular generator to start a project. I'd like to use SASS and Compass, which is provided by default from Yeoman. The big drawback of Compass is, that it is painfully slow. I have Twitter Bootstrap included (the SASS…
23tux
  • 14,104
  • 15
  • 88
  • 187
7
votes
4 answers

Sass --watch not recompiling

Sass updates my main stylesheet build.css when I save changes to build.scss, but will not update build.css when I save changes to any partials, for example _grid-settings.scss. I essentially have to manually re-save build.scss each time I make a…
JustinTBrown
  • 157
  • 1
  • 10
7
votes
2 answers

Is it possible to set different SASS output style for development and production with Compass in rails?

Let say I would like to set nested style for development and compressed for production. There is only one option in Compass configuration file: output_style = :compact # or :nested, :expanded, :compressed
Voldy
  • 12,829
  • 8
  • 51
  • 67
7
votes
10 answers

Sass filewatcher for webstorm

I am trying to use sass in a NodeJS project and this is the library I installed with nodejs https://www.npmjs.org/package/node-sass I am using webstorm for this project and I can't get the Sass file watcher to work. Even after I save the…
EternallyCurious
  • 2,345
  • 7
  • 47
  • 78
7
votes
5 answers

gulp-sass not compiling sass files

I'm actually trying to build a gulp planning to do web related stuff, like compile sass, minify css, uglify javascript and so on. But I'm really having troubles with sass. Here's a sample of my code : gulp.task('compile-sass', function() { …
soenguy
  • 1,332
  • 3
  • 11
  • 23
7
votes
2 answers

Grunt file fails 'Aborted due to warnings'

I'm new to Grunt. I thought I'd give it a try, so I created this grunt file. module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), concat: { css: { src: [ …
Michael Giovanni Pumo
  • 14,338
  • 18
  • 91
  • 140
7
votes
2 answers

SASS user-select mixin without import - compass

I'm working on SASS with compass. I've already created some mixins but still, there is one mixin I can't make it to work. That's the user-select one. I know I can import it using @import "compass/css3/user-interface"; but that's not the point. Why…
Nim
  • 71
  • 1
  • 4
7
votes
2 answers

Sass error: selector groups may not be extended

I'm getting an error when attempting to compile my SCSS file into CSS. The error reads: "selector groups may not be extended" in reference to this line @extend .btn, .btn-link;. Note: I'm importing Bootstrap to use in my main scss file. Full…
Patrick Beeson
  • 1,667
  • 21
  • 36
7
votes
1 answer

Change Color of Background Input Field For Autofill Values

I currently have a Rails 4 application running bootstrap-sass for Bootstrap 2. I use localhost for my testing. I have applications with a login screen. The input fields are white with a really thin gray border with blue text. When I type in the…
7
votes
1 answer

Fundamental difference between Susy 2.0 and SingularityGS

I am wondering if there is any key differences between these two grid systems. I can't see any on the surface and dont know why I would want to choose one over the other. I built sites with both singularity and susy 1 in the last few months and they…
Colin
  • 961
  • 7
  • 8
7
votes
1 answer

Getting error when using command line for SASS to watch files

I've been having problems getting Sass working from terminal in Mac OS X Mavericks on my Macbook Pro. I'm working off a brand new clean install; reformatted my hard disk, loaded Mavericks, and first thing I went into the command line to set this…
crimsonvessel
  • 197
  • 3
  • 10
7
votes
4 answers

Integrate SASS/SCSS with Django

I want to use SASS/SCSS with Django application. I followed the link https://bitbucket.org/synic/django-sass. I installed SASS using sudo pip install sass. When i run Python manage.py runserver,iam getting error as 'sass' is not a valid tag…
CRS...
  • 95
  • 1
  • 7
7
votes
2 answers

How to reuse (extend) bootstrap css classes in rails/sass

I @import "boostrap" in core.scss file which also import other scss files (e.g.: _modals.css). In modals.css I want to extend some bootstrap classes: .modal-container { @extend .row; } And extend does not work as expected: WARNING on line 42…
knagode
  • 5,816
  • 5
  • 49
  • 65
7
votes
4 answers

Foundation 5 and page printing

I'm using Zurb Foundation. I'm trying to print a page exactly as it looks in large screen but everything get stacked (and floated wrong). I succeded in having the grid in the printing page by substituting every "screen" occurrences with "print,…
Damiano Barbati
  • 3,356
  • 8
  • 39
  • 51
7
votes
3 answers

CSS background: url, no work when the url have brackets

I have the next url for an image url: http://www.andrearosseti.cl/image/cache/data/New%20Coleccion/Planas/SWEET-5-TAUPE-(1)-340x340.jpg Now, i wont make in my CSS background:…
rudighert
  • 315
  • 1
  • 4
  • 11
1 2 3
99
100