So you've mastered the basics of Sass/Compass. How can you take it to the next level? In this presentation, I cover control directives, functions, geometry methods and more.
using a CSS Preprocessor is better than not using one •A conversation about how Preprocessors can bloat your CSS Many great articles arguing the merits/gotchas of using a pre- processor. Here’s one I really agree with: http://bit.ly/Sassisntbad My personal opinion: “Like everything in technology, preprocessors are a tool in your arsenal. You should understand the fundamentals of CSS before relying on them.” Monday, May 7, 12
is that you have *some* CSS knowledge and are aware of best practices. If not, here’s a great article for you: kiano.sh/Inxxym •How to build apps with Sencha Touch While we will go over examples that include demo Sencha Touch apps, the focus really is on the Sass/ Compass and resulting CSS Monday, May 7, 12
provides a simpler, more elegant syntax for CSS and implements various features that are useful for creating manageable stylesheets.” •The foundation for style implementations in ExtJS and Sencha Touch •Ruby Based Monday, May 7, 12
diverse variations in seconds! •Helps you create design standards for your CSS. •Using a main color in a number of selectors? Create a variable! $color: #fff; $pxHeight: 10px; Monday, May 7, 12
for reuse •Mixins can be imported across projects, helping you to create your own framework @mixin pictos-iconmask($name) { .x-button .x-button-icon.x-icon-mask.#{$name} { -webkit-mask-image: theme_image($theme-name, "pictos/" + $name + ".png"); } } Monday, May 7, 12
control directives in languages like javascript, ruby, PHP -- Sass provides some rudimentary functionality: •if/else if/else •for •while •each Monday, May 7, 12
else if, else) •create exceptional cases determined by CSS controlled attribute OR •Sass also contains an “if” function which works as: if($condition, $if-true, $if-false) Monday, May 7, 12
Sass are color features •Create themes/schemes/palettes based on harmonious color relationships •Mix colors using color relationships •Sass has operations for RGB and HSL Monday, May 7, 12
of helpful functions which can make interesting results: •Geometry functions: •sin(), cos(), tan(), pi() •Additional math functions: •e(), log(), sqrt() Advance processing in Compass Monday, May 7, 12
•Offload some of the processing for things you might do in javascript for faster performance •Be able to calculate in one place and not worry about it. •Do things like: •calculate coordinates on a circle •plot points on a graph •create some interesting designs using math! Monday, May 7, 12
based on hsl relationships. •This can help you determine what colors might go with your initial color. •Color relationships are based on Sass color functions Monday, May 7, 12
javascript framework which relies on Sass/Compass for its look/ feel. •Sencha has put together a really solid set of mixins: buttons, pictomasks, toolbars •There’s really no limit to what you can add using Sass/Compass specific to your applications Monday, May 7, 12