42
Understanding Sass By: Mario Hernandez November 15, 2014

Understanding sass

Embed Size (px)

DESCRIPTION

Basics of Sass configuration in combination with other ruby gems such as compass, breakpoint and singularitygs.

Citation preview

Page 1: Understanding sass

Understanding Sass

By: Mario Hernandez

November 15, 2014

Page 2: Understanding sass

Mario HernandezFront-End Developer

@DesignsDrive

Page 3: Understanding sass

Design/Theming● Usability Testing

● Responsive Design

● Drupal Theming

● Annotated Wireframes

@Mediacurrent

Development● Drupal Support

● Custom Module Development

● Large Scale Systems Integration

● Security & Performance Expertise

We help organizations build highly impactful, elegantly designed Drupal websites that achieve the strategic results you need.

Digital Strategy● Content Strategy

● Content Generation

● Result Metrics

● Marketing Automation Integration

Page 4: Understanding sass

● Why sass and Compass?

● Requirements

● sass in Visual Studio

● Configure environment

● Doing magic

@Mediacurrent

Agenda

Page 5: Understanding sass

What is sass?

@Mediacurrent

CSS with superpowers

Page 6: Understanding sass

What is sass?

@Mediacurrent

Sass is an extension of CSS that adds power and elegance to the basic language. It allows you to use variables, nested rules, mixins, inline imports, and more. Sass helps keep large stylesheets well-organized, and get small stylesheets up and running quickly, particularly with the help of the Compass style library.

Page 7: Understanding sass

What is sass?

@Mediacurrent

http://sass-lang.com

Page 8: Understanding sass

Features of Sass

@Mediacurrent

● Variables● Nesting● Partials● Imports● Mixins

Page 10: Understanding sass

@Mediacurrent

$font-stack: Helvetica, sans-serif;$primary-color: #333;

Page 11: Understanding sass

@Mediacurrent

$font-stack: Helvetica, sans-serif;$primary-color: #333;

body { font-family: $font-stack; color: $primary-color;}

Page 13: Understanding sass

@Mediacurrent

nav { ul {

margin: 0;padding: 0;list-style: none;

} li { display: inline-block; } a {

display: block;padding: 6px 12px;text-decoration: none;

}}

Page 16: Understanding sass

@Mediacurrent

// _reset.scss

html,body,ul,ol { margin: 0; padding: 0;}

Page 17: Understanding sass

@Mediacurrent

/* base.scss */

@import 'reset';

body { font: 100% Helvetica, sans-serif; background-color: #efefef;}

Page 18: Understanding sass

@Mediacurrent

html, body, ul, ol { margin: 0; padding: 0;}

body { font: 100% Helvetica, sans-serif; background-color: #efefef;}

Page 20: Understanding sass

@Mediacurrent

@mixin border-radius($radius) { -webkit-border-radius: $radius; -moz-border-radius: $radius; -ms-border-radius: $radius; border-radius: $radius;}

Page 21: Understanding sass

@Mediacurrent

@mixin border-radius($radius) { -webkit-border-radius: $radius; -moz-border-radius: $radius; -ms-border-radius: $radius; border-radius: $radius;}

.box { @include border-radius(10px); }

Page 22: Understanding sass

@Mediacurrent

.box { -webkit-border-radius: 10px; -moz-border-radius: 10px; -ms-border-radius: 10px; border-radius: 10px;}

Page 23: Understanding sass

What is Compass?

@Mediacurrent

Compass is an open-source CSS authoring framework which uses the Sass stylesheet language to make writing stylesheets powerful and easy.

Page 24: Understanding sass

What is Compass?

@Mediacurrent

http://compass-style.org

Page 25: Understanding sass

Requirements● Ruby● Compass● sass

@Mediacurrent

Page 26: Understanding sass

Requirements● Ruby Installer (Windows)● Ruby● Compass● sass● Mindscape Web Workbench (Visual Studio)

@Mediacurrent

Page 27: Understanding sass

Installing Compass

@Mediacurrent

gem install compass

Page 28: Understanding sass

Installing Sass

@Mediacurrent

gem install sass

Page 29: Understanding sass

Starting a new sass project

@Mediacurrent

compass create <myproject>

Page 30: Understanding sass

Not a fan of the command line?

@Mediacurrent

http://compass.handlino.comhttp://mhs.github.com/scout-app

Page 31: Understanding sass

What’s your problem?

@Mediacurrent

Page 33: Understanding sass

I have 99 problems… and markup is one of them

@Mediacurrent

Page 34: Understanding sass

@Mediacurrent

<div class="row wrapper">

<div class="main col-sm-6 col-md-5 col-lg-6">...</div>

<div class="sidebar col-sm-6 col-md-5 col-md-offset-2 col-lg-6 col-lg-offset-0">...</div>

</div>

Page 35: Understanding sass

@Mediacurrent

<div class="wrapper">

<div class="main">...</div>

<div class="sidebar">...</div>

</div>

Page 36: Understanding sass

Other Gems

● Breakpoint● Singularity

@Mediacurrent

Page 37: Understanding sass

Breakpoint

Breakpoint makes writing media queries in Sass super simple.

@Mediacurrent

#mobile

Page 38: Understanding sass

#mobile

Breakpoint

Breakpoint makes writing media queries in Sass super simple.

http://breakpoint-sass.com/

@Mediacurrent

Page 39: Understanding sass

Singularity Grid System

Singularity is a next generation grid framework built from the ground up to be responsive.

@Mediacurrent

Page 40: Understanding sass

Singularity Grid System

Singularity is a next generation grid framework built from the ground up to be responsive.https://github.com/at-import/Singularity

@Mediacurrent

Page 41: Understanding sass

Resources

● http://www.mediacurrent.com/search/results/sass

● http://leveluptuts.com/tutorials/sass-tutorials

● http://sassmeister.com/

@Mediacurrent