haml & sass

38
Haml & Sass (SCSS) by Krzysztof Jablonski

Upload: krzysztof-jablonski

Post on 13-Jan-2015

1.808 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Haml & sass

Haml & Sass (SCSS)

by Krzysztof Jablonski

Page 2: Haml & sass

ERb (Embedded Ruby)

ERb is the default template language included with Rails.It is very similar to PHP, JSP and ASP.

Page 3: Haml & sass

ERb (Embedded Ruby)

ERb is the default template language included with Rails.It is very similar to PHP, JSP and ASP.

Page 4: Haml & sass

ERb (Embedded Ruby)

ERb is the default template language included with Rails.It is very similar to PHP, JSP and ASP.

Page 5: Haml & sass

ERb (Embedded Ruby)

<%= %>will render the result returned from the embedded Ruby expression as text

Page 6: Haml & sass

ERb (Embedded Ruby)

<%= %>will render the result returned from the embedded Ruby expression as text

<% %> will execute the embedded expression without rendering the result

Page 7: Haml & sass

ERb (Embedded Ruby)

<%= %>will render the result returned from the embedded Ruby expression as text

<% %> will execute the embedded expression without rendering the result

<% -%>will execute the embedded expression without rendering the result and will suppress trailing whitespace

Page 8: Haml & sass

ERb (Embedded Ruby)

<%= %>will render the result returned from the embedded Ruby expression as text

<% %> will execute the embedded expression without rendering the result

<% -%>will execute the embedded expression without rendering the result and will suppress trailing whitespace

<%- %>will execute the embedded expression without rendering the result and will suppress leading whitespace

Page 9: Haml & sass

ERb (Embedded Ruby)

<%= %>will render the result returned from the embedded Ruby expression as text

<% %> will execute the embedded expression without rendering the result

<% -%>will execute the embedded expression without rendering the result and will suppress trailing whitespace

<%- %>will execute the embedded expression without rendering the result and will suppress leading whitespace

<%# %>will cause the embedded expression to be parsed as a comment

Page 10: Haml & sass

Haml

Haml is based on one primary principle. Markup should be beautiful.

Page 11: Haml & sass

Haml

Haml is based on one primary principle. Markup should be beautiful.

index.html.haml

Page 12: Haml & sass

Haml

Haml is based on one primary principle. Markup should be beautiful.

index.html.haml

index.html.erb

Page 13: Haml & sass

Haml examples

Page 14: Haml & sass

Haml examples

Page 15: Haml & sass

Haml examples

Page 16: Haml & sass

Haml examples

Page 17: Haml & sass

Haml 3.0

Easier Multiline Ruby Functions

Page 18: Haml & sass

Haml 3.0

Custom Data Attributes

Page 19: Haml & sass

CSS (Cascading Style Sheets)

Page 20: Haml & sass

CSS (Cascading Style Sheets)

Netguru rules:

Page 21: Haml & sass

CSS (Cascading Style Sheets)

Netguru rules:one style sheet for all browsers

Page 22: Haml & sass

CSS (Cascading Style Sheets)

Netguru rules:one style sheet for all browsersIE6 support

Page 23: Haml & sass

CSS (Cascading Style Sheets)

Netguru rules:one style sheet for all browsersIE6 supportrounded corners (CSS)

Page 24: Haml & sass

CSS (Cascading Style Sheets)

Netguru rules:one style sheet for all browsersIE6 supportrounded corners (CSS)only PNG without PNGfix

Page 25: Haml & sass

Sass 

Sass is an extension of CSS3, adding:nested rules,variables,mixins,selector inheritance,and more.

Page 26: Haml & sass

Sass

 

Page 27: Haml & sass

Sass

 

Page 28: Haml & sass

Sass

 

Page 29: Haml & sass

Sass

 

Page 30: Haml & sass

Sass vs SCSS (Sassy CSS)

SCSS SASS

Page 31: Haml & sass

Sass 3

variables with the $ prefix instead of ! (bang)

Page 32: Haml & sass

Sass 3

variables with the $ prefix instead of ! (bang)mixins are declared with @mixin and included with @include

Page 33: Haml & sass

Sass 3

variables with the $ prefix instead of ! (bang)mixins are declared with @mixin and included with @includecolor functions (lighten, darken, etc.)

Page 34: Haml & sass

Sass 3

variables with the $ prefix instead of ! (bang)mixins are declared with @mixin and included with @includecolor functions (lighten, darken, etc.)selector inheritance (@extend) 

Page 35: Haml & sass

Sass 3

variables with the $ prefix instead of ! (bang)mixins are declared with @mixin and included with @includecolor functions (lighten, darken, etc.)selector inheritance (@extend) = is no longer necessary for declaring properties with variable values

Page 36: Haml & sass

Sass 3

variables with the $ prefix instead of ! (bang)mixins are declared with @mixin and included with @includecolor functions (lighten, darken, etc.)selector inheritance (@extend) = is no longer necessary for declaring properties with variable valuesstrings without quotes were deprecated

Page 37: Haml & sass
Page 38: Haml & sass

Sites

http://haml-lang.com/http://sass-lang.com/http://nex-3.com/