
Sass & Compass avancé
Optimiser ses feuilles de style CSS
- Pages
- 285
- Edition
- 1
- Publisher
- Eyrolles
About
With Sass and its CSS3 framework Compass, professional front-end developers facing productivity and maintainability demands finally have free tools to write their CSS style sheets consistently.
Sass, a must for writing better CSS
Backed by a very active community, the free Sass preprocessor offers an arsenal of features for front-end productivity: lighter, simpler CSS during development, variables, mixins, functions, placeholders, concatenation, on-the-fly code validation… By making the DRY and KISS principles easy to apply, it lets you design extremely robust project structures. Splitting the code logically across several files makes teamwork efficient, provided everyone involved runs the same versions of the tools.
Compass, the CSS3 framework for Sass, keeps the site compatible whatever the browser, ending long debugging sessions in Internet Explorer. It ships a CSS sprite generator, to which a whole chapter is devoted: generating high-definition sprites has never been simpler.
A methodology reference for front-end developers
Written by one of the early adopters of Sass/Compass, with a foreword by Raphaël Goetter, founder of Alsacreations.fr, this book is a must for front-end developers who want the best CSS writing practices and the programming skills needed to master Sass.
Where to buy the book
The book is in French. It is sold in any good bookshop with a computing shelf, and in many online stores, including:
Librairie Eyrolleseyrolles.com
Fnaclivre.fnac.com
Furet du Nordfuret.com
Culturacultura.com
Leslibraires.frleslibraires.fr
Amazonamazon.fr
Digital edition
A digital edition is also available:
Table of contents
Chapter 1Installing Sass and Compass
- Installing Sass, Compass… and Ruby?
- Available graphical tools
- First conversion of a Sass file into a CSS style sheet
- Summary
Chapter 2A Sass syntax
- Two syntaxes to choose from: Sass and SCSS
- Nesting rules, a revolution
- Several levels of comments
- Variables
- Split up and work faster
- Reusing code: an introduction to mixins
- Passing a content block to a mixin
- Inheritance with @extend
- Mastering inheritance with placeholders
- Media query support
- Pitfalls to avoid
- Summary
Chapter 3Developing with Sass
- Sass and data
- Maths in your CSS
- Control directives
- Advanced work with functions
- Summary
Chapter 4A first Sass project and production constraints
- Setting up the project tree
- Compiling a Sass project
- Using Sass libraries
- Easy project setup with Compass
- Compass centralises the project configuration
- Compiling a Compass project
- Using Sass libraries in a Compass project
- Summary
Chapter 5Compass, your future best friend
- Simpler access to static assets
- Compass, a DRY toolbox
- Compass, a CSS3 framework
- Cross-browser support
- Summary
Chapter 6Building CSS sprites with Compass
- What is a CSS sprite?
- Sprites, a necessity
- The magic of Compass for sprite generation
- Mastering selectors
- Sprites done just right
- Example 1: customising sprite selectors
- Example 2: removing repeated dimensions
- Example 3: high-definition CSS sprites
- Example 4: declaring sprite dimensions per image size
- No more slow compilations
- Summary
Chapter 7Managing a Compass project: some methodology
- Managing Sass and Compass versions properly
- Debugging a Sass project
- Working as a team
- Summary
Appendix AAdvanced configuration with Compass
- Maintaining a custom cache buster
- Showing Growl notifications on Mac OS X
- Sharing files between projects
Appendix BA survival guide to the command line
- The command prompt
- Listing files
- Moving around the file system
- Handling files
- Wildcard patterns
Downloads
The main source code shown in the chapters of the book can be downloaded from GitHub.
