Giter Club home page Giter Club logo

cours-scss's Introduction

Sass

Présentation

Sass (Syntactically Awesome StyleSheets) est un langage de feuille de style, qui vous offre de nouvelles fonctionnalités. Il vous permet d'utiliser des variables, fonctions, règles d'imbrication (nested rules) entre autre afin de générer du CSS brut (via compilation).

Le Sass est aujourd'hui disponible via 2 syntaxes :

  • la syntaxe d'origine qui fonctionne par indentation, les sauts de ligne et qui utilise l'extension .sass
  • la nouvelle syntaxe qui utilise les mêmes séparateurs que le CSS (et donc compatible avec ce dernier) et qui utilise l'extension .scss

Via Sass (from scratch)

npm --save-dev install sass
sass scss/style.scss dist/css/style.css

Vous pouvez utiliser l'option --watch afin de compiler vos fichiers scss à chaque sauvegarde.

Afin d'obtenir un fichier css exploitable dans un environnement de production il faudra utiliser l'option --style=compressed :

sass --style=compressed scss/style.scss:dist/css/style.min.css

Via Webpack (from scratch)

npm --save-dev install webpack webpack-cli
npm --save-dev install sass
npm --save-dev install extract-loader file-loader sass-loader

Il faut ensuite configurer le fichier de configuration de webpack, situé à la racine du projet et qui se nomme webpack.config.js.
Une fois la configuration faite il suffit de lancer webpack via la commande :

npx webpack

Vous pouvez utiliser l'option --watch afin de compiler vos fichiers scss à chaque sauvegarde.

Lancement depuis le repo

npm install
npx webpack

Vous pouvez utiliser l'option --watch afin de compiler vos fichiers scss à chaque sauvegarde.

Ressources

cours-scss's People

Contributors

lelexxx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.