SlideShare a Scribd company logo
ISEP | 19.9.2015
o/
• Marco Pinheiro
• geek | biker | open source envagelist
• head of dev.
• @marcopinheiro
• marco.alex.pinheiro@gmail.com
agenda
syntactically awesome style sheets
aka: CSS with superpowers
http://sass-lang.com/guide
sass
• CSS on its own can be fun, but stylesheets are getting
larger, more complex, and harder to maintain.
• This is where a preprocessor can help. Sass lets you
use features that don't exist in CSS yet like variables,
nesting, mixins, inheritance and other nifty goodies
that make writing CSS fun again.
sass
• “SASS is the most mature, stable, and powerful CSS
preprocessor in the world.”
• Sass is open-source, and is actively developed by
several tech companies and hundreds of developers
wordwide at http://github.com/nex3/sass
sass - install n compile
• $ gem install sass
• $ sass input.scss output.css
or
• $ sass --watch input.scss:output.css
http://codepen.io
sass - quick test-drive
sass - quick test-drive
http://codepen.io
sass - some ingredients…
• partials
• variables
• nesting
• extending / inheritance
• mixins
• conditions
sass - partials
• use partials to organize (modularize) your code
• the file names must start with underscore and you can suppress the
extension
@import 'shared/global';
@import ‘pages/home' (aka _home.scss)
@import 'pages/blog';
sass - variables - $
(_variables.scss)
$portolinux-purple: “#669”;
$sans-serif-font: 'ff-dagny-web-pro', 'Helvetica Neue', Arial, sans-serif;
$serif-font: 'ff-tisa-web-pro', Georgia, Times, serif;
they make code easier to change by reducing duplication but they also allow you to
assign names to special property values like colors, which helps you understand the
intent behind a given style.
sass - DRY - nesting
body.home .media-unit {
border: 1px solid #ccc;
background-color: #fff;
}
body.home .media-unit .right {
border-left: 1px solid #ccc;
}
body.home .media-unit .right h1 {
font-size: 24px;
}
body.home {
.media-unit {
border: 1px solid #ccc;
background-color: #fff;
.right {
border-left: 1px solid #ccc;
h1 {
font-size: 24px;
}
}
}
}
Nesting will help keep your code clean, logical, and well-organized, which should
also make it easier to manage over time.
sass - DRY - nesting @
.container {
width: 940px;
@media screen and (max-width:
940px) {
width: auto;
}
}
Sass allows you to nest media queries inside other rules, making it easier to see
which styles are applied to a given object on your page:
.container {
width: 940px;
}
@media screen and (max-width:
940px) {
.container {
width: auto;
}
}
sass - DRY - nesting &
a {
color: $portolinux-purple;
&:visited {
color: red;
}
&:hover {
color: green;
}
&:active {
color: blue;
}
}
a{color: #669}
a:visited{}
a:hover{}
a:active{}
Use an ampersand & as a "shorthand" way to include a parent.
sass - DRY - nesting &
.stupid-long-selector-name {
background: $color-background;
&:hover {
background: $color-hover;
}
}
Use an ampersand & as a "shorthand" way to include a parent.
sass - DRY - extend/inheritance
.message {
border: 1px solid #ccc;
padding: 10px;
color: #333;
}
.success {
@extend .message;
border-color: green;
}
.error {
@extend .message;
border-color: red;
}
Using @extend lets you share a set of CSS properties from one selector to another.
.message, .success, .error {
border: 1px solid #cccccc;
padding: 10px;
color: #333;
}
.success {
border-color: green;
}
.error {
border-color: red;
}
sass - mixins
@mixin centerer {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
reusable sets of properties or rules that you include, or “mix,” into other rules.
You define them using the @mixin keyword, and include them using the @include
keyword.
.parent {
position: relative;
}
.holly-cented-block {
@include centerer;
}
sass - mixins (with args.)
@mixin rounded-corners ($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}
.button {
@include rounded-corners (5px);
}
@mixin opacity ($opacity) {
opacity: $opacity;
$opacity-ie: $opacity * 100;
filter: alpha(opacity=$opacity-ie); //
IE8
}
.button {
@include opacity (0.8);
}
sass - mixins (vendor)
• http://paranoida.github.io/sass-mediaqueries/
• $ bower install sass-mediaqueries
or
• curl -O https://raw.githubusercontent.com/paranoida/sass-
mediaqueries/master/_media-queries.scss
@import "media-queries";
@ screen(min-width, max-width,
orientation)
@ min-screen(width)
@ max-screen(width)
--
@ screen-height(min-height, max-
height, orientation)
@ min-screen-height(height)
@ max-screen-height(height)
--
@ hdpi(ratio)
--
@ landscape
@ portrait
@ iphone3(orientation)
@ iphone4(orientation)
@ iphone5(orientation)
@ iphone6(orientation)
@ iphone6-plus(orientation)
--
@ ipad(orientation)
@ ipad-retina(orientation)
--
@ hdtv(standard)
sass - mixins (vendor)
@include screen(320px, 640px) { ... }
sass - mixins (vendor)
@media screen and (min-width:
320px) and (max-width: 640px){
}
.brand {
background-image: url(logo.png);
@include hdpi {
background-image: url(logo_2x.png);
}
}
Compass is an open-source CSS
Authoring Framework.
http://compass-style.org/
compass
(screen.scss)
@import “compass”
$ gem install compass
$ compass create portolinuxproj
$ compass watch
compass - config.rb
require 'compass/import-once/activate'

# Require any additional compass plugins here.



# Set this to the root of your project when deployed:

http_path = "/"

css_dir = "assets/css/final"

sass_dir = "assets/sass"

images_dir = "assets/img"

javascripts_dir = "assets/js"

fonts_dir = "assets/fonts"

#output_style = (environment == :production) ? :compressed : :expanded

output_style = :expanded 



# To disable debugging comments that display the original location of your
selectors. Uncomment:

# line_comments = false

color_output = false



preferred_syntax = :scss

compass - let’s rock!
@import “compass/reset”
@import "compass/css3"
@include inline-block;
@include transition(all 0.3s ease-in-out);
@include text-shadow( 0 1px 1px rgba(#000,0.3) );
@include single-transition(color, 0.5s, ease-in);
@include border-radius(4px, 4px);
@include box-shadow(red 2px 2px 10px);
@include opacity(0.1);
@import “compass/reset”
@import "compass/css3"
@include sticky-footer(72px, "#layout", "#layout_footer", “#footer");
@include transform(rotate(-135deg) scale(2) skew(-10deg, -10deg));
compass - let’s rock!
Gulp.js
Automate and enhance your workflow
http://gulpjs.com | http://gulpjs.com/plugins/
gulp.js
$ npm install --global gulp
//gulpfile.js
var gulp = require('gulp');



gulp.task('default', function() {

// place code for your default task here

});
$ gulp
gulp.js - require mods.
var

gulp = require('gulp'),



rsync = require('rsyncwrapper').rsync,

minifyCSS = require('gulp-minify-css'),

uglify = require('gulp-uglify'),

concat = require('gulp-concat'),

rename = require('gulp-rename'),

imagemin = require('gulp-imagemin'),

sass = require('gulp-sass'),

notify = require('gulp-notify');
img optimize
gulp.task('optimize-imgs', [], function () {

return gulp.src(‘./assets/img/*.jpg’)

.pipe(imagemin({optimizationLevel: 5}))

.pipe(gulp.dest(‘./assets/img/compressed’))

.pipe(notify({message: 'Finished IMG compression'}));

});
js compression/uglyf.
gulp.task('js-compress', function () {

gulp.src(‘./assets/js/*.js’)

.pipe(uglify())

.pipe(gulp.dest(‘./assets/js/min’))

});
css compress/concat
gulp.task('css', function () {

gulp.src('assets/css/final/*.css')

.pipe(concat('style.css'))

.pipe(gulp.dest(‘./assets/css/min’))

.pipe(minifyCSS())

.pipe(rename('style.min.css'))

.pipe(gulp.dest(‘./assets/css/min’))

.pipe(notify({message: 'Finished minifying n combyning CSS'}));

});
js concatenation
gulp.task('js', function () {

gulp.src(‘./assets/js/*.js’)

.pipe(uglify())

.pipe(concat(‘all.min.js'))

.pipe(gulp.dest(‘./assets/js/min’))

.pipe(notify({message: 'Finished JS concatenation'}));

});
watch
gulp.task('watch', function () {

gulp.watch(‘./assets/js/**/*.js’, ['js-compress']);

gulp.watch(‘./assets/img/*’, ['optimize-imgs']);

gulp.watch(‘./assets/sass/**/*.scss’, ['sass']);

});

ssh commands
var gulpSSH = require('gulp-ssh')({

ignoreErrors: false,

sshConfig: {

host: '192.168.1.251',

port: 22,

username: 'devel1'

}

});
ssh commands
gulp.task('default', ['css', 'js', 'js-compress', 'optimize-imgs'], function () {


rsync({

src: './',

dest: 'devel1@192.168.1.251:/home/devel1/proj1/public_html/',

recursive: true,

args: ['--verbose'],

exclude: ['.idea', '.editorconfig', 'node_modules', '.git'],

compareMode: 'checksum',

onStdout: function (data) {

console.log(data.toString());

}

}, function (error, stdout, stderr, cmd) {



gulp.task('shell', function () {

return gulpSSH

.shell(["chown -R devel1:devel1 /home/devel1/proj1/public_html/*",
"find /home/devel1/proj1/public_html -type f -exec chmod 664 {} ;", "find /home/
devel1/proj1/public_html -type d -exec chmod 755 {} ;"], {filePath: 'shell.log'})

.pipe(gulp.dest('logs'))

.pipe(notify({message: 'SSH n CHMOD finished!'}));

});

});

});
http://greensock.com/jump-start-js#welcome
• Crazy fast (http://greensock.com/js/speed.html)
• Compatible
• Lightweight (7kb for TweenLite) & expandable
• No dependencies
• Advanced sequencing
<!--CDN link for the latest TweenMax-->
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/
TweenMax.min.js"></script>
http://codepen.io/marcoalexpinheiro/pen/epZJOy
http://codepen.io/allanpope/pen/gpepOz
https://ihatetomatoes.net/wp-content/uploads/2015/08/GreenSock-Cheatsheet-2.pdf

More Related Content

What's hot

LESS
LESSLESS
LESS
Joe Seifi
 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 Workshop
Shoshi Roberts
 
Compass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperCompass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS Developer
Wynn Netherland
 
HTML5 y CSS3
HTML5 y CSS3HTML5 y CSS3
HTML5 y CSS3
InterGraphicDESIGNS
 
Sass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IVSass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IVDirk Ginader
 
Class 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddleClass 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddleErin M. Kidwell
 
Css3 and gwt in perfect harmony
Css3 and gwt in perfect harmonyCss3 and gwt in perfect harmony
Css3 and gwt in perfect harmony
Arcbees
 
CSS3 meets GWT with GSS
CSS3 meets GWT with GSSCSS3 meets GWT with GSS
CSS3 meets GWT with GSS
jdramaix
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & Compass
Lucien Lee
 
This is a test
This is a testThis is a test
This is a test
cmailhotos4
 
Doing more with LESS
Doing more with LESSDoing more with LESS
Doing more with LESS
jsmith92
 
Class 4 handout two column layout w mobile web design
Class 4 handout two column layout w mobile web designClass 4 handout two column layout w mobile web design
Class 4 handout two column layout w mobile web designErin M. Kidwell
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
Mario Noble
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
Idan Gazit
 
The Near Future of CSS
The Near Future of CSSThe Near Future of CSS
The Near Future of CSS
Rachel Andrew
 
LESS is More
LESS is MoreLESS is More
LESS is Morejsmith92
 
Core CSS3
Core CSS3Core CSS3
Core CSS3
Rachel Andrew
 

What's hot (18)

LESS
LESSLESS
LESS
 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 Workshop
 
Compass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperCompass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS Developer
 
HTML5 y CSS3
HTML5 y CSS3HTML5 y CSS3
HTML5 y CSS3
 
Sass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IVSass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IV
 
Class 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddleClass 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddle
 
Theme 23
Theme 23Theme 23
Theme 23
 
Css3 and gwt in perfect harmony
Css3 and gwt in perfect harmonyCss3 and gwt in perfect harmony
Css3 and gwt in perfect harmony
 
CSS3 meets GWT with GSS
CSS3 meets GWT with GSSCSS3 meets GWT with GSS
CSS3 meets GWT with GSS
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & Compass
 
This is a test
This is a testThis is a test
This is a test
 
Doing more with LESS
Doing more with LESSDoing more with LESS
Doing more with LESS
 
Class 4 handout two column layout w mobile web design
Class 4 handout two column layout w mobile web designClass 4 handout two column layout w mobile web design
Class 4 handout two column layout w mobile web design
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
 
The Near Future of CSS
The Near Future of CSSThe Near Future of CSS
The Near Future of CSS
 
LESS is More
LESS is MoreLESS is More
LESS is More
 
Core CSS3
Core CSS3Core CSS3
Core CSS3
 

Similar to SASS, Compass, Gulp, Greensock

Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
emrox
 
Using Sass - Building on CSS
Using Sass - Building on CSSUsing Sass - Building on CSS
Using Sass - Building on CSS
Sayanee Basu
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)
Tahmina Khatoon
 
LESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageLESS : The dynamic stylesheet language
LESS : The dynamic stylesheet language
Katsunori Tanaka
 
SASS Preprocessor
SASS PreprocessorSASS Preprocessor
SASS Preprocessor
Webkul Software Pvt. Ltd.
 
Modularization css with sass
Modularization css with sassModularization css with sass
Modularization css with sass
Huiyi Yan
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Startededgincvg
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
Cubet Techno Labs
 
Dallas Drupal Days 2012 - Introduction to less sass-compass
Dallas Drupal Days 2012  - Introduction to less sass-compassDallas Drupal Days 2012  - Introduction to less sass-compass
Dallas Drupal Days 2012 - Introduction to less sass-compassChris Lee
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction SassZeeshan Ahmed
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors.
The University of Akron
 
Elegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassElegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassMediacurrent
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
Rob Davarnia
 
Raleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass PresentationRaleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass Presentation
Daniel Yuschick
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
Nick Cooley
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentation
JoeSeckelman
 
Learn Sass and Compass quick
Learn Sass and Compass quickLearn Sass and Compass quick
Learn Sass and Compass quick
Billy Shih
 
Understanding sass
Understanding sassUnderstanding sass
Understanding sass
Mario Hernandez
 

Similar to SASS, Compass, Gulp, Greensock (20)

Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 
CSS3
CSS3CSS3
CSS3
 
Using Sass - Building on CSS
Using Sass - Building on CSSUsing Sass - Building on CSS
Using Sass - Building on CSS
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)
 
LESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageLESS : The dynamic stylesheet language
LESS : The dynamic stylesheet language
 
SASS Preprocessor
SASS PreprocessorSASS Preprocessor
SASS Preprocessor
 
Modularization css with sass
Modularization css with sassModularization css with sass
Modularization css with sass
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Started
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
 
Dallas Drupal Days 2012 - Introduction to less sass-compass
Dallas Drupal Days 2012  - Introduction to less sass-compassDallas Drupal Days 2012  - Introduction to less sass-compass
Dallas Drupal Days 2012 - Introduction to less sass-compass
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction Sass
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors.
 
Elegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassElegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs Sass
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
Sass compass
Sass compassSass compass
Sass compass
 
Raleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass PresentationRaleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass Presentation
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentation
 
Learn Sass and Compass quick
Learn Sass and Compass quickLearn Sass and Compass quick
Learn Sass and Compass quick
 
Understanding sass
Understanding sassUnderstanding sass
Understanding sass
 

More from Marco Pinheiro

Dicas para criação rápida de projectos WEB
Dicas para criação rápida de projectos WEBDicas para criação rápida de projectos WEB
Dicas para criação rápida de projectos WEB
Marco Pinheiro
 
PHPMyadmin - Introdução
PHPMyadmin - IntroduçãoPHPMyadmin - Introdução
PHPMyadmin - IntroduçãoMarco Pinheiro
 
PHP - Queries a um SGBD MySQL
PHP - Queries a um SGBD MySQLPHP - Queries a um SGBD MySQL
PHP - Queries a um SGBD MySQLMarco Pinheiro
 
Linguagem PHP para principiantes
Linguagem PHP para principiantesLinguagem PHP para principiantes
Linguagem PHP para principiantesMarco Pinheiro
 
funcionamento da internet
funcionamento da internetfuncionamento da internet
funcionamento da internet
Marco Pinheiro
 
Projecto de tese | Doutoramento em Ciências da Comunicação (UBI 2011)
Projecto de tese | Doutoramento em Ciências da Comunicação (UBI 2011)Projecto de tese | Doutoramento em Ciências da Comunicação (UBI 2011)
Projecto de tese | Doutoramento em Ciências da Comunicação (UBI 2011)Marco Pinheiro
 
Conceitos de Imagem digital
Conceitos de Imagem digitalConceitos de Imagem digital
Conceitos de Imagem digitalMarco Pinheiro
 
Linguagem SQL (com MySQL)
Linguagem SQL (com MySQL)Linguagem SQL (com MySQL)
Linguagem SQL (com MySQL)
Marco Pinheiro
 
IPCOP - Firewalls para os comuns mortais
IPCOP - Firewalls para os comuns mortaisIPCOP - Firewalls para os comuns mortais
IPCOP - Firewalls para os comuns mortais
Marco Pinheiro
 

More from Marco Pinheiro (16)

Dicas para criação rápida de projectos WEB
Dicas para criação rápida de projectos WEBDicas para criação rápida de projectos WEB
Dicas para criação rápida de projectos WEB
 
curso de CSS
curso de CSScurso de CSS
curso de CSS
 
PHP e Mysql - INSERT
PHP e Mysql - INSERTPHP e Mysql - INSERT
PHP e Mysql - INSERT
 
PHP e Mysql - INSERT
PHP e Mysql - INSERTPHP e Mysql - INSERT
PHP e Mysql - INSERT
 
PHP e Mysql - UPDATE
PHP e Mysql - UPDATEPHP e Mysql - UPDATE
PHP e Mysql - UPDATE
 
PHP e Mysql - DELETE
PHP e Mysql - DELETEPHP e Mysql - DELETE
PHP e Mysql - DELETE
 
PHPMyadmin - Introdução
PHPMyadmin - IntroduçãoPHPMyadmin - Introdução
PHPMyadmin - Introdução
 
PHP e Mysql - SELECT
PHP e Mysql - SELECTPHP e Mysql - SELECT
PHP e Mysql - SELECT
 
PHP - Queries a um SGBD MySQL
PHP - Queries a um SGBD MySQLPHP - Queries a um SGBD MySQL
PHP - Queries a um SGBD MySQL
 
Linguagem PHP para principiantes
Linguagem PHP para principiantesLinguagem PHP para principiantes
Linguagem PHP para principiantes
 
Curso de XHTML
Curso de XHTMLCurso de XHTML
Curso de XHTML
 
funcionamento da internet
funcionamento da internetfuncionamento da internet
funcionamento da internet
 
Projecto de tese | Doutoramento em Ciências da Comunicação (UBI 2011)
Projecto de tese | Doutoramento em Ciências da Comunicação (UBI 2011)Projecto de tese | Doutoramento em Ciências da Comunicação (UBI 2011)
Projecto de tese | Doutoramento em Ciências da Comunicação (UBI 2011)
 
Conceitos de Imagem digital
Conceitos de Imagem digitalConceitos de Imagem digital
Conceitos de Imagem digital
 
Linguagem SQL (com MySQL)
Linguagem SQL (com MySQL)Linguagem SQL (com MySQL)
Linguagem SQL (com MySQL)
 
IPCOP - Firewalls para os comuns mortais
IPCOP - Firewalls para os comuns mortaisIPCOP - Firewalls para os comuns mortais
IPCOP - Firewalls para os comuns mortais
 

Recently uploaded

FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 

SASS, Compass, Gulp, Greensock

  • 2. o/ • Marco Pinheiro • geek | biker | open source envagelist • head of dev. • @marcopinheiro • marco.alex.pinheiro@gmail.com
  • 4. syntactically awesome style sheets aka: CSS with superpowers http://sass-lang.com/guide
  • 5. sass • CSS on its own can be fun, but stylesheets are getting larger, more complex, and harder to maintain. • This is where a preprocessor can help. Sass lets you use features that don't exist in CSS yet like variables, nesting, mixins, inheritance and other nifty goodies that make writing CSS fun again.
  • 6. sass • “SASS is the most mature, stable, and powerful CSS preprocessor in the world.” • Sass is open-source, and is actively developed by several tech companies and hundreds of developers wordwide at http://github.com/nex3/sass
  • 7. sass - install n compile • $ gem install sass • $ sass input.scss output.css or • $ sass --watch input.scss:output.css
  • 9. sass - quick test-drive http://codepen.io
  • 10. sass - some ingredients… • partials • variables • nesting • extending / inheritance • mixins • conditions
  • 11. sass - partials • use partials to organize (modularize) your code • the file names must start with underscore and you can suppress the extension @import 'shared/global'; @import ‘pages/home' (aka _home.scss) @import 'pages/blog';
  • 12. sass - variables - $ (_variables.scss) $portolinux-purple: “#669”; $sans-serif-font: 'ff-dagny-web-pro', 'Helvetica Neue', Arial, sans-serif; $serif-font: 'ff-tisa-web-pro', Georgia, Times, serif; they make code easier to change by reducing duplication but they also allow you to assign names to special property values like colors, which helps you understand the intent behind a given style.
  • 13. sass - DRY - nesting body.home .media-unit { border: 1px solid #ccc; background-color: #fff; } body.home .media-unit .right { border-left: 1px solid #ccc; } body.home .media-unit .right h1 { font-size: 24px; } body.home { .media-unit { border: 1px solid #ccc; background-color: #fff; .right { border-left: 1px solid #ccc; h1 { font-size: 24px; } } } } Nesting will help keep your code clean, logical, and well-organized, which should also make it easier to manage over time.
  • 14. sass - DRY - nesting @ .container { width: 940px; @media screen and (max-width: 940px) { width: auto; } } Sass allows you to nest media queries inside other rules, making it easier to see which styles are applied to a given object on your page: .container { width: 940px; } @media screen and (max-width: 940px) { .container { width: auto; } }
  • 15. sass - DRY - nesting & a { color: $portolinux-purple; &:visited { color: red; } &:hover { color: green; } &:active { color: blue; } } a{color: #669} a:visited{} a:hover{} a:active{} Use an ampersand & as a "shorthand" way to include a parent.
  • 16. sass - DRY - nesting & .stupid-long-selector-name { background: $color-background; &:hover { background: $color-hover; } } Use an ampersand & as a "shorthand" way to include a parent.
  • 17. sass - DRY - extend/inheritance .message { border: 1px solid #ccc; padding: 10px; color: #333; } .success { @extend .message; border-color: green; } .error { @extend .message; border-color: red; } Using @extend lets you share a set of CSS properties from one selector to another. .message, .success, .error { border: 1px solid #cccccc; padding: 10px; color: #333; } .success { border-color: green; } .error { border-color: red; }
  • 18. sass - mixins @mixin centerer { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } reusable sets of properties or rules that you include, or “mix,” into other rules. You define them using the @mixin keyword, and include them using the @include keyword. .parent { position: relative; } .holly-cented-block { @include centerer; }
  • 19. sass - mixins (with args.) @mixin rounded-corners ($radius) { -webkit-border-radius: $radius; -moz-border-radius: $radius; -ms-border-radius: $radius; border-radius: $radius; } .button { @include rounded-corners (5px); } @mixin opacity ($opacity) { opacity: $opacity; $opacity-ie: $opacity * 100; filter: alpha(opacity=$opacity-ie); // IE8 } .button { @include opacity (0.8); }
  • 20. sass - mixins (vendor) • http://paranoida.github.io/sass-mediaqueries/ • $ bower install sass-mediaqueries or • curl -O https://raw.githubusercontent.com/paranoida/sass- mediaqueries/master/_media-queries.scss @import "media-queries";
  • 21. @ screen(min-width, max-width, orientation) @ min-screen(width) @ max-screen(width) -- @ screen-height(min-height, max- height, orientation) @ min-screen-height(height) @ max-screen-height(height) -- @ hdpi(ratio) -- @ landscape @ portrait @ iphone3(orientation) @ iphone4(orientation) @ iphone5(orientation) @ iphone6(orientation) @ iphone6-plus(orientation) -- @ ipad(orientation) @ ipad-retina(orientation) -- @ hdtv(standard) sass - mixins (vendor)
  • 22. @include screen(320px, 640px) { ... } sass - mixins (vendor) @media screen and (min-width: 320px) and (max-width: 640px){ } .brand { background-image: url(logo.png); @include hdpi { background-image: url(logo_2x.png); } }
  • 23. Compass is an open-source CSS Authoring Framework. http://compass-style.org/
  • 24. compass (screen.scss) @import “compass” $ gem install compass $ compass create portolinuxproj $ compass watch
  • 25. compass - config.rb require 'compass/import-once/activate'
 # Require any additional compass plugins here.
 
 # Set this to the root of your project when deployed:
 http_path = "/"
 css_dir = "assets/css/final"
 sass_dir = "assets/sass"
 images_dir = "assets/img"
 javascripts_dir = "assets/js"
 fonts_dir = "assets/fonts"
 #output_style = (environment == :production) ? :compressed : :expanded
 output_style = :expanded 
 
 # To disable debugging comments that display the original location of your selectors. Uncomment:
 # line_comments = false
 color_output = false
 
 preferred_syntax = :scss

  • 26. compass - let’s rock! @import “compass/reset” @import "compass/css3" @include inline-block; @include transition(all 0.3s ease-in-out); @include text-shadow( 0 1px 1px rgba(#000,0.3) ); @include single-transition(color, 0.5s, ease-in); @include border-radius(4px, 4px); @include box-shadow(red 2px 2px 10px); @include opacity(0.1);
  • 27. @import “compass/reset” @import "compass/css3" @include sticky-footer(72px, "#layout", "#layout_footer", “#footer"); @include transform(rotate(-135deg) scale(2) skew(-10deg, -10deg)); compass - let’s rock!
  • 28. Gulp.js Automate and enhance your workflow http://gulpjs.com | http://gulpjs.com/plugins/
  • 29. gulp.js $ npm install --global gulp //gulpfile.js var gulp = require('gulp');
 
 gulp.task('default', function() {
 // place code for your default task here
 }); $ gulp
  • 30. gulp.js - require mods. var
 gulp = require('gulp'),
 
 rsync = require('rsyncwrapper').rsync,
 minifyCSS = require('gulp-minify-css'),
 uglify = require('gulp-uglify'),
 concat = require('gulp-concat'),
 rename = require('gulp-rename'),
 imagemin = require('gulp-imagemin'),
 sass = require('gulp-sass'),
 notify = require('gulp-notify');
  • 31. img optimize gulp.task('optimize-imgs', [], function () {
 return gulp.src(‘./assets/img/*.jpg’)
 .pipe(imagemin({optimizationLevel: 5}))
 .pipe(gulp.dest(‘./assets/img/compressed’))
 .pipe(notify({message: 'Finished IMG compression'}));
 });
  • 32. js compression/uglyf. gulp.task('js-compress', function () {
 gulp.src(‘./assets/js/*.js’)
 .pipe(uglify())
 .pipe(gulp.dest(‘./assets/js/min’))
 });
  • 33. css compress/concat gulp.task('css', function () {
 gulp.src('assets/css/final/*.css')
 .pipe(concat('style.css'))
 .pipe(gulp.dest(‘./assets/css/min’))
 .pipe(minifyCSS())
 .pipe(rename('style.min.css'))
 .pipe(gulp.dest(‘./assets/css/min’))
 .pipe(notify({message: 'Finished minifying n combyning CSS'}));
 });
  • 34. js concatenation gulp.task('js', function () {
 gulp.src(‘./assets/js/*.js’)
 .pipe(uglify())
 .pipe(concat(‘all.min.js'))
 .pipe(gulp.dest(‘./assets/js/min’))
 .pipe(notify({message: 'Finished JS concatenation'}));
 });
  • 35. watch gulp.task('watch', function () {
 gulp.watch(‘./assets/js/**/*.js’, ['js-compress']);
 gulp.watch(‘./assets/img/*’, ['optimize-imgs']);
 gulp.watch(‘./assets/sass/**/*.scss’, ['sass']);
 });

  • 36. ssh commands var gulpSSH = require('gulp-ssh')({
 ignoreErrors: false,
 sshConfig: {
 host: '192.168.1.251',
 port: 22,
 username: 'devel1'
 }
 });
  • 37. ssh commands gulp.task('default', ['css', 'js', 'js-compress', 'optimize-imgs'], function () { 
 rsync({
 src: './',
 dest: 'devel1@192.168.1.251:/home/devel1/proj1/public_html/',
 recursive: true,
 args: ['--verbose'],
 exclude: ['.idea', '.editorconfig', 'node_modules', '.git'],
 compareMode: 'checksum',
 onStdout: function (data) {
 console.log(data.toString());
 }
 }, function (error, stdout, stderr, cmd) {
 
 gulp.task('shell', function () {
 return gulpSSH
 .shell(["chown -R devel1:devel1 /home/devel1/proj1/public_html/*", "find /home/devel1/proj1/public_html -type f -exec chmod 664 {} ;", "find /home/ devel1/proj1/public_html -type d -exec chmod 755 {} ;"], {filePath: 'shell.log'})
 .pipe(gulp.dest('logs'))
 .pipe(notify({message: 'SSH n CHMOD finished!'}));
 });
 });
 });
  • 38.
  • 40. • Crazy fast (http://greensock.com/js/speed.html) • Compatible • Lightweight (7kb for TweenLite) & expandable • No dependencies • Advanced sequencing <!--CDN link for the latest TweenMax--> <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/ TweenMax.min.js"></script>