SlideShare a Scribd company logo
1 of 20
A PRACTICAL EXAMPLE
Company/Organization that has multiple platforms of media that all
should/would/could look the same but likely have different code Basis and
functions
1. This Organization likely has 3+ “custom” style sheets that work for its specific
HTML markup and function…Which creates a maintenance nightmare.
2. The styling is incredibly rigid or hardcoded colors, sizes, backgrounds, etc.
How can Sass Remedy This?
A PRACTICAL EXAMPLE
1. The Various Style sheets that have specific tooling for its various usages –
aggregate them into a series of components that can be lumped into a set of
files.
• Example: in all four of the Platforms this ORG uses there is a table with a blue
background but various different takes on the certain parts of that table and filters
associated.
• Get all those identified and what classes they maybe using(or IDs but less desireable) and
begin to craft a few basic mixins that define rules to certain elements.
• Once that is established use those as you define the various aspects individually as the
specific style sheets were doing previously.
• ***This is not the end goal this is the start of the process ~ the end goal is the markup be
the same and “.blue-box-table” would mean the same for all various platforms.
A PRACTICAL EXAMPLE
2. To address any rigidity found in the existing style sheets identify all the
potential variables that would identify all levels of customization that could be
attained.
• A personal example of this for me would be the ORG I was working for had 100+
sites that were using a global style sheet along with their personal custom style
sheet.
• To address this I merged all the custom aspects into the global and broke them into
separate component based files.
• I then Identified all the flex points that each custom style sheet seemed to be trying to
attain.
• Set those to default variables in a variables file but the actual SCSS file that was
created for each of those sites had the capacity to simply override that defaulted
value.
• ***In the end 80% of those variables I had set up were vetoed by this particular ORG
SASS
&
SCSS
SASS
• No brackets or
semicolons, based on
indentation
• Less characters to
type
• Enforced
conventions/neatnes
s
SCSS
• Semi-colon and bracket
syntax
• Superset of normal CSS
• Normal CSS is also valid
SCSS
• Newer and
recommended
SASS
&
SCSS
SASS
$txt-size: 12px
$txt-color: #333
$link-color: #999
#main
font-size: $txt-size
color: $txt-color
a
color: $link-color
SCSS
$txt-size: 12px;
$txt-color: #333;
$link-color: #999;
#main{
font-size: $txt-size;
color: $txt-color; a{
color: $link-color;
}
}
Two available syntaxes
• Both of the previous examples compile to:
#main{
font-size: 12px;
color: #333333;
}
#main a{
color: #999999;
}
• Already demonstrated basic variable usage and
nesting
• Note: Some examples compile using different
formatting, I changed them for the slides for
readability
SASS/SCSS HAVE THE SAME FUNCTIONALITY
SASS
&
SCSS
SCSS
#content{
font-size: 12px;
&, a{
color: #333;
}
}
Compiled CSS
#content{
font-size: 12px;
}
#content, #content a{
color: #333;
}
Additional Nesting Details
SCSS
.error{
color: red;
}
.seriousError{
@extend .error;
font-weight: bold;
}
Compiled CSS
.error, .seriousError{
color: red;
}
.seriousError{
font-weight: bold;
}
INHERITANCE FROM SELECTORS
SCSS
@mixin textBolded{
font-size: 24px;
font-weight: bold;
color: blue;
}
p{
@include textbolded;
}
Compiled CSS
p{
font-size: 24px;
font-weight: bold;
color: blue;
}
Mixins are sets of reusable styles, almost like methods in other
languages
MIXINS
SCSS
@mixin textBold($size){
font-size: $size;
font-weight: bold;
color: blue;
}
p{
@include textBold(24px);
}
li{
@include textBold(18px);
}
Compiled CSS
p{
font-size: 24px;
font-weight: bold;
color: blue;
}
li{
font-size: 18px;
font-weight: bold;
color: blue;
}
MIXINS WITH PARAMETERS
SCSS
@mixin image-replace($image-url){
&, & a{
display: block;
background: url($image-url) no-repeat;
}
a{
text-indent: -99999px;
text-decoration: none;
}
}
h1{
@include image-
replace(“images/header.gif”);
}
Compiled CSS
h1, h1 a{
display: block;
background:url(“images/header.gif”) no-repeat;
}
h1 a{
text-indent: -99999px;
text-decoration: none;
}
ADV. MIXIN EXAMPLE
SCSS
$page-width: 500px;
$sidebar-width: 100px;
$content-width: $page-width - $sidebar-width;
#main{
width: $page-width;
#sidebar{
width: $sidebar-width;
}
#content{
width: $content-width;
}
}
Compiled CSS
#main{
width: 500px;
}
#main #sidebar{
width: 100px;
}
#main #content{
width: 400px;
}
DOING MATH WITH SASS!
SCSS
$class-name: wrapper;
$attribute-name: font;
div.#{$class-name}{
#{$attribute-name}-size: 12px;
}
*This is Often done with Mixins to apply
Qualities to certain blocks dynamically
Compiled CSS
div.wrapper{
font-size: 12px;
}
INTERPOLATION
SCSS
IF >
$type: big;
p{
@if $type == big{
font-size: 24px;
}
}
if / else >
$type: small;
p{
@if $type == big {
font-size: 24px;
} @else if $type == medium{
font-size: 18px;
} @else { font-size: 16px; }
}
Compiled CSS
IF >
p{
font-size: 24px;
}
IF / ELSE >
p{
font-size: 16px;
}
CONTROL DIRECTIVES ~ IF / ELSE
SCSS
For Loop:
@for $i from 1 through 3 {
.item-#{$i} {
width: 10px * $i;
}
}
Each Loop:
@each $item in item1, item2{
.#{$item}{ width: 500px; }
}
While loop:
$i: 6;
@while $i > 0 {
.item-#{$i} { width: 10px * $i; }
$i: $i - 2;
}
Compiled CSS
For Loop:
.item-1{ width: 10px; }
.item-2{ width: 20px; }
.item-3{ width: 30px; }
Each Loop:
.item1{ width: 500px; }
.item2{ width: 500px; }
While loop:
.item-6{ width: 60px; }
.item-4{ width: 40px; }
.item-2{ width: 20px; }
CONTROL DIRECTIVES ~ FOR, EACH, WHILE
*This capacity is one if the greatest tool SASS offers In my opinion
SCSS
//Is a form of commenting
$primary_one : rgb(6,47,67);
$primary_two : rgb(0,172,216);
//Aim for a lighter color:
$primary_one_light:
lighten($primary_one,10%);
//Or
.lightPrimaryBlock {
background: lighten($primary_one,10%);
}
Compiled CSS
. lightPrimaryBlock{
background: #0a5072;
}
COLOR MANIPULATION
Cool easy to use playground: https://www.sassmeister.com/
COMPILING
• NodeJS – through various NPM packages
(Command Line)
• Compass (Command Line)
• Ruby Gems (Command Line)
• Software
• Prepros, and Many others.
RESOURCES
• https://sass-lang.com/guide
• https://www.sassmeister.com/ ~ SASS playground
• https://en.wikipedia.org/wiki/Sass_(stylesheet_lang
uage)
• https://prepros.io/ ~ compiling Software
LIVE CODING
• Mixins
• Extends
• If/else
• Oh my!
QUESTIONS
• Concerns
• ETC

More Related Content

What's hot

CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingJames Cryer
 
Drupal distributions - how to build them
Drupal distributions - how to build themDrupal distributions - how to build them
Drupal distributions - how to build themDick Olsson
 
SMACSS Your Sass Up
SMACSS Your Sass UpSMACSS Your Sass Up
SMACSS Your Sass UpMina Markham
 
Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASSJon Dean
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme SystemPeter Arato
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme developmentTammy Hart
 
Word press templates
Word press templatesWord press templates
Word press templatesDan Phiffer
 
Web topic 14 cascading style sheets
Web topic 14  cascading style sheetsWeb topic 14  cascading style sheets
Web topic 14 cascading style sheetsCK Yang
 
Introduction to XMLUI and Mirage Theming for DSpace 3
Introduction to XMLUI and Mirage Theming for DSpace 3Introduction to XMLUI and Mirage Theming for DSpace 3
Introduction to XMLUI and Mirage Theming for DSpace 3Bram Luyten
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFxStefan Bauer
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalChandra Prakash Thapa
 
W3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use todayW3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use todayadeveria
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structurekeithdevon
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreRuss Weakley
 

What's hot (20)

Drupal theming
Drupal themingDrupal theming
Drupal theming
 
CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y trying
 
Using Core Themes in Drupal 8
Using Core Themes in Drupal 8Using Core Themes in Drupal 8
Using Core Themes in Drupal 8
 
Drupal distributions - how to build them
Drupal distributions - how to build themDrupal distributions - how to build them
Drupal distributions - how to build them
 
SMACSS Your Sass Up
SMACSS Your Sass UpSMACSS Your Sass Up
SMACSS Your Sass Up
 
Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASS
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme System
 
Less vs sass
Less vs sassLess vs sass
Less vs sass
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
 
Word press templates
Word press templatesWord press templates
Word press templates
 
Web topic 14 cascading style sheets
Web topic 14  cascading style sheetsWeb topic 14  cascading style sheets
Web topic 14 cascading style sheets
 
Assetic (Zendcon)
Assetic (Zendcon)Assetic (Zendcon)
Assetic (Zendcon)
 
Assetic (OSCON)
Assetic (OSCON)Assetic (OSCON)
Assetic (OSCON)
 
Introduction to XMLUI and Mirage Theming for DSpace 3
Introduction to XMLUI and Mirage Theming for DSpace 3Introduction to XMLUI and Mirage Theming for DSpace 3
Introduction to XMLUI and Mirage Theming for DSpace 3
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFx
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
 
W3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use todayW3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use today
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structure
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and more
 
Efficient theming in Drupal
Efficient theming in DrupalEfficient theming in Drupal
Efficient theming in Drupal
 

Similar to Joes sass presentation

Syntactically Awesome Stylesheet - A workshop by Citytech Software
Syntactically Awesome Stylesheet - A workshop by Citytech SoftwareSyntactically Awesome Stylesheet - A workshop by Citytech Software
Syntactically Awesome Stylesheet - A workshop by Citytech SoftwareRitwik Das
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS ImplementationAmey Parab
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockMarco Pinheiro
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sassKnoldus Inc.
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compassNick Cooley
 
Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSSanjoy Kr. Paul
 
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqSass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqDignitasDigital1
 
LESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introductionLESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introductionrushi7567
 
Spectrum 2015 going online with style - an intro to css
Spectrum 2015   going online with style - an intro to cssSpectrum 2015   going online with style - an intro to css
Spectrum 2015 going online with style - an intro to cssNeil Perlin
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersSuzette Franck
 
Sass - basic to advance
Sass  - basic to advanceSass  - basic to advance
Sass - basic to advanceVinita Swamy
 
CSS pattern libraries
CSS pattern librariesCSS pattern libraries
CSS pattern librariesRuss Weakley
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassLucien Lee
 
Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan Stefan Bauer
 

Similar to Joes sass presentation (20)

Syntactically Awesome Stylesheet - A workshop by Citytech Software
Syntactically Awesome Stylesheet - A workshop by Citytech SoftwareSyntactically Awesome Stylesheet - A workshop by Citytech Software
Syntactically Awesome Stylesheet - A workshop by Citytech Software
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
CSS3
CSS3CSS3
CSS3
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sass
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
 
Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSS
 
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqSass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by Shafeeq
 
LESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introductionLESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introduction
 
Css
CssCss
Css
 
Spectrum 2015 going online with style - an intro to css
Spectrum 2015   going online with style - an intro to cssSpectrum 2015   going online with style - an intro to css
Spectrum 2015 going online with style - an intro to css
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
Sass - basic to advance
Sass  - basic to advanceSass  - basic to advance
Sass - basic to advance
 
Advanced sass
Advanced sassAdvanced sass
Advanced sass
 
[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX
 
CSS pattern libraries
CSS pattern librariesCSS pattern libraries
CSS pattern libraries
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & Compass
 
Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan
 

Recently uploaded

High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...kumargunjan9515
 
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...HyderabadDolls
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...gajnagarg
 
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Service
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts ServiceCall Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Service
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Servicenishakur201
 
Vastral Call Girls Book Now 7737669865 Top Class Escort Service Available
Vastral Call Girls Book Now 7737669865 Top Class Escort Service AvailableVastral Call Girls Book Now 7737669865 Top Class Escort Service Available
Vastral Call Girls Book Now 7737669865 Top Class Escort Service Availablegargpaaro
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...gajnagarg
 
💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...
💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...
💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...vershagrag
 
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...HyderabadDolls
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...HyderabadDolls
 
Oral Sex Call Girls Kashmiri Gate Delhi Just Call 👉👉 📞 8448380779 Top Class C...
Oral Sex Call Girls Kashmiri Gate Delhi Just Call 👉👉 📞 8448380779 Top Class C...Oral Sex Call Girls Kashmiri Gate Delhi Just Call 👉👉 📞 8448380779 Top Class C...
Oral Sex Call Girls Kashmiri Gate Delhi Just Call 👉👉 📞 8448380779 Top Class C...Delhi Call girls
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRajesh Mondal
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabiaahmedjiabur940
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...gajnagarg
 
Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...
Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...
Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...HyderabadDolls
 
Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?RemarkSemacio
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubaikojalkojal131
 
社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token PredictionNABLAS株式会社
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareGraham Ware
 

Recently uploaded (20)

High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
 
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Service
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts ServiceCall Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Service
Call Girls In GOA North Goa +91-8588052666 Direct Cash Escorts Service
 
Vastral Call Girls Book Now 7737669865 Top Class Escort Service Available
Vastral Call Girls Book Now 7737669865 Top Class Escort Service AvailableVastral Call Girls Book Now 7737669865 Top Class Escort Service Available
Vastral Call Girls Book Now 7737669865 Top Class Escort Service Available
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
 
💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...
💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...
💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...
 
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 
Oral Sex Call Girls Kashmiri Gate Delhi Just Call 👉👉 📞 8448380779 Top Class C...
Oral Sex Call Girls Kashmiri Gate Delhi Just Call 👉👉 📞 8448380779 Top Class C...Oral Sex Call Girls Kashmiri Gate Delhi Just Call 👉👉 📞 8448380779 Top Class C...
Oral Sex Call Girls Kashmiri Gate Delhi Just Call 👉👉 📞 8448380779 Top Class C...
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
 
Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...
Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...
Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...
 
Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 

Joes sass presentation

  • 1. A PRACTICAL EXAMPLE Company/Organization that has multiple platforms of media that all should/would/could look the same but likely have different code Basis and functions 1. This Organization likely has 3+ “custom” style sheets that work for its specific HTML markup and function…Which creates a maintenance nightmare. 2. The styling is incredibly rigid or hardcoded colors, sizes, backgrounds, etc. How can Sass Remedy This?
  • 2. A PRACTICAL EXAMPLE 1. The Various Style sheets that have specific tooling for its various usages – aggregate them into a series of components that can be lumped into a set of files. • Example: in all four of the Platforms this ORG uses there is a table with a blue background but various different takes on the certain parts of that table and filters associated. • Get all those identified and what classes they maybe using(or IDs but less desireable) and begin to craft a few basic mixins that define rules to certain elements. • Once that is established use those as you define the various aspects individually as the specific style sheets were doing previously. • ***This is not the end goal this is the start of the process ~ the end goal is the markup be the same and “.blue-box-table” would mean the same for all various platforms.
  • 3. A PRACTICAL EXAMPLE 2. To address any rigidity found in the existing style sheets identify all the potential variables that would identify all levels of customization that could be attained. • A personal example of this for me would be the ORG I was working for had 100+ sites that were using a global style sheet along with their personal custom style sheet. • To address this I merged all the custom aspects into the global and broke them into separate component based files. • I then Identified all the flex points that each custom style sheet seemed to be trying to attain. • Set those to default variables in a variables file but the actual SCSS file that was created for each of those sites had the capacity to simply override that defaulted value. • ***In the end 80% of those variables I had set up were vetoed by this particular ORG
  • 4. SASS & SCSS SASS • No brackets or semicolons, based on indentation • Less characters to type • Enforced conventions/neatnes s SCSS • Semi-colon and bracket syntax • Superset of normal CSS • Normal CSS is also valid SCSS • Newer and recommended
  • 5. SASS & SCSS SASS $txt-size: 12px $txt-color: #333 $link-color: #999 #main font-size: $txt-size color: $txt-color a color: $link-color SCSS $txt-size: 12px; $txt-color: #333; $link-color: #999; #main{ font-size: $txt-size; color: $txt-color; a{ color: $link-color; } } Two available syntaxes
  • 6. • Both of the previous examples compile to: #main{ font-size: 12px; color: #333333; } #main a{ color: #999999; } • Already demonstrated basic variable usage and nesting • Note: Some examples compile using different formatting, I changed them for the slides for readability SASS/SCSS HAVE THE SAME FUNCTIONALITY
  • 7. SASS & SCSS SCSS #content{ font-size: 12px; &, a{ color: #333; } } Compiled CSS #content{ font-size: 12px; } #content, #content a{ color: #333; } Additional Nesting Details
  • 8. SCSS .error{ color: red; } .seriousError{ @extend .error; font-weight: bold; } Compiled CSS .error, .seriousError{ color: red; } .seriousError{ font-weight: bold; } INHERITANCE FROM SELECTORS
  • 9. SCSS @mixin textBolded{ font-size: 24px; font-weight: bold; color: blue; } p{ @include textbolded; } Compiled CSS p{ font-size: 24px; font-weight: bold; color: blue; } Mixins are sets of reusable styles, almost like methods in other languages MIXINS
  • 10. SCSS @mixin textBold($size){ font-size: $size; font-weight: bold; color: blue; } p{ @include textBold(24px); } li{ @include textBold(18px); } Compiled CSS p{ font-size: 24px; font-weight: bold; color: blue; } li{ font-size: 18px; font-weight: bold; color: blue; } MIXINS WITH PARAMETERS
  • 11. SCSS @mixin image-replace($image-url){ &, & a{ display: block; background: url($image-url) no-repeat; } a{ text-indent: -99999px; text-decoration: none; } } h1{ @include image- replace(“images/header.gif”); } Compiled CSS h1, h1 a{ display: block; background:url(“images/header.gif”) no-repeat; } h1 a{ text-indent: -99999px; text-decoration: none; } ADV. MIXIN EXAMPLE
  • 12. SCSS $page-width: 500px; $sidebar-width: 100px; $content-width: $page-width - $sidebar-width; #main{ width: $page-width; #sidebar{ width: $sidebar-width; } #content{ width: $content-width; } } Compiled CSS #main{ width: 500px; } #main #sidebar{ width: 100px; } #main #content{ width: 400px; } DOING MATH WITH SASS!
  • 13. SCSS $class-name: wrapper; $attribute-name: font; div.#{$class-name}{ #{$attribute-name}-size: 12px; } *This is Often done with Mixins to apply Qualities to certain blocks dynamically Compiled CSS div.wrapper{ font-size: 12px; } INTERPOLATION
  • 14. SCSS IF > $type: big; p{ @if $type == big{ font-size: 24px; } } if / else > $type: small; p{ @if $type == big { font-size: 24px; } @else if $type == medium{ font-size: 18px; } @else { font-size: 16px; } } Compiled CSS IF > p{ font-size: 24px; } IF / ELSE > p{ font-size: 16px; } CONTROL DIRECTIVES ~ IF / ELSE
  • 15. SCSS For Loop: @for $i from 1 through 3 { .item-#{$i} { width: 10px * $i; } } Each Loop: @each $item in item1, item2{ .#{$item}{ width: 500px; } } While loop: $i: 6; @while $i > 0 { .item-#{$i} { width: 10px * $i; } $i: $i - 2; } Compiled CSS For Loop: .item-1{ width: 10px; } .item-2{ width: 20px; } .item-3{ width: 30px; } Each Loop: .item1{ width: 500px; } .item2{ width: 500px; } While loop: .item-6{ width: 60px; } .item-4{ width: 40px; } .item-2{ width: 20px; } CONTROL DIRECTIVES ~ FOR, EACH, WHILE *This capacity is one if the greatest tool SASS offers In my opinion
  • 16. SCSS //Is a form of commenting $primary_one : rgb(6,47,67); $primary_two : rgb(0,172,216); //Aim for a lighter color: $primary_one_light: lighten($primary_one,10%); //Or .lightPrimaryBlock { background: lighten($primary_one,10%); } Compiled CSS . lightPrimaryBlock{ background: #0a5072; } COLOR MANIPULATION Cool easy to use playground: https://www.sassmeister.com/
  • 17. COMPILING • NodeJS – through various NPM packages (Command Line) • Compass (Command Line) • Ruby Gems (Command Line) • Software • Prepros, and Many others.
  • 18. RESOURCES • https://sass-lang.com/guide • https://www.sassmeister.com/ ~ SASS playground • https://en.wikipedia.org/wiki/Sass_(stylesheet_lang uage) • https://prepros.io/ ~ compiling Software
  • 19. LIVE CODING • Mixins • Extends • If/else • Oh my!

Editor's Notes

  1. QuickStarter has created an outline to help you get started on your presentation. Some slides include information here in the notes to provide additional topics for you to research. Summary: In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form or representation, sometimes shortened or secret, for communication through a communication channel or storage in a storage medium. An early example is the invention of language which enabled a person, through speech, to communicate what he or she saw, heard, felt, or thought to others. But speech limits the range of communication to the distance a voice can carry, and limits the audience to those present when the speech is uttered. The invention of writing, which converted spoken language into visual symbols, extended the range of communication across space and time.