Book description
If you know HTML and CSS, then you can have all the power of Sass and Compass at your disposal. This step-by-step guide will take you through the time-saving features that makes it so much easier to create cross-browser CSS.
- Simple, clear, and thorough. This book ensures you don’t need to be a programming mastermind to wield the power of Sass and Compass!
- Previously tricky and time-consuming CSS tasks will become trivial. Easily produce cross-browser CSS3 gradients, shadows, and transformations along with image sprites, data URIs, and more.
- Follow along with installing, setting up, and working through an entire project, implementing the Sass and Compass techniques and tools as we go.
In Detail
The CSS preprocessor, Sass, is becoming the de-facto standard for producing cross-browser CSS more maintainable and with more ease. It supercharges CSS with features that make previously difficult and time-consuming tasks trivial. This book concentrates on distilling the techniques in a straightforward manner making it accessible to all, even to those that only know HTML and CSS.
Written by the author of the bestselling "Responsive Web Design with HTML5 and CSS3", Sass and Compass for Designers will explain everything you need to get Sass and Compass installed, mastered, and making your life easier. There will be no perplexing terminology or baffling syntax left unexplained. We'll get you set up and then build a site together, step by step, using the incredible power of Sass and Compass.
We will start with a completely unstyled HTML document and build a responsive Sass and Compass powered website step by step.
Sass and Compass make CSS easy. You'll learn how to manipulate color in the stylesheet with a single command, create responsive grids with ease, automatically create image sprites, and create CSS3 powered rules that work across all modern browsers.
"Sass and Compass for Designers" explains how to produce great CSS easier than ever before.
Table of contents
-
Sass and Compass for Designers
- Table of Contents
- Sass and Compass for Designers
- Credits
- Foreword
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
-
1. Getting Started with Sass and Compass
- Why do we need CSS preprocessors?
- Why you should use Sass and Compass
- What is Sass?
- What is Compass?
- Install Sass and Compass
-
Installing and working with Sass and Compass on the command line
- Installing Ruby on Windows
- Running a gem command
- Mac OS X command line install
- Windows command prompt install
- Check which version of Sass and Compass you have
- Check which versions of Sass and Compass are available
- Installing the latest version of Sass and Compass (including prerelease versions)
- Create a Sass and Compass project from the command line
- Automatic compile to CSS from the Command Line
- Graphical tools for working with Sass and Compass
- How to work with Sass files in text editors
- Summary
- 2. Setting Up a Sass and Compass project
-
3. Nesting, Extend, Placeholders, and Mixins
- Styling a site with Sass and Compass
- Separating layout from visuals
- What nesting is and how it facilitates modules of code
- Using the @extend directive to extend existing rules
- Use placeholder selectors to extend styles only when needed
- What mixins are and how we can use them to easily produce oft-needed code
- A cautionary note about generated CSS
- Summary
-
4. Manipulate Color with Ease
- Only define a color once
- The lighten and darken functions
- Markup amendments and diversions
- Back to colors
- The complement (and invert) functions
- The invert function
- The adjust-hue function
- The saturate and desaturate functions
- The transparentize/fade-out functions
- The opacify/fade-in functions
- The grayscale function
- The rgba function
- The mix function
- The adjust-color function
- The scale-color function
- The shade and tint functions
- Putting it all together
- Summary
-
5. Responsive and Flexible Grids with Sass and Compass
- Arguments against grids
- Reasons to use a grid system
- What is Susy?
- Installing the Susy Compass plugin
- Including Susy in a project
- Setting up a Susy grid
- Defining a context for the grid
- Making a ‘mobile first’ responsive grid
- Making breakpoints with Susy
- Creating an entirely fluid grid
- Creating a static ‘fixed’ grid
- Using Susy grid helpers
- Pre, Post, Squish, Push, and Pull
- Grids within grids
- Sub-pixel rounding issues
- Summary
-
6. Advanced Media Queries with Sass and Mixins
- Media queries in Sass
- Inline media queries with Sass
- Creating a mixin to easily handle media queries
- How the MQ media query mixin works
- Variations on a theme
- Writing inline media queries
- Gzip and CSS compression = victory!
- Testing the real-world difference between inline and grouped media queries
- Reviewing CSS code
- Summary
-
7. Easy CSS3, Image Sprites, and More with Compass
- Easy CSS3 with Compass's mixins
- The border-radius syntax
- Multiple columns
- Background gradients
- Adding background images with the Compass image-url helper
- Image width and height helpers
- Compass image sprites
- Compass's text replacement mixins
- Creating data URIs from images
- Easy fallbacks for non-SVG capable devices
- CSS transforms
- CSS Filters
- Transitions
- Summary
- 8. Programmatic Logic with Sass
-
9. Becoming a Sass and Compass Power User
- Turning off Compass support for specific vendors
- Adding experimental support for bleeding edge CSS features
- Defining experimental values
- The Sass interactive shell
- Adding the Sass globbing plugin to import batches of partial files
- Creating multiple separate style sheets
- Converting partial files to standalone style sheets
- Compass statistics
- Clearing the Sass cache
- One-off Compass compiles
- Mission debrief
- Avoid conjecture with tools and testing
- Parting shots
- Summary
- Index
Product information
- Title: Sass and Compass for Designers
- Author(s):
- Release date: April 2013
- Publisher(s): Packt Publishing
- ISBN: 9781849694544
You might also like
book
API Security in Action
API Security in Action teaches you how to create secure APIs for any situation. By following …
book
Building Microservices, 2nd Edition
As organizations shift from monolithic applications to smaller, self-contained microservices, distributed systems have become more fine-grained. …
video
Full Stack Web Development Mastery Course - Novice to Expert
Full stack development refers to the development of both frontend (client-side) and backend (server-side) portions of …
book
Infrastructure as Code, 2nd Edition
Six years ago, Infrastructure as Code was a new concept. Today, as even banks and other …