SlideShare una empresa de Scribd logo
1 de 26
Descargar para leer sin conexión
Pré-processadores {CSS}

por: Daniel Santos
Developer
Por que usar um
Pré-processador?
Pré-processadores
❏ Mixins
❏ Extend
❏ Variables
❏ Helpers
❏ Operations
❏ Media
❏ Functions
❏ Nesting
❏ Importing
❏ Conditions
❏ Color function
Qual pré-processador
usar?
Compilando Less
no tempo de execução
<link rel=”stylesheet/less” type=”text/css” href=”style.less” />

<script type=”text/javascript” src=”js/less-1.1.3.min.js”></script>
Compilando Less
para um arquivo .css
$ sudo apt-get install npm
$ sudo apt-get install node-less
$ npm install -g less
$ lessc style.less > style.css
EXEMPLO
Less
@import
Mixins
Parametric Mixins
Nested
@import url("http://fonts.googleapis.com/css?family=Joti+One");
.radius (@radius) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
-ms-border-radius: @radius;
-o-border-radius: @radius;
border-radius: @radius;
}
.texto{
text-align: center;
font-family: 'Joti One';
margin: 0;
font-weight: bold;
}
@import "mixin.less";
.body{
background: hardlight(#ff6600, #cccccc);
margin: 0 auto;
padding: 20px;
width: 960px;
height: 400px;
.radius(100px 60px 10px 75px);
}
h1{
.texto;
color: negation(#ff6600, #cccccc);
margin-bottom: 50px;
font-size: 40px;
}
p{
.texto;
color: difference(#ff6600, #0000ff);
font-size: 20px;
}
EXEMPLO
Sass
@import
$variables
@Extend
@import url("http://fonts.googleapis.com/css?family=Underdog")
$preto: #000
$azul: #0000ff
$rosa: #ff00cc
body
margin: 0
padding: 0
background: $preto
h1
color: $azul
font-family: 'Underdog'
font-weight: bold
text-align: center
font-size: 60px
p
@extend h1
font-size: 20px
font-weight: normal
color: $rosa
@import url("http://fonts.googleapis.com/css?family=Underdog");
body {
margin: 0;
padding: 0;
background: black; }
body h1, body p {
color: blue;
font-family: "Underdog";
font-weight: bold;
text-align: center;
font-size: 60px; }
body p {
font-size: 20px;
font-weight: normal;
color: #ff00cc; }
Algumas bibliotecas do
Saas?
EXEMPLO
Compass
@Import
Helpers
$Variables
Operations
@Mixin
@if, @else if, @else
@for
@import url("http://fonts.googleapis.com/css?family=Averia+Sans+Libre")
@import "compass/css3"
$black : #000
$white : #fff
$paragrafo : #a2c999 - 40
@mixin condicao($teste: true)
@if $teste == false
font-family: 'Averia Sans Libre'
font-size: 40px
color: $white
text-align: center
margin: 0 0 35px 0
@else if $teste == 1
font-size: 30px
color: $paragrafo
text-align: center
font-weight: normal
font-family: arial
margin: 0 0 35px 0
@else
font-size: 70px
color: #0000ff + $paragrafo
font-family: "Courier New"
margin: 0
@import mixin
.content
background: $black
+border-radius(25px 60px 0 40px)
width: 960px
height: 300px
margin: 0 auto
h1
+condicao(false)
p
+condicao(1)
.paragrafo
+condicao
@import url("http://fonts.googleapis.com/css?family=Averia+Sans+Libre");
.content {
background: black;
-webkit-border-radius: 25px 60px 0 40px;
-moz-border-radius: 25px 60px 0 40px;
-ms-border-radius: 25px 60px 0 40px;
-o-border-radius: 25px 60px 0 40px;
border-radius: 25px 60px 0 40px;
width: 960px;
height: 300px;
margin: 0 auto;
}
.content h1 {
font-family: "Averia Sans Libre";
font-size: 40px;
color: white;
text-align: center;
margin: 0 0 35px 0;
}
.content p {
font-size: 30px;
color: #7aa171;
text-align: center;
font-weight: normal;
font-family: arial;
margin: 0 0 35px 0;
}
.content .paragrafo {
font-size: 70px;
color: #7aa1ff;
font-family: "Courier New";
margin: 0;
}
@import url("http://fonts.googleapis.com/css?family=Averia+Sans+Libre")
@import "compass/css3"
$branco : #fff
$verde : #00ff00
$circulo: #0000ff - 80
$class: teste_for !default
@for $i from 1 through 2
.#{$class}_#{$i}
width: 100%
height: 40px
background: $circulo
margin-bottom: 40px
+border-radius(40px)
@import mixin
.content
background: $branco
+box-shadow($verde 6px 6px 40px)
width: 960px
height: 400px
margin: 0 auto
padding-top: 30px
@import url("http://fonts.googleapis.com/css?family=Averia+Sans+Libre");
.teste_for_1 {
width: 100%;
height: 40px;
background: #0000af;
margin-bottom: 40px;
-webkit-border-radius: 40px;
-moz-border-radius: 40px;
-ms-border-radius: 40px;
-o-border-radius: 40px;
border-radius: 40px;
}
.teste_for_2 {
width: 100%;
height: 40px;
background: #0000af;
margin-bottom: 40px;
-webkit-border-radius: 40px;
-moz-border-radius: 40px;
-ms-border-radius: 40px;
-o-border-radius: 40px;
border-radius: 40px;
}
.content {
background: white;
-webkit-box-shadow: green 6px 6px 40px;
-moz-box-shadow: green 6px 6px 40px;
box-shadow: green 6px 6px 40px;
width: 960px;
height: 400px;
margin: 0 auto;
padding-top: 30px;
}
@import url("http://fonts.googleapis.com/css?family=Averia+Sans+Libre");
.teste_for_1 {
width: 100%;
height: 40px;
background: #0000af;
margin-bottom: 40px;
-webkit-border-radius: 40px;
-moz-border-radius: 40px;
-ms-border-radius: 40px;
-o-border-radius: 40px;
border-radius: 40px;
}
.teste_for_2 {
width: 100%;
height: 40px;
background: #0000af;
margin-bottom: 40px;
-webkit-border-radius: 40px;
-moz-border-radius: 40px;
-ms-border-radius: 40px;
-o-border-radius: 40px;
border-radius: 40px;
}
.content {
background: white;
-webkit-box-shadow: green 6px 6px 40px;
-moz-box-shadow: green 6px 6px 40px;
box-shadow: green 6px 6px 40px;
width: 960px;
height: 400px;
margin: 0 auto;
padding-top: 30px;
}
OBRIGADO!!!
Daniel Santos
Developer

code@justdigital.com.br
+55(11)5181-5170
www.justdigital.com.br
http://blog.justdigital.com.br

Más contenido relacionado

Destacado

ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
Clément Wehrung
 

Destacado (20)

CSS preprocessors for designers (CSS-On-Diet)
CSS preprocessors for designers (CSS-On-Diet)CSS preprocessors for designers (CSS-On-Diet)
CSS preprocessors for designers (CSS-On-Diet)
 
Css Preprocessors
Css PreprocessorsCss Preprocessors
Css Preprocessors
 
An Empirical Study on the Use of CSS Preprocessors
An Empirical Study on the Use of CSS PreprocessorsAn Empirical Study on the Use of CSS Preprocessors
An Empirical Study on the Use of CSS Preprocessors
 
Priprep2 xml
Priprep2 xmlPriprep2 xml
Priprep2 xml
 
Migrating cascading style sheets to preprocessors
Migrating cascading style sheets to preprocessorsMigrating cascading style sheets to preprocessors
Migrating cascading style sheets to preprocessors
 
LESS vs. SASS
LESS vs. SASSLESS vs. SASS
LESS vs. SASS
 
Building SaaS Enabled Applications
Building SaaS Enabled ApplicationsBuilding SaaS Enabled Applications
Building SaaS Enabled Applications
 
Spoof text
Spoof  textSpoof  text
Spoof text
 
Sass Why for the CSS Guy
Sass Why for the CSS GuySass Why for the CSS Guy
Sass Why for the CSS Guy
 
Building the Media Block in ReactJS
Building the Media Block in ReactJS Building the Media Block in ReactJS
Building the Media Block in ReactJS
 
What is Object Oriented CSS?
What is Object Oriented CSS?What is Object Oriented CSS?
What is Object Oriented CSS?
 
LESS, the CSS Preprocessor
LESS, the CSS PreprocessorLESS, the CSS Preprocessor
LESS, the CSS Preprocessor
 
Using a CSS Framework
Using a CSS FrameworkUsing a CSS Framework
Using a CSS Framework
 
CSS Power Tools
CSS Power ToolsCSS Power Tools
CSS Power Tools
 
Efficient, maintainable CSS
Efficient, maintainable CSSEfficient, maintainable CSS
Efficient, maintainable CSS
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
Object Oriented CSS
Object Oriented CSSObject Oriented CSS
Object Oriented CSS
 
Getting Started with CSS
Getting Started with CSSGetting Started with CSS
Getting Started with CSS
 
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 

Similar a Palestra pré processadores CSS

Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid Prototyping
Even Wu
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書
拓樹 谷
 

Similar a Palestra pré processadores CSS (20)

Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 
Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid Prototyping
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors.
 
Sass compass
Sass compassSass compass
Sass compass
 
Responsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebResponsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da Web
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
Core CSS3
Core CSS3Core CSS3
Core CSS3
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書
 
CSS3
CSS3CSS3
CSS3
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
Haml and Sass Introduction
Haml and Sass IntroductionHaml and Sass Introduction
Haml and Sass Introduction
 
Fasten RWD Development with Sass
Fasten RWD Development with SassFasten RWD Development with Sass
Fasten RWD Development with Sass
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
Modularization css with sass
Modularization css with sassModularization css with sass
Modularization css with sass
 
Understanding sass
Understanding sassUnderstanding sass
Understanding sass
 
IE9에서 HTML5 개발하기
IE9에서 HTML5 개발하기IE9에서 HTML5 개발하기
IE9에서 HTML5 개발하기
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
 

Más de Just Digital

Apresentacao Google Search Appliance - Just Digital - Nov2013
Apresentacao Google Search Appliance - Just Digital - Nov2013Apresentacao Google Search Appliance - Just Digital - Nov2013
Apresentacao Google Search Appliance - Just Digital - Nov2013
Just Digital
 

Más de Just Digital (20)

ICAgile - Agile Professional Certification
ICAgile - Agile Professional CertificationICAgile - Agile Professional Certification
ICAgile - Agile Professional Certification
 
O futuro do conteúdo e do CMS
O futuro do conteúdo e do CMSO futuro do conteúdo e do CMS
O futuro do conteúdo e do CMS
 
A importância de contribuir para comunidades OpenSource - Drupal - Natura Dru...
A importância de contribuir para comunidades OpenSource - Drupal - Natura Dru...A importância de contribuir para comunidades OpenSource - Drupal - Natura Dru...
A importância de contribuir para comunidades OpenSource - Drupal - Natura Dru...
 
Palestra agile-brazil-2015-o-agile-e-o-executivo
Palestra agile-brazil-2015-o-agile-e-o-executivoPalestra agile-brazil-2015-o-agile-e-o-executivo
Palestra agile-brazil-2015-o-agile-e-o-executivo
 
Mapeando User Stories - User story mapping
Mapeando User Stories - User story mappingMapeando User Stories - User story mapping
Mapeando User Stories - User story mapping
 
Como manter uma empresa 100% ágil?
Como manter uma empresa 100% ágil?Como manter uma empresa 100% ágil?
Como manter uma empresa 100% ágil?
 
Liberte-se do seu cargo
Liberte-se do seu cargoLiberte-se do seu cargo
Liberte-se do seu cargo
 
Teoria dos jogos
Teoria dos jogosTeoria dos jogos
Teoria dos jogos
 
Comunidades de Prática
Comunidades de PráticaComunidades de Prática
Comunidades de Prática
 
Organização de times ágeis
Organização de times ágeisOrganização de times ágeis
Organização de times ágeis
 
Smacss e-css-faz-bem
Smacss e-css-faz-bemSmacss e-css-faz-bem
Smacss e-css-faz-bem
 
Os fantasmas do texto passado: Como perder o medo de escrever
Os fantasmas do texto passado: Como perder o medo de escreverOs fantasmas do texto passado: Como perder o medo de escrever
Os fantasmas do texto passado: Como perder o medo de escrever
 
Liderança: É preciso ter um (único) chefe?
Liderança: É preciso ter um (único) chefe?Liderança: É preciso ter um (único) chefe?
Liderança: É preciso ter um (único) chefe?
 
Agile Testing no Drupal
Agile Testing no DrupalAgile Testing no Drupal
Agile Testing no Drupal
 
Palestra Drupal - Campus Party 2014
Palestra Drupal - Campus Party 2014Palestra Drupal - Campus Party 2014
Palestra Drupal - Campus Party 2014
 
Palestra Drupal Picchu 2014
Palestra Drupal Picchu 2014Palestra Drupal Picchu 2014
Palestra Drupal Picchu 2014
 
Responsive ou Adaptive Design - Just Digital
Responsive ou Adaptive Design - Just DigitalResponsive ou Adaptive Design - Just Digital
Responsive ou Adaptive Design - Just Digital
 
Apresentacao Google Search Appliance - Just Digital - Nov2013
Apresentacao Google Search Appliance - Just Digital - Nov2013Apresentacao Google Search Appliance - Just Digital - Nov2013
Apresentacao Google Search Appliance - Just Digital - Nov2013
 
Nodejs justdigital
Nodejs justdigitalNodejs justdigital
Nodejs justdigital
 
AngularJS - Just Digital
AngularJS - Just DigitalAngularJS - Just Digital
AngularJS - Just Digital
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Palestra pré processadores CSS