SlideShare uma empresa Scribd logo
1 de 43
Baixar para ler offline
A BETTER CSS : SASS & LESS
By Frédéric Ghijselinck & Sam Vloeberghs
Competence Center Front-end & UX
A BETTER CSS : SASS & LESS
I. What's wrong with CSS?
II. Introducing Sass
III. Introducing LESS
IV. Hands-on
I) WHAT'S WRONG WITH CSS
Browser incompatibilities
No functions / logic
No variables
Uncustomizable frameworks
DRY ..
SASS;CSSWITHSUPERPOWERS
Sass
Sass is the most mature, stable, and powerful professional grade CSS
extension language in the world.
II) INTRODUCING SASS
CSS Compatible
Feature rich
Mature
Large community
Framework adaption
Examples explained using a Sass variant, Scss
MULTIPLE COMPILERS
Compass
Libsass
CSS EXTENSIONS
Variables
Nested rules & properties
Referencing parent selectors
Functions
Interpolation
Variable defaults
...
SASS: VARIABLES
$success-color: #43AC6A;
$warning-color: #f08a24;
$linkcolor: $warning-color;
$otherlinkcolor: $success-color;
SASS: NESTED RULES & PROPERTIES
h1{
margin-bottom:15px;
font: {
size: 1.4em;
weight: bold;
}
}
h2{
margin-bottom:15px;
font: {
size: 1.2em;
weight: bold;
}
}
SASS: REFERENCING PARENT SELECTORS
a{
color:$linkcolor;
text-decoration:none;
&:hover{
border-bottom: 1px solid $linkcolor;
}
}
SASS: FUNCTIONS
$p_color: $primary-color;
p{
content: 'This is a paragraph';
color: $p_color;
padding:10px;
border: 2px solid $p_color;
&.darker{
$d_color: darken($color: $p_color, $amount: 10%);
color: $d_color;
border-color: $d_color;
}
&.lighter{
$l_color: lighten($amount: 30%, $color: $p_color);
color: $l_color;
border-color: $l_color;
}
}
SASS: INTERPOLATION
$name: fancy;
$attr: font;
p.#{$name} {
#{$attr}-color: blue;
}
SASS: VARIABLE DEFAULTS
$content: "First content";
$content: "Second content?" !default;
$bis_content: "First bis content" !default;
p {
margin-bottom:10px;
&.primary:before {
content: $content;
}
&.secundary:before {
content: $bis_content;
}
}
@-RULES & DIRECTIVES
Importing & partials
Media queries
Extending / inheriting
Mixins & arguments
Control directives, logic & expressions
SASS: IMPORTING & PARTIALS
@import "reset";
@import "settings";
@import "utils";
@import "styles";
@import "foo.css";
@import "foo" screen;
@import "http://foo.com/bar";
@import url(foo);
SASS: MEDIA QUERIES
.vierkant{
height:150px; text-align:center;
color:#fff; font-weight:bold;
span{ display:none; }
@media #{$small-only} {
background: blue;
span.small{ display:inline; }
}
@media #{$medium-only} {
background:pink;
span.medium{ display:inline; }
}
@media #{$large-up} {
background:green;
span.large{ display:inline; }
}
@media #{$xlarge-up} {
color:red;
span.xlarge{ display:inline }
}
}
SASS: EXTENDING / INHERITING
.buttonanimation{
-o-transition:color .3s linear, background .4s linear;
-ms-transition:color .3s linear, background .4s linear;
-moz-transition:color .3s linear, background .4s linear;
-webkit-transition:color .3s linear, background .4s linear
transition:color .3s linear, background .4s linear;
}
button{
color:#fff;
background:#198fe6;
border:1px solid #fff;
padding:5px 20px;
text-transform:uppercase;
font-size:15px;
@extend .buttonanimation;
&:hover,
&:focus,
&:active{
background:#fff;
border:1px solid #198fe6;
color:#198fe6;
}
}
SASS: CONTROL DIRECTIVES, LOGIC & EXPRESSIONS (0)
@if
@for
@each
@while
SASS: CONTROL DIRECTIVES, LOGIC & EXPRESSIONS (1)
@each $type, $color in
(info, $info-color),
(success,$success-color),
(error, $error-color),
(warning, $warning-color) {
.box-#{$type} {
@extend .boxbasics;
// COULD BE AVOIDED: MORE CODE GENERATION
$bordercolor: darken($color, 10%);
@if($type == 'info') {
$bgcolor: $color;
}
@else{
$bgcolor: lighten($color, 30%);
}
color: $bordercolor;
@include background($imgpath: "../images/icons/#{$type}.png
@include border($size:2px, $color: $bordercolor, $bottom:tr
}
}
SASS: MIXINS & ARGUMENTS
@mixin border($size: 1px, $color: transparant,
$left: false, $bottom: false, $right:false, $top: false){
@if ($left) { border-left: $size solid $color; }
@if ($right) { border-right: $size solid $color; }
@if ($top) { border-top: $size solid $color; }
@if ($bottom) { border-bottom: $size solid $color; }
}
@mixin box-sizing($type:border-box) {
-webkit-box-sizing: $type; // Android < 2.3, iOS < 4
-moz-box-sizing: $type; // Firefox < 29
box-sizing: $type; // Chrome, IE 8+, Opera, Safari
}
FRAMEWORKS USING SASS
Zurb Foundation
Bootstrap
Bourbon
Gumby
.. your own?
II) INTRODUCING LESS
What is LESS?
LESS on the client
LESS on the server
importing
variables
functions
operations
mixins
nested rules
WHAT IS LESS?
Dynamic style sheet language
Compiles to CSS (client or server)
Introduces programming features to css (calculations)
Looks and feels like CSS (all CSS is valid LESS)
USING LESS ON THE CLIENT
<html>
<head>
<link rel="stylesheet/less" type="text/css" href="css/my.less"
<script src="js/less.js" type="text/javascript"></script>
</head>
</html>
USING LESS ON THE SERVER
Ability to cache it
Reducing the processing time on the client
Scale out the HTML
Server support for LESS
Node.js
ASP.NET
Rails
JSP
...
NODE.JS
$ npm install less
$ lessc styles.less
$ lessc styles.less > styles.css
var less = require('less');
less.render(lessContents,
function (e, css) {
console.log(css);
});
LESS BASICS
LESS is meant to feel like CSS but better
Ability to cache it
All CSS is valid... really
Renaming your .css to .less works
LESS adds to CSS
Mix of LESS and CSS is no problem, only LESS gets compiled to
CSS
LESS BASICS
@baseFontSize: 14px;
/* Comments */
// Comments too
#main
{
h1
{
font-size: @baseFontSize;
}
}
IMPORTING
@import works
Embeds other .less files in a file
Allows for simple modularization
While maintaining merging of CSS
If import is .css, it preserves the @import statement
If import is .less, it merges it into file
init.less
@import "init";
VARIABLES
@myColor: #ffeedd;
// They are Constants, this doesn’t work
@myColor: @myColor + 5%;
@a: Black; // Color
@b: 4px; // Units
@c: 1.0em; // Units
@d: Helvectica, sans serif; // Strings
@e: 1px #000 Solid 0 0; // Complex Type
OPERATIONS
font-size: 4px + 4; // 8px
font-size: 20px * .8; // 16px;
color: #FFF / 4; // #404040;
width: (100% / 2) + 25%; // 75%
COLOR FUNCTIONS
color: lighten(@color, 10%);
color: darken(@color, 10%);
color: saturate(@color, 10%);
color: desaturate (@color, 10%);
color: fadein(@color, 10%);
color: fadeout(@color, 10%);
color: fade(@color, 50%); // change transparency
color: spin(@color, 10%);
color: mix(@color, #246);
MORE FUNCTIONS
@hue: hue(@color);
@sat: saturation(@color);
@light: lightness(@color);
@alpha: alpha(@color);
@color: hsl(20%, 30%, 40%);
// Math
@rnd: round(3.14);
@top: ceil(3.14);
@bot: floor(3.14);
@per: percentage(.14);
MIXINS
Repeatable sections
Feel like functions
But insert more than one name/value pair
Can accept parameters, defaults and overloads
MIXINS
.rounded-corners-all(@size)
{
border-radius: @size;
-webkit-border-radius: @size;
-moz-border-radius: @size;
}
#form
{
.rounded-corners-all(5px);
}
MIXINS - DEFAULTS
// Default Values
.rounded-corners-all(@size: 5px)
{
border-radius: @size;
-webkit-border-radius: @size;
-moz-border-radius: @size;
}
#form
{
.rounded-corners-all;
}
MIXINS - OVERLOADS
// Using overloads
.color(@color)
{
color: @color;
}
.color(@color, @factor)
{
color: lighten(@color, @factor);
}
#form
{
.color(#888, 20%); // Uses 2nd overload
}
MIXINS - GUARDS
// Using guards
.color(@color) when (alpha(@color) >= 50%)
{
color: Black;
}
.color(@color) when (alpha(@color) < 50%)
{
color: transparent;
}
#form
{
.color(@mainColor); // Uses 1st overload
}
NESTED RULES
Allows you to structure rules in a logical way
Hierarchies imply the cascading/specificity
LESS then deconstructs it into CSS for you
NESTED RULES
// LESS Nested Rules
nav {
font-size: 14px;
font-weight: bold;
float: right;
ul {
// Makes “nav ul {...}”
list-style-type: none;
li {
// Makes “nav ul li {...}”
float: left;
margin: 2px;
}
}
}
NESTED RULES
// Use Combinator (&) to mix with parent:
a
{
text-decoration: none;
&:hover
{
text-decoration: underline;
}
}
// Results in
a { text-decoration: none; }
a:hover { text-decoration: underline; }
DOCUMENTATION ETC.
Sass Lang website
Sass Compatibility
Zurb Foundation
Official LESS website
Sass vs LESS
BEDANKT!
Frédéric Ghijselinck & Sam Vloeberghs
Competence Center Front-end & UX

Mais conteúdo relacionado

Destaque

Client Side Performance for Back End Developers - Camb Expert Talks, Nov 2016
Client Side Performance for Back End Developers - Camb Expert Talks, Nov 2016Client Side Performance for Back End Developers - Camb Expert Talks, Nov 2016
Client Side Performance for Back End Developers - Camb Expert Talks, Nov 2016Bart Read
 
Has Anyone Asked a Customer?
Has Anyone Asked a Customer?Has Anyone Asked a Customer?
Has Anyone Asked a Customer?Grgur Grisogono
 
Give Responsive Design a Mobile Performance Boost
Give Responsive Design a Mobile Performance BoostGive Responsive Design a Mobile Performance Boost
Give Responsive Design a Mobile Performance BoostGrgur Grisogono
 
What's Coming Next in Sencha Frameworks
What's Coming Next in Sencha FrameworksWhat's Coming Next in Sencha Frameworks
What's Coming Next in Sencha FrameworksGrgur Grisogono
 
Building Cordova plugins for iOS
Building Cordova plugins for iOSBuilding Cordova plugins for iOS
Building Cordova plugins for iOSGrgur Grisogono
 
Practices and obstacles in agile development
Practices and obstacles in agile developmentPractices and obstacles in agile development
Practices and obstacles in agile developmentGrgur Grisogono
 
High Performance Web Sites - 2008
High Performance Web Sites - 2008High Performance Web Sites - 2008
High Performance Web Sites - 2008Nate Koechley
 
Securing Client Side Data
 Securing Client Side Data Securing Client Side Data
Securing Client Side DataGrgur Grisogono
 
Exploring the Possibilities of Sencha and WebRTC
Exploring the Possibilities of Sencha and WebRTCExploring the Possibilities of Sencha and WebRTC
Exploring the Possibilities of Sencha and WebRTCGrgur Grisogono
 
AngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UXAngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UXJWORKS powered by Ordina
 
JavaScript Basics and Best Practices - CC FE & UX
JavaScript Basics and Best Practices - CC FE & UXJavaScript Basics and Best Practices - CC FE & UX
JavaScript Basics and Best Practices - CC FE & UXJWORKS powered by Ordina
 
Google’s PRPL Web development pattern
Google’s PRPL Web development patternGoogle’s PRPL Web development pattern
Google’s PRPL Web development patternJeongkyu Shin
 
Webpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ StepsWebpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ StepsGrgur Grisogono
 
PRPL Pattern with Webpack and React
PRPL Pattern with Webpack and ReactPRPL Pattern with Webpack and React
PRPL Pattern with Webpack and ReactGrgur Grisogono
 
Frustration-Free Packaging of Ext JS 5 Applications
Frustration-Free Packaging of Ext JS 5 ApplicationsFrustration-Free Packaging of Ext JS 5 Applications
Frustration-Free Packaging of Ext JS 5 ApplicationsGrgur Grisogono
 
Back to the Future with ES.next
Back to the Future with ES.nextBack to the Future with ES.next
Back to the Future with ES.nextGrgur Grisogono
 
Measuring Web Performance
Measuring Web Performance Measuring Web Performance
Measuring Web Performance Dave Olsen
 

Destaque (20)

Client Side Performance for Back End Developers - Camb Expert Talks, Nov 2016
Client Side Performance for Back End Developers - Camb Expert Talks, Nov 2016Client Side Performance for Back End Developers - Camb Expert Talks, Nov 2016
Client Side Performance for Back End Developers - Camb Expert Talks, Nov 2016
 
Sencha Cmd Quick Start
Sencha Cmd Quick StartSencha Cmd Quick Start
Sencha Cmd Quick Start
 
Sencha Space review
Sencha Space reviewSencha Space review
Sencha Space review
 
Has Anyone Asked a Customer?
Has Anyone Asked a Customer?Has Anyone Asked a Customer?
Has Anyone Asked a Customer?
 
Give Responsive Design a Mobile Performance Boost
Give Responsive Design a Mobile Performance BoostGive Responsive Design a Mobile Performance Boost
Give Responsive Design a Mobile Performance Boost
 
What's Coming Next in Sencha Frameworks
What's Coming Next in Sencha FrameworksWhat's Coming Next in Sencha Frameworks
What's Coming Next in Sencha Frameworks
 
Building Cordova plugins for iOS
Building Cordova plugins for iOSBuilding Cordova plugins for iOS
Building Cordova plugins for iOS
 
Practices and obstacles in agile development
Practices and obstacles in agile developmentPractices and obstacles in agile development
Practices and obstacles in agile development
 
High Performance Web Sites - 2008
High Performance Web Sites - 2008High Performance Web Sites - 2008
High Performance Web Sites - 2008
 
ModUX keynote
ModUX keynoteModUX keynote
ModUX keynote
 
Securing Client Side Data
 Securing Client Side Data Securing Client Side Data
Securing Client Side Data
 
Exploring the Possibilities of Sencha and WebRTC
Exploring the Possibilities of Sencha and WebRTCExploring the Possibilities of Sencha and WebRTC
Exploring the Possibilities of Sencha and WebRTC
 
AngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UXAngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UX
 
JavaScript Basics and Best Practices - CC FE & UX
JavaScript Basics and Best Practices - CC FE & UXJavaScript Basics and Best Practices - CC FE & UX
JavaScript Basics and Best Practices - CC FE & UX
 
Google’s PRPL Web development pattern
Google’s PRPL Web development patternGoogle’s PRPL Web development pattern
Google’s PRPL Web development pattern
 
Webpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ StepsWebpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ Steps
 
PRPL Pattern with Webpack and React
PRPL Pattern with Webpack and ReactPRPL Pattern with Webpack and React
PRPL Pattern with Webpack and React
 
Frustration-Free Packaging of Ext JS 5 Applications
Frustration-Free Packaging of Ext JS 5 ApplicationsFrustration-Free Packaging of Ext JS 5 Applications
Frustration-Free Packaging of Ext JS 5 Applications
 
Back to the Future with ES.next
Back to the Future with ES.nextBack to the Future with ES.next
Back to the Future with ES.next
 
Measuring Web Performance
Measuring Web Performance Measuring Web Performance
Measuring Web Performance
 

Semelhante a A better CSS: Sass and Less - CC FE & UX

Software programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesSoftware programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesDinu Suman
 
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsMobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsKaelig Deloumeau-Prigent
 
Finding your way with Sass+Compass
Finding your way with Sass+CompassFinding your way with Sass+Compass
Finding your way with Sass+Compassdrywallbmb
 
CSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsCSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsSanjoy Kr. Paul
 
Doing More With Less
Doing More With LessDoing More With Less
Doing More With LessDavid Engel
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with SassRob Friesel
 
@Agawish creating a stunning ui with oracle adf faces, using sass
@Agawish   creating a stunning ui with oracle adf faces, using sass@Agawish   creating a stunning ui with oracle adf faces, using sass
@Agawish creating a stunning ui with oracle adf faces, using sassAmr Gawish
 
Work and play with SASS & Compass
Work and play with SASS & CompassWork and play with SASS & Compass
Work and play with SASS & CompassAndreas Dantz
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction SassZeeshan Ahmed
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassLucien Lee
 
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"bentleyhoke
 
Sakai Meet MORPHEUS: Slides
Sakai Meet MORPHEUS: SlidesSakai Meet MORPHEUS: Slides
Sakai Meet MORPHEUS: Slidesalienresident
 
Finding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with CompassFinding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with CompassClaudina Sarahe
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentationMario Noble
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)emrox
 
LESS is More
LESS is MoreLESS is More
LESS is Morejsmith92
 

Semelhante a A better CSS: Sass and Less - CC FE & UX (20)

Software programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesSoftware programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS files
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
 
Theming and Sass
Theming and SassTheming and Sass
Theming and Sass
 
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsMobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
 
Finding your way with Sass+Compass
Finding your way with Sass+CompassFinding your way with Sass+Compass
Finding your way with Sass+Compass
 
CSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsCSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and Cons
 
Workshop 6: Designer tools
Workshop 6: Designer toolsWorkshop 6: Designer tools
Workshop 6: Designer tools
 
Doing More With Less
Doing More With LessDoing More With Less
Doing More With Less
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with Sass
 
@Agawish creating a stunning ui with oracle adf faces, using sass
@Agawish   creating a stunning ui with oracle adf faces, using sass@Agawish   creating a stunning ui with oracle adf faces, using sass
@Agawish creating a stunning ui with oracle adf faces, using sass
 
Work and play with SASS & Compass
Work and play with SASS & CompassWork and play with SASS & Compass
Work and play with SASS & Compass
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction Sass
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & Compass
 
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"
 
Sakai Meet MORPHEUS: Slides
Sakai Meet MORPHEUS: SlidesSakai Meet MORPHEUS: Slides
Sakai Meet MORPHEUS: Slides
 
Finding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with CompassFinding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with Compass
 
FCIP SASS Talk
FCIP SASS TalkFCIP SASS Talk
FCIP SASS Talk
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 
LESS is More
LESS is MoreLESS is More
LESS is More
 

Mais de JWORKS powered by Ordina

Introduction to Webpack - Ordina JWorks - CC JS & Web
Introduction to Webpack - Ordina JWorks - CC JS & WebIntroduction to Webpack - Ordina JWorks - CC JS & Web
Introduction to Webpack - Ordina JWorks - CC JS & WebJWORKS powered by Ordina
 
Netflix OSS and HATEOAS deployed on production - JavaLand
Netflix OSS and HATEOAS deployed on production - JavaLandNetflix OSS and HATEOAS deployed on production - JavaLand
Netflix OSS and HATEOAS deployed on production - JavaLandJWORKS powered by Ordina
 
Cc internet of things LoRa and IoT - Innovation Enablers
Cc internet of things   LoRa and IoT - Innovation Enablers Cc internet of things   LoRa and IoT - Innovation Enablers
Cc internet of things LoRa and IoT - Innovation Enablers JWORKS powered by Ordina
 
Big data document and graph d bs - couch-db and orientdb
Big data  document and graph d bs - couch-db and orientdbBig data  document and graph d bs - couch-db and orientdb
Big data document and graph d bs - couch-db and orientdbJWORKS powered by Ordina
 
Big data key-value and column stores redis - cassandra
Big data  key-value and column stores redis - cassandraBig data  key-value and column stores redis - cassandra
Big data key-value and column stores redis - cassandraJWORKS powered by Ordina
 
Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014JWORKS powered by Ordina
 

Mais de JWORKS powered by Ordina (20)

Introduction to Webpack - Ordina JWorks - CC JS & Web
Introduction to Webpack - Ordina JWorks - CC JS & WebIntroduction to Webpack - Ordina JWorks - CC JS & Web
Introduction to Webpack - Ordina JWorks - CC JS & Web
 
Lagom in Practice
Lagom in PracticeLagom in Practice
Lagom in Practice
 
Netflix OSS and HATEOAS deployed on production - JavaLand
Netflix OSS and HATEOAS deployed on production - JavaLandNetflix OSS and HATEOAS deployed on production - JavaLand
Netflix OSS and HATEOAS deployed on production - JavaLand
 
Cc internet of things @ Thomas More
Cc internet of things @ Thomas MoreCc internet of things @ Thomas More
Cc internet of things @ Thomas More
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
An introduction to Cloud Foundry
An introduction to Cloud FoundryAn introduction to Cloud Foundry
An introduction to Cloud Foundry
 
Cc internet of things LoRa and IoT - Innovation Enablers
Cc internet of things   LoRa and IoT - Innovation Enablers Cc internet of things   LoRa and IoT - Innovation Enablers
Cc internet of things LoRa and IoT - Innovation Enablers
 
Mongodb @ vrt
Mongodb @ vrtMongodb @ vrt
Mongodb @ vrt
 
Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
 
Big data document and graph d bs - couch-db and orientdb
Big data  document and graph d bs - couch-db and orientdbBig data  document and graph d bs - couch-db and orientdb
Big data document and graph d bs - couch-db and orientdb
 
Big data key-value and column stores redis - cassandra
Big data  key-value and column stores redis - cassandraBig data  key-value and column stores redis - cassandra
Big data key-value and column stores redis - cassandra
 
Hadoop bootcamp getting started
Hadoop bootcamp getting startedHadoop bootcamp getting started
Hadoop bootcamp getting started
 
Big data elasticsearch practical
Big data  elasticsearch practicalBig data  elasticsearch practical
Big data elasticsearch practical
 
Intro to cassandra
Intro to cassandraIntro to cassandra
Intro to cassandra
 
Android wear - CC Mobile
Android wear - CC MobileAndroid wear - CC Mobile
Android wear - CC Mobile
 
Clean Code - A&BP CC
Clean Code - A&BP CCClean Code - A&BP CC
Clean Code - A&BP CC
 
Unit testing - A&BP CC
Unit testing - A&BP CCUnit testing - A&BP CC
Unit testing - A&BP CC
 
Integration testing - A&BP CC
Integration testing - A&BP CCIntegration testing - A&BP CC
Integration testing - A&BP CC
 
Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014
 
Spring 4 - A&BP CC
Spring 4 - A&BP CCSpring 4 - A&BP CC
Spring 4 - A&BP CC
 

Último

Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftAanSulistiyo
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...SUHANI PANDEY
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdfMatthew Sinclair
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...roncy bisnoi
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubaikojalkojal131
 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...SUHANI PANDEY
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...SUHANI PANDEY
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...kajalverma014
 

Último (20)

Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 

A better CSS: Sass and Less - CC FE & UX

  • 1. A BETTER CSS : SASS & LESS By Frédéric Ghijselinck & Sam Vloeberghs Competence Center Front-end & UX
  • 2. A BETTER CSS : SASS & LESS I. What's wrong with CSS? II. Introducing Sass III. Introducing LESS IV. Hands-on
  • 3. I) WHAT'S WRONG WITH CSS Browser incompatibilities No functions / logic No variables Uncustomizable frameworks DRY ..
  • 4. SASS;CSSWITHSUPERPOWERS Sass Sass is the most mature, stable, and powerful professional grade CSS extension language in the world.
  • 5. II) INTRODUCING SASS CSS Compatible Feature rich Mature Large community Framework adaption Examples explained using a Sass variant, Scss
  • 7. CSS EXTENSIONS Variables Nested rules & properties Referencing parent selectors Functions Interpolation Variable defaults ...
  • 8. SASS: VARIABLES $success-color: #43AC6A; $warning-color: #f08a24; $linkcolor: $warning-color; $otherlinkcolor: $success-color;
  • 9. SASS: NESTED RULES & PROPERTIES h1{ margin-bottom:15px; font: { size: 1.4em; weight: bold; } } h2{ margin-bottom:15px; font: { size: 1.2em; weight: bold; } }
  • 10. SASS: REFERENCING PARENT SELECTORS a{ color:$linkcolor; text-decoration:none; &:hover{ border-bottom: 1px solid $linkcolor; } }
  • 11. SASS: FUNCTIONS $p_color: $primary-color; p{ content: 'This is a paragraph'; color: $p_color; padding:10px; border: 2px solid $p_color; &.darker{ $d_color: darken($color: $p_color, $amount: 10%); color: $d_color; border-color: $d_color; } &.lighter{ $l_color: lighten($amount: 30%, $color: $p_color); color: $l_color; border-color: $l_color; } }
  • 12. SASS: INTERPOLATION $name: fancy; $attr: font; p.#{$name} { #{$attr}-color: blue; }
  • 13. SASS: VARIABLE DEFAULTS $content: "First content"; $content: "Second content?" !default; $bis_content: "First bis content" !default; p { margin-bottom:10px; &.primary:before { content: $content; } &.secundary:before { content: $bis_content; } }
  • 14. @-RULES & DIRECTIVES Importing & partials Media queries Extending / inheriting Mixins & arguments Control directives, logic & expressions
  • 15. SASS: IMPORTING & PARTIALS @import "reset"; @import "settings"; @import "utils"; @import "styles"; @import "foo.css"; @import "foo" screen; @import "http://foo.com/bar"; @import url(foo);
  • 16. SASS: MEDIA QUERIES .vierkant{ height:150px; text-align:center; color:#fff; font-weight:bold; span{ display:none; } @media #{$small-only} { background: blue; span.small{ display:inline; } } @media #{$medium-only} { background:pink; span.medium{ display:inline; } } @media #{$large-up} { background:green; span.large{ display:inline; } } @media #{$xlarge-up} { color:red; span.xlarge{ display:inline } } }
  • 17. SASS: EXTENDING / INHERITING .buttonanimation{ -o-transition:color .3s linear, background .4s linear; -ms-transition:color .3s linear, background .4s linear; -moz-transition:color .3s linear, background .4s linear; -webkit-transition:color .3s linear, background .4s linear transition:color .3s linear, background .4s linear; } button{ color:#fff; background:#198fe6; border:1px solid #fff; padding:5px 20px; text-transform:uppercase; font-size:15px; @extend .buttonanimation; &:hover, &:focus, &:active{ background:#fff; border:1px solid #198fe6; color:#198fe6; } }
  • 18. SASS: CONTROL DIRECTIVES, LOGIC & EXPRESSIONS (0) @if @for @each @while
  • 19. SASS: CONTROL DIRECTIVES, LOGIC & EXPRESSIONS (1) @each $type, $color in (info, $info-color), (success,$success-color), (error, $error-color), (warning, $warning-color) { .box-#{$type} { @extend .boxbasics; // COULD BE AVOIDED: MORE CODE GENERATION $bordercolor: darken($color, 10%); @if($type == 'info') { $bgcolor: $color; } @else{ $bgcolor: lighten($color, 30%); } color: $bordercolor; @include background($imgpath: "../images/icons/#{$type}.png @include border($size:2px, $color: $bordercolor, $bottom:tr } }
  • 20. SASS: MIXINS & ARGUMENTS @mixin border($size: 1px, $color: transparant, $left: false, $bottom: false, $right:false, $top: false){ @if ($left) { border-left: $size solid $color; } @if ($right) { border-right: $size solid $color; } @if ($top) { border-top: $size solid $color; } @if ($bottom) { border-bottom: $size solid $color; } } @mixin box-sizing($type:border-box) { -webkit-box-sizing: $type; // Android < 2.3, iOS < 4 -moz-box-sizing: $type; // Firefox < 29 box-sizing: $type; // Chrome, IE 8+, Opera, Safari }
  • 21. FRAMEWORKS USING SASS Zurb Foundation Bootstrap Bourbon Gumby .. your own?
  • 22. II) INTRODUCING LESS What is LESS? LESS on the client LESS on the server importing variables functions operations mixins nested rules
  • 23. WHAT IS LESS? Dynamic style sheet language Compiles to CSS (client or server) Introduces programming features to css (calculations) Looks and feels like CSS (all CSS is valid LESS)
  • 24. USING LESS ON THE CLIENT <html> <head> <link rel="stylesheet/less" type="text/css" href="css/my.less" <script src="js/less.js" type="text/javascript"></script> </head> </html>
  • 25. USING LESS ON THE SERVER Ability to cache it Reducing the processing time on the client Scale out the HTML Server support for LESS Node.js ASP.NET Rails JSP ...
  • 26. NODE.JS $ npm install less $ lessc styles.less $ lessc styles.less > styles.css var less = require('less'); less.render(lessContents, function (e, css) { console.log(css); });
  • 27. LESS BASICS LESS is meant to feel like CSS but better Ability to cache it All CSS is valid... really Renaming your .css to .less works LESS adds to CSS Mix of LESS and CSS is no problem, only LESS gets compiled to CSS
  • 28. LESS BASICS @baseFontSize: 14px; /* Comments */ // Comments too #main { h1 { font-size: @baseFontSize; } }
  • 29. IMPORTING @import works Embeds other .less files in a file Allows for simple modularization While maintaining merging of CSS If import is .css, it preserves the @import statement If import is .less, it merges it into file init.less @import "init";
  • 30. VARIABLES @myColor: #ffeedd; // They are Constants, this doesn’t work @myColor: @myColor + 5%; @a: Black; // Color @b: 4px; // Units @c: 1.0em; // Units @d: Helvectica, sans serif; // Strings @e: 1px #000 Solid 0 0; // Complex Type
  • 31. OPERATIONS font-size: 4px + 4; // 8px font-size: 20px * .8; // 16px; color: #FFF / 4; // #404040; width: (100% / 2) + 25%; // 75%
  • 32. COLOR FUNCTIONS color: lighten(@color, 10%); color: darken(@color, 10%); color: saturate(@color, 10%); color: desaturate (@color, 10%); color: fadein(@color, 10%); color: fadeout(@color, 10%); color: fade(@color, 50%); // change transparency color: spin(@color, 10%); color: mix(@color, #246);
  • 33. MORE FUNCTIONS @hue: hue(@color); @sat: saturation(@color); @light: lightness(@color); @alpha: alpha(@color); @color: hsl(20%, 30%, 40%); // Math @rnd: round(3.14); @top: ceil(3.14); @bot: floor(3.14); @per: percentage(.14);
  • 34. MIXINS Repeatable sections Feel like functions But insert more than one name/value pair Can accept parameters, defaults and overloads
  • 36. MIXINS - DEFAULTS // Default Values .rounded-corners-all(@size: 5px) { border-radius: @size; -webkit-border-radius: @size; -moz-border-radius: @size; } #form { .rounded-corners-all; }
  • 37. MIXINS - OVERLOADS // Using overloads .color(@color) { color: @color; } .color(@color, @factor) { color: lighten(@color, @factor); } #form { .color(#888, 20%); // Uses 2nd overload }
  • 38. MIXINS - GUARDS // Using guards .color(@color) when (alpha(@color) >= 50%) { color: Black; } .color(@color) when (alpha(@color) < 50%) { color: transparent; } #form { .color(@mainColor); // Uses 1st overload }
  • 39. NESTED RULES Allows you to structure rules in a logical way Hierarchies imply the cascading/specificity LESS then deconstructs it into CSS for you
  • 40. NESTED RULES // LESS Nested Rules nav { font-size: 14px; font-weight: bold; float: right; ul { // Makes “nav ul {...}” list-style-type: none; li { // Makes “nav ul li {...}” float: left; margin: 2px; } } }
  • 41. NESTED RULES // Use Combinator (&) to mix with parent: a { text-decoration: none; &:hover { text-decoration: underline; } } // Results in a { text-decoration: none; } a:hover { text-decoration: underline; }
  • 42. DOCUMENTATION ETC. Sass Lang website Sass Compatibility Zurb Foundation Official LESS website Sass vs LESS
  • 43. BEDANKT! Frédéric Ghijselinck & Sam Vloeberghs Competence Center Front-end & UX