0

Cascading Style Sheets (CSS) is a style sheet language that is here for many years. It made great leaps through the time and today, with the third version, it brings a lot of new features. In spite of them, there is still place for improvement. This place fills CSS preprocessors like Sass (http://sass-lang.com), Less (http://lesscss.org) or Stylus (http://learnboost.github.io/stylus/). It is hard to say which of them is the best. Any of them can be helpful with your project and which one you choose is most of time on you.Inthisthesis,I’mwritingabouttheSass. Itismychoice,becauseofthecommunity,relation with Ruby and my experiences with this language. It’s recommended that reader of this tutorial is advanced in the CSS, while the CSS code in the examples will not be always explained. Most of time the knowledge of the CSS2 would be enough, except few sections thattalksaboutSassandtheCSS3. InthesecondchapterI’mgoingtoexplainhowworksand whatbringsCompassframework(http://compass-style.org/). Itisoneofthefirstframeworks for Sass and has great website reference.The tutorial will at first explain how to prepare your workstation to work with Sass and than explain the syntax. It starts with the basics like variables and nesting. Moving to the more advanceconceptsasmixins,SassScriptanddirectives. Theexamplecodeiscreatedforevery explained situation. After that it moves to the Compass chapter. There it explains the basics aboutthecommandlinetoolforcreatingprojectsandtheCompasscorewithit’smixinsand functions.

 Trick Tech Guru


How often happened to you that you were writing CSS, in which you need to set up color for some element, but you don’t remember the code of used color? You can still find it in document, but it could take some time. Another example. You got some code at which had worked other developer and only thing that you need to do is to change colors of all links in the document. The problem is that you don’t know in how many declarations is that color used in document and how we can see later, code written in Sass is often divided in many files. If the previous developer used variable to store the color value, than your work would be just to find the declaration of color for link and change it.


In this example situations variables come to be handy. It’s true that they are often used as constants in Sass. There are no problems to change their values later, but it is not good practice to do so, while it can start to be mess and you can not be sure which value is used at the moment so easily. The definition of variable starts with symbol $ following with the variable name, double-colon and the variable value. The value can be color code in any format supported in CSS, string, number or length with unit.


 Download


100 MB

Password = www.tricktechguru.com





 
Top