background preloader

Sass

Facebook Twitter

Using Compass in WebStorm | WebStorm Blog. Sass and SCSS extend CSS with variables, mixins, selector inheritance and other nice features that make CSS much friendlier for modern development. The Compass framework is built on Sass, adds a variety of great reusable patterns, and in general makes development with Sass and SCSS much better. Follow these steps to set up Compass for your project in WebStorm. First, make sure that Ruby is installed on your computer. Then install Compass (you can totally use the built-in Terminal in WebStorm for that): gem install compass You can find a little bit more information on Compass installation here: If you’d like to use Compass in the new project, you can run the command: compass init in WebStorm’s Terminal.

It will add folders for SCSS and CSS files and create a config.rb file for Compass in the project root. Now let’s create a new .scss (or .sass) file. WebStorm will suggest adding a new File Watcher for automatic compilation of SCSS/Sass to CSS. Sass: Sass Basics. Before you can use Sass, you need to set it up on your project. If you want to just browse here, go ahead, but we recommend you go install Sass first.

Go here if you want to learn how to get everything set up. PreprocessingPreprocessing permalink CSS on its own can be fun, but stylesheets are getting larger, more complex, and harder to maintain. This is where a preprocessor can help. Once you start tinkering with Sass, it will take your preprocessed Sass file and save it as a normal CSS file that you can use in your website. The most direct way to make this happen is in your terminal. You can also watch individual files or directories with the --watch flag. Sass --watch input.scss output.css You can watch and output to directories by using folder paths as your input and output, and separating them with a colon. Sass --watch app/sass:public/stylesheets Sass would watch all files in the app/sass folder for changes, and compile CSS to the public/stylesheets folder. 💡 Fun fact: SCSS Syntax. PhpStorm 2016.2 Help :: Working with Sass and SCSS in Compass Projects.

PhpStorm supports development in projects structured in compliance with the Compass framework. This framework uses Sass and SCSS extensions of CSS. On this page: Preparing for Compass development The Compass framework is installed through the Ruby Gem manager, therefore you need to install Ruby first. Download and install Ruby. Setting up a Compass project You can have a project set up according to the Compass requirements in two ways: create a new Compass project or create an empty project and introduce a Compass-specific structure in it.

During project set-up, a conf.rb configuration file is generated. To set up the Compass-specific structure in an existing project: Open the desired project in PhpStorm. Integrating Compass with PhpStorm To develop a Compass-specific project in PhpStorm, you need to specify the Compass executable file compass and the project configuration file config.rb. Creating a Compass Sass or a Compass SCSS transpiler Make sure the File Watchers plugin is enabled. Compass Transition. @mixin transition($transitions...) { $default: (compact($default-transition-property $default-transition-duration $default-transition-function $default-transition-delay),); $transitions: if(length($transitions) == 1 and type-of(nth($transitions, 1)) == list and list-separator(nth($transitions, 1)) == comma, nth($transitions, 1), $transitions); $transitions: set-arglist-default($transitions, $default); @include with-each-prefix(css-transitions, $transition-support-threshold) { $delays: comma-list(); $transitions-without-delays: comma-list(); $transitions-with-delays: comma-list(); $has-delays: false; @each $transition in $transitions { $transition: transition-map($transition); $property: map-get($transition, property); $duration: map-get($transition, duration); $timing-function: map-get($transition, timing-function); $delay: map-get($transition, delay); $has-delays: $has-delays or $delay; @if $current-prefix == -webkit { $delays: append($delays, if($delay, $delay, 0s)); @else { @if $has-delays {

Codecademy. Tutoriel pour apprendre SASS et Compass. Salut à toi très cher MMI ! Aujourd’hui, j’ai le plaisir de te présenter cette mini série d’articles, j’ai nommé « Booste ton Workflow ». L’objectif est simple : Te présenter les outils d’aujourd’hui et de demain qui vont faire de toi une bête du front. Ma mission ? Faire de toi un intégrateur d’enfer que tout le monde voudra s’arracher. Tu intègreras les maquettes plus vite que ton ombre, sans relâche tu ne CSSras jamais avant d’être satisfait. SASS (Syntactically Awesome Style Sheets) Le sujet du jour, c’est le CSS, et plus particulièrement son évolution. Pour Windows Il faut commencer par installer Ruby. Pour Mac OS Sur mac, c’est relativement simple. Si tout va bien, tu es prêt pour te lancer dans SASS ! Faire fonctionner SASS Pour faire fonctionner SASS on va avoir besoin de deux choses : Un invité de commande ou terminal (le même que celui utilisé pour l’install si tu es sur Windows)Un projet de test Très rapidement, je vais faire une structure très basique telle que : Que c’est beau.