Instant SASS CSS How-to
eBook - ePub

Instant SASS CSS How-to

Alex Libby

  1. 80 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Instant SASS CSS How-to

Alex Libby

Book details
Book preview
Table of contents
Citations

About This Book

In Detail

CSS styling has been a key part of developing for the Internet since the early 1990s, but unlike JavaScript, has suffered from the inability to produce dynamic styles, using functions, operators, and variables. SASS uses the power of Ruby to bring support for all three and more to your CSS, allowing you to engage in a more efficient, modular style of working, and making it easier to maintain your CSS styling in your projects.

Instant SASS CSS How-to is a practical, hands-on guide that provides you with a number of clear step-by-step exercises, which will help you take advantage of the power of SASS, and give you a good grounding in writing and compiling CSS style sheets using the SASS pre-processor language.

This book looks at how you can incorporate SASS into your web pages, and either produce style sheets dynamically, or pre-compile them before including the final article into your site's pages.

You will also learn how you can use the power of mixins, functions, and variables to help produce style sheets, and reduce the amount of code you need to write in your style sheets. We will also take a look at how you can incorporate a more modular style to your development workflow, which will help with making style sheets more manageable and easier to update in the future. We will also take a look at how you can build up libraries of reusable code that you can incorporate into your future projects.

You will learn everything you need to know to start using SASS to help produce more efficient style sheets in your site's pages, and adopt a more modular development workflow, which will make it easier to maintain your sites in the future.

Approach

Filled with practical, step-by-step instructions and clear explanations for the most important and useful tasks. Get the job done and learn as you go. This book is filled with practical, hands-on recipes to help you write SASS quickly and more efficiently.

Who this book is for

This book is great for those new to using CSS pre-processors such as SASS, and who are looking to get a good grounding in how to use SASS. It's assumed you will have some experience in using HTML and CSS already; it is likely you will be responsible for maintaining at least one website (the larger the better), and are keen to learn how you can use SASS to help make it easier to manage your CSS styles. Although SASS is powered by Ruby, it is not essential to already be familiar with Ruby for the purposes of completing the recipes in this book.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Instant SASS CSS How-to an online PDF/ePUB?
Yes, you can access Instant SASS CSS How-to by Alex Libby in PDF and/or ePUB format, as well as other popular books in Computer Science & Web Programming. We have over one million books available in our catalogue for you to explore.

Information

Year
2013
ISBN
9781782163787
Edition
1

Instant SASS CSS How-to


Instant SASS CSS How-to

Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: February 2013
Production Reference: 1180213
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78216-378-7
www.packtpub.com

Credits

Author
Alex Libby
Reviewer
Melanie Archer
Acquisition Editor
Kartikey Pandey
Commissioning Editor
Maria D'souza
Technical Editor
Veronica Fernandes
Project Coordinator
Esha Thakker
Proofreader
Lindsey Thomas
Production Coordinator
Melwyn D'sa
Cover Work
Melwyn D'sa
Cover Image
Sheetal Aute

About the Author

Alex Libby has background in IT support – he has been involved in supporting end users for the last 15 years in a variety of different environments, and currently works as a technical analyst, supporting a medium-sized SharePoint estate for an international parts distributor based in the UK. Although he gets to play with different technologies in his day job, his first true love has always been with the open source movement, and in particular experimenting with CSS/CSS3 and HTML5. To date, Alex has written two books (one on HTML5 video and another on JQuery tools) – Instant SASS CSS How-to is his third book.

About the Reviewer

Melanie Archer is a web developer living in Oakland, California, USA. Since hand-coding her first web page in 1997, she's worked with many corporations, design agencies, and startups to bring standards-compliant delight to dozens of user interfaces. Other titles she has reviewed include HTML5 Boilerplate Web Development, Divya Manian, Packt Publishing.
You can follow Melanie on Twitter at @mejarc.

www.PacktPub.com

Support files, eBooks, discount offers and more

You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
Support files, eBooks, discount offers and more
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.

Why Subscribe?

  • Fully searchable across every book published by Packt
  • Copy and paste, print and bookmark content
  • On demand and accessible via web browser

Free Access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

Preface

Imagine the following scenario:
You're an accomplished developer, working on a high profile project for a demanding client. You're normally a fairly patient kind of person, but even this client is proving a little bit too much of a challenge…when you get that phone call you dread.
"Alex…you know those buttons you kindly changed for me last week? I'm really sorry, but could we please try a different color, as the boss really doesn't like that shade of red!"
This is where you silently curse – that's more than 60 buttons, littered with browser-specific CSS prefixes; a real pain in the neck, which you could well do without, particularly as it took you a couple of hours to make the changes last time. (Yes, it's a big site, before you ask!). Sounds familiar? Wish there was another way to do this? I thought so – welcome to the world of SASS!
SASS, I hear you ask? What's this all about then? Well, I could give you the technical low-down, but it's probably better demonstrated by the use of an example. Do you remember those 60 buttons I mentioned earlier? What if you could change the color of all of those buttons in one go? Yes, you read right, all of those buttons. This is just a small part of what SASS can achieve, as a superset of CSS3. We can use the power of SASS to set a variable that you could use to change the color value set against all buttons in one go, with a single click.
Intrigued? We will look at this and more throughout this book, so let's make a start…

What this book covers

Throughout this book, we're going to look at a variety of exercises that are designed to help you become accustomed to working with the basics of the LESS CSS preprocessor language. You're probably wondering what we're going to cover, right? No problem – let me reveal all:
Downloading and installing SASS (Must know) is the most important part of this book – here, we take a look at how to download and install SASS. Depending on which platform you prefer to use, it can be really easy, or somewhat more involved.
Adding support to text editors (Must know) will take you through how to add support for SASS to your favorite text editor. In this recipe, we'll use Sublime Text 2 as our editor, but the principles could equally apply to other editors that you may prefer to use.
Pre-compiling SASS (Must know) will show you that you don't always have to rely on the command line to compile SASS; there are alternatives available that can do the heavy work for you. In this recipe, I'll show you how, using Scout. We'll also look at a means to convert CSS back to SCSS, although it is not without its shortcomings
Viewing SASS in a browser (Become an expert) is crucial to help debug any style issues in your code. There will be moments when you've written a style, only to find it's not working as you expected. No problem – I'll show you some ways to view this information, depending on which browser you prefer to use.
Using nested rules (Must know) in SASS is a good way to reduce repetition in your code. In this recipe, we'll start our coding journey by looking at how you can use SASS to nest your CSS rules, to avoid such repetition.
Using comments in SASS (Should kn...

Table of contents

Citation styles for Instant SASS CSS How-to

APA 6 Citation

Libby, A. (2013). Instant SASS CSS How-to (1st ed.). Packt Publishing. Retrieved from https://www.perlego.com/book/390404/instant-sass-css-howto-pdf (Original work published 2013)

Chicago Citation

Libby, Alex. (2013) 2013. Instant SASS CSS How-To. 1st ed. Packt Publishing. https://www.perlego.com/book/390404/instant-sass-css-howto-pdf.

Harvard Citation

Libby, A. (2013) Instant SASS CSS How-to. 1st edn. Packt Publishing. Available at: https://www.perlego.com/book/390404/instant-sass-css-howto-pdf (Accessed: 14 October 2022).

MLA 7 Citation

Libby, Alex. Instant SASS CSS How-To. 1st ed. Packt Publishing, 2013. Web. 14 Oct. 2022.