Sass/Compass Or how it finally clicked and I learned to love - - PowerPoint PPT Presentation

sass compass
SMART_READER_LITE
LIVE PREVIEW

Sass/Compass Or how it finally clicked and I learned to love - - PowerPoint PPT Presentation

Sass/Compass Or how it finally clicked and I learned to love preprocessors . . . . . . . Scott Wilkinson HaloFX Media #HaloFX @hackmonk3y halofx.com hackmonkey.com Why ? Because CSS is Hard - Chris Eppstein History In


slide-1
SLIDE 1

Sass/Compass

Or how it finally clicked and I learned to love preprocessors . . . . . . .

Scott Wilkinson

HaloFX Media

#HaloFX @hackmonk3y halofx.com hackmonkey.com

slide-2
SLIDE 2

Why?

slide-3
SLIDE 3

“Because CSS is Hard”

  • Chris Eppstein
slide-4
SLIDE 4

History

In the beginning... CSS has allows been a bit of trouble. 1980’s- SGML had stylesheets 1990- Stylesheets goal of HTML from beginning 1995- HTML 2.0, no stylesheets 1996- CSS1 spec

– IE3 offers text support, no box support

1997- HTML 3.2 & HTML 4.0

– NN4 offers limited CSS support, only because of IE

slide-5
SLIDE 5

History

1998- HTML4.0 & CSS2 spec

– Neither IE4 or NN4 support CCS1 well.

1999- CSS3 drafts start to show up.

– CSS3 broke into modules – Browser prefix Hell – IE5, Netscape fading fast

2013- CSS3 modules still evolving! Firefox still requires -moz-box-sizing!

slide-6
SLIDE 6

What is a preprocessor?

  • Write in one syntax and output in a different syntax
  • Extends CSS by writing a stylesheets in an extended

meta-language format and compiling out to valid CSS.

  • Emphasis on DRY (don't repeat yourself)
  • No browser dependencies
slide-7
SLIDE 7

What preproccesors can do

  • Variables
  • Define & reuse common rules
  • Automate common syntax
  • Make minor changes to existing rules
  • Better organization of rules
  • Perform math calculations
slide-8
SLIDE 8

Sass & LESS

Sass - sass-lang.com

– Syntactically Awesome Stylesheets – 2 syntax, (Sass, SCSS)

  • Identical functionality

– Ruby based app – Compass support

LESS - lesscss.org

– Paired down version of Sass – Javascript based app – Influenced Sass v2 syntax

slide-9
SLIDE 9

Sass

slide-10
SLIDE 10

Sass

Sass {style with attitude}

sass-lang.com

slide-11
SLIDE 11

Sass

Sass – Original syntax

– Syntactically Awesome Stylesheets – Indented format

  • White space matters
  • No curly brackets or ;

– .sass extension

SCSS – Newer syntax

– Sassy CSS

  • White space doesn’t matter
  • Uses curly brackets and ;

– .scss extension – Any valid CSS is valid SCSS

Functionally identical, SCSS most commonly used

slide-12
SLIDE 12

Sass Code Examples

slide-13
SLIDE 13

Nesting

sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#nested_rules

slide-14
SLIDE 14

Variables

sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#variables

slide-15
SLIDE 15

Parent References

sass- lang.com/docs/yardoc/file.SASS_REFERENCE.html#referencing_parent_selectors

slide-16
SLIDE 16

Mixins

sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#mixins

slide-17
SLIDE 17

Arguments

sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#mixin-arguments

slide-18
SLIDE 18

Extends

sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#extend

slide-19
SLIDE 19

Comments

sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#comments

slide-20
SLIDE 20

Partials

sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#partials

slide-21
SLIDE 21

Tools

slide-22
SLIDE 22

Sassmeister

sassmeister.com

slide-23
SLIDE 23

Codepen

codepen.io/pen/

slide-24
SLIDE 24

Scout

mhs.github.io/scout-app

slide-25
SLIDE 25

Scout

mhs.github.io/scout-app

slide-26
SLIDE 26

Compass.app

compass.handlino.com

slide-27
SLIDE 27

Compass.app

compass.handlino.com

slide-28
SLIDE 28

Compass.app

compass.handlino.com

slide-29
SLIDE 29

Compass.app

compass.handlino.com

slide-30
SLIDE 30

Compass

compass-style.org

slide-31
SLIDE 31

Compass

slide-32
SLIDE 32

Compass

compass-style.org/reference/compass

slide-33
SLIDE 33

Compass Mixins

compass-style.org/reference/compass

slide-34
SLIDE 34

Mixins

slide-35
SLIDE 35

Horizontal List

compass-style.org/reference/compass/typography/lists/horizontal_list

slide-36
SLIDE 36

Border Radius

compass-style.org/reference/compass/css3/border_radius

slide-37
SLIDE 37

Font Face

compass-style.org/reference/compass/css3/font_face

slide-38
SLIDE 38

Gradients

compass-style.org/reference/compass/css3/images

slide-39
SLIDE 39

Gradients

compass-style.org/reference/compass/css3/images

slide-40
SLIDE 40

Box Shadow

compass-style.org/reference/compass/css3/box_shadow

slide-41
SLIDE 41

Box Shadow

compass-style.org/reference/compass/css3/box_shadow

slide-42
SLIDE 42

Sprites

compass-style.org/reference/compass/utilities/sprites

slide-43
SLIDE 43

Sprites

compass-style.org/reference/compass/typography/text/replacement

slide-44
SLIDE 44

Sprites

compass-style.org/help/tutorials/spriting/magic-selectors

slide-45
SLIDE 45

Errors

slide-46
SLIDE 46

Drupal

slide-47
SLIDE 47

Sass, Compass and Omega

drupal.org/node/1808252

slide-48
SLIDE 48
  • compass create . --sass-dir=scss --css-dir=css --bare
  • Copy all files from css folder to scss folder
  • Rename all .css files to .scss

Sass, Compass and Omega

slide-49
SLIDE 49

Sass, Compass and Omega

<theme>/scss <theme>/css

slide-50
SLIDE 50

Sass/Compass

Or how it finally clicked and I learned to love preprocessors . . . . . . .

Scott Wilkinson

HaloFX Media

#HaloFX @hackmonk3y halofx.com hackmonkey.com