SlideShare uma empresa Scribd logo
1 de 28
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!
CSS Preprocessors to the Rescue!

Mais conteúdo relacionado

Mais de SmartLogic

How SmartLogic Uses Chef-Dan Ivovich
How SmartLogic Uses Chef-Dan IvovichHow SmartLogic Uses Chef-Dan Ivovich
How SmartLogic Uses Chef-Dan Ivovich
SmartLogic
 
A Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rbA Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rb
SmartLogic
 

Mais de SmartLogic (20)

DC |> Elixir Meetup - Going off the Rails into Elixir - Dan Ivovich
DC |> Elixir Meetup - Going off the Rails into Elixir - Dan IvovichDC |> Elixir Meetup - Going off the Rails into Elixir - Dan Ivovich
DC |> Elixir Meetup - Going off the Rails into Elixir - Dan Ivovich
 
Monitoring Your Elixir Application with Prometheus
Monitoring Your Elixir Application with PrometheusMonitoring Your Elixir Application with Prometheus
Monitoring Your Elixir Application with Prometheus
 
Going Multi-Node
Going Multi-NodeGoing Multi-Node
Going Multi-Node
 
Kubernetes and docker
Kubernetes and dockerKubernetes and docker
Kubernetes and docker
 
Serializing Value Objects-Ara Hacopian
Serializing Value Objects-Ara HacopianSerializing Value Objects-Ara Hacopian
Serializing Value Objects-Ara Hacopian
 
Guide to food foraging by SmartLogic's Kei Ellerbrock
Guide to food foraging by SmartLogic's Kei EllerbrockGuide to food foraging by SmartLogic's Kei Ellerbrock
Guide to food foraging by SmartLogic's Kei Ellerbrock
 
Introduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogicIntroduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogic
 
How SmartLogic Uses Chef-Dan Ivovich
How SmartLogic Uses Chef-Dan IvovichHow SmartLogic Uses Chef-Dan Ivovich
How SmartLogic Uses Chef-Dan Ivovich
 
A Few Interesting Things in Apple's Swift Programming Language
A Few Interesting Things in Apple's Swift Programming LanguageA Few Interesting Things in Apple's Swift Programming Language
A Few Interesting Things in Apple's Swift Programming Language
 
Effective ActiveRecord
Effective ActiveRecordEffective ActiveRecord
Effective ActiveRecord
 
An Introduction to Reactive Cocoa
An Introduction to Reactive CocoaAn Introduction to Reactive Cocoa
An Introduction to Reactive Cocoa
 
iOS Development Methodology
iOS Development MethodologyiOS Development Methodology
iOS Development Methodology
 
Deploying Rails Apps with Chef and Capistrano
 Deploying Rails Apps with Chef and Capistrano Deploying Rails Apps with Chef and Capistrano
Deploying Rails Apps with Chef and Capistrano
 
From Slacker to Hacker, Practical Tips for Learning to Code
From Slacker to Hacker, Practical Tips for Learning to CodeFrom Slacker to Hacker, Practical Tips for Learning to Code
From Slacker to Hacker, Practical Tips for Learning to Code
 
The Language of Abstraction in Software Development
The Language of Abstraction in Software DevelopmentThe Language of Abstraction in Software Development
The Language of Abstraction in Software Development
 
Android Testing: An Overview
Android Testing: An OverviewAndroid Testing: An Overview
Android Testing: An Overview
 
Intro to DTCoreText: Moving Past UIWebView | iOS Development
Intro to DTCoreText: Moving Past UIWebView | iOS DevelopmentIntro to DTCoreText: Moving Past UIWebView | iOS Development
Intro to DTCoreText: Moving Past UIWebView | iOS Development
 
Logstash: Get to know your logs
Logstash: Get to know your logsLogstash: Get to know your logs
Logstash: Get to know your logs
 
Intro to Accounting with QuickBooks for Startups, Software Development Compan...
Intro to Accounting with QuickBooks for Startups, Software Development Compan...Intro to Accounting with QuickBooks for Startups, Software Development Compan...
Intro to Accounting with QuickBooks for Startups, Software Development Compan...
 
A Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rbA Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rb
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Notas do Editor

  1. ◦ Hello my name is Ryan DeStefano, I am a designer at SmartLogic.  We build web and mobile apps here in Baltimore. ◦ today I am going to talk about CSS preprocessors and how they can help you write better style sheets.
  2. ▪ write style sheets that are less frustrating ▪ don ’t repeat yourself ▪ write less code, more importantly write smarter code
  3. • inability to nest code - requires writing lengthy selectors takes too much time - don ’t waste your time catering to CSS’s inefficiencies makes navigating CSS files cumbersome
  4. inability to reuse code - this is the big one ◦ hinders maintainability - if you want to change something, such as a color, or a font size, or a width, you have to make sure you change it everywhere it is used
  5. ▪ when you are forced to repeat yourself you are writing less maintainable code. ◦ writing CSS requires you to repeat yourself quite a bit. ▪ it would be really nice if I could write less CSS myself and make the computer write the rest for me. • inability to reuse code - this is the big one ◦ hinders maintainability - if you want to change something, such as a color, or a font size, or a width, you have to make sure you change it everywhere it is used ◦ takes too much time - don ’t waste your time catering to CSS’s inefficiencies ▪ maybe I ’m not sure if I really want to make a change or not - CSS requires a lot of work just to see what something would look like.
  6. ◦ Browsers only understand CSS, so you are forced to communicate in CSS. Unless you use a translator - a processor that converts what you write into CSS. Preprocessor translates whatever you write into CSS so that the browser can understand it.   ◦ Preprocessed languages, such as Sass, compile to normal CSS.  You can write in any format you like, as long as the preprocessor understands what you are writing and can compile it to CSS. Everything you write is converted to plain CSS.
  7. what preprocessors are available? ▪ several, Sass and LESS are most popular, there are others such as stylus ▪ I will be using Sass in this presentation, in particular the form of Sass known as SCSS.  I ’ve selected this because it’s the most similar to plain CSS.  It is also the one I use. ▪ The syntax of each preprocessor varies.  Some are move removed from CSS, such as Stylus which does not use braces, colons, or semicolons.  There is an alternate form of Sass which also relies on significant whitespace. The most popular preprocessed languages have syntaxes that are similar to CSS.  This allows people who know CSS to learn the preprocessed language relatively easily.  In Sass, for example, all valid CSS is also valid Sass. ◦ Being freed from the constraint of only writing code that the browser understands allows for additions to CSS.  For example, CSS does not handle variables - but you can use variables in a preprocessed language, because the preprocessor understands how to compile the SCSS to CSS.
  8. Parent reference
  9. same for pseudo-selectors
  10. ◦ variables ▪ most simple way to reuse code ▪ perfect for colors, font sizes, width, heights, etc.. - anything that can be reused or changed
  11. Using variables in this way can allow you to have a lot of control over the way a site looks.  You can build an admin-panel of sorts that controls colors, sizes, etc.. all from one place.  This can be can be a dedicated .scss file that is then imported into all other .scss files in a project.
  12. ▪ Same thing with mixins - consistency throughout your site.  If you change something, you should be changing all instance of that thing.  The ‘admin panel’ makes this super easy.
  13. arguments / parameters
  14. Operations also allow for increased consistency.  For example, setting a base font-size and making larger and smaller sizes as percentages of the base.  Use variables to describe these.
  15. ◦ Using variables and mixins is not only a matter of convenience/laziness.  It is also less error-prone.  For example, a site may use a particular shade of blue throughout.  If I decide that the blue is too light, it could be difficult and tedious for me to switch to a darker shade.  The color may be used across several CSS files, so not only would it take me a bit of time to update every instance of the color blue, but it ’s also possible that I could miss one.  Defining the color with a variable allows me to use a darker shade of blue by changing only one line of code.  This is way faster and I know that I’m not going to be accidentally missing and instance of the colors I want to change. ◦ What else can preprocessors do?
  16. ◦ When can we expect CSS to evolve? - don ’t get your hopes up. ▪ no plans in the near future - Improvements to CSS do not happen frequently.  CSS is progressing more slowly that would be preferable to web developers and designers.  Preprocessors help fill in where CSS is lacking. ▪ even if CSS spec does catch up, when will the browsers implement these changes? ▪ IE won ’t be quick and users will still be using older versions on IE. ◦ We need improvements now!
  17. ◦ they are for anyone who has a good understanding of CSS ◦ They are great for designers who already know CSS, because they follow the same syntax as CSS, so you don ’t have to worry about learning a completely different language.  All CSS is valid Sass, so you can use as much or as little of the additional features. ◦ Preprocessors are great for developers because they introduce concepts such as variables and operations, which you already know, and make CSS seem more like a true programming language. ◦ who are they not for? ▪ They are not for people who don ’t already know CSS.  You should learn CSS first so that you can know if the compiled CSS is any good. ▪ You would need to know CSS so that you can troubleshoot any issues you may run into, such as viewing the outputted CSS in the inspector. ▪ Preprocessors are not a shortcut or an excuse not to learn CSS.