SlideShare a Scribd company logo
Make your CSS
beautiful again
  {   Refactoring without incurring a testing overhead
gtkMain.css
                           atoz.css
                            brightcove.css

               pluck.css                            galleryCarousel.css
  atoz.css
                              galleryCarousel.css
gtkMain.css
                              galleryCarousel.css
                                                pluck.css
                                          brightcove.css


      Goodtoknow has more than 36
      stylesheets.
Each page uses approx. 10 of those stylesheets at a
combined weight of around 280k

The average page only uses 50% of the CSS served

At an average of 1500 CSS rules per page, around 300
are inefficient and 150 are very inefficient.

The average page speed score is 82/100
{   Its time to make our CSS beautiful again*
*without exhausting our test analysts
You need Cactus!
      https://github.com/winston/cactus
CSS tests are simply a baseline representation of your
style guide.

<shame>Don’t have one? Neither did we!</shame>

By writing CSS tests you can refactor with confidence,
whilst building & reinforce your style guide
+   =
 Link to jQuery
 Add the cactus.js file

 Write some tests
Cactus.expect(".header", "font-size").toEqual("24px");
Cactus.expect(".header", "font-family").toContain("Helvetica");
Cactus.expect(".header", "color").toEqual("#ff0000");
Cactus.expect(".header").toHaveMargin("10px");
Cactus.expect(".header").toHaveBorderWidth("1px");
Cactus.expect(".header").toHaveBorderColor("#ff000");
Cactus.expect(".header“, “float”).toContain(“left");
This page needs a
screengrab of our yml file
<p class=“heading”>
<h3 class=“smaller”>
<h2 class=“bigger”>
YOU CANNOT BE SERIOUS!
Why use cactus?
 Refactor with confidence
 Ensures code quality

 Reduce testing overhead

 Build a style guide

 Promotes semantic markup

 Reduce CSS file size

 Reduce page load times

 And it can even be automated (but we’re not doing this just yet!)
More?
Syntactically Awesome Stylesheets

http://sass-lang.com/
“Sass is an extension of CSS3
which adds nested
rules, variables, mixins, selector
inheritance, and more. Sass
generates well formatted CSS and
makes your stylesheets easier to
organize and maintain.”
 gem install sass
 mv style.css style.scss

 sass --watch web/sass-folder:web/css-folder



   now write some Sassy CSS…
SCSS

          CSS




Nesting
This is the CSS generated by Sass for our nested SCSS

4 out of the 5 rules are inefficient
:(                                  :)




Nesting without creating inefficient selectors
Sass allows you to declare variables that
can be used throughout your stylesheet.
Variables begin with $ and are declared just
like properties. They can have any value
that’s allowed for a CSS property, such as
colors, numbers (with units), or text.




          Variables
Selector inheritance
Operations, Functions &
Interpolation
http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html
Mixins




.pagination .next,
.pagination .previous {
      @include button;
}
example:
   450
   400
   350
   300
   250                              Tabbed box css
   200                              Channel css
   150                              Total rules
   100
    50
     0
         CSS old   SASS   CSS new
Reasons to be cautious                       :


 Nesting can create inefficient selectors
 Generated CSS file can be slightly more inflated if

  used carelessly
 Be cautious that you’re not duplicating variables and

  mixins
Reasons you love Sass:
 Build and easily maintain a style guide
 SCSS file is more concise

 Variables and mixins prevent careless errors

 Stacks of great functions available

 Error handling for poor code

 Easier to maintain

 Use the math functions for responsive builds

 Now your CSS is beautiful again!
footnotes
Make your CSS beautiful again

More Related Content

What's hot

Web topic 14 cascading style sheets
Web topic 14  cascading style sheetsWeb topic 14  cascading style sheets
Web topic 14 cascading style sheets
CK Yang
 
HTML Tour - Buenas prácticas en el desarrollo web
HTML Tour - Buenas prácticas en el desarrollo webHTML Tour - Buenas prácticas en el desarrollo web
HTML Tour - Buenas prácticas en el desarrollo web
Plain Concepts
 
Web
WebWeb
Efficient theming in Drupal
Efficient theming in DrupalEfficient theming in Drupal
Efficient theming in Drupal
Cedric Spillebeen
 
Working with SASS/Compass and Zurb Foundation
Working with SASS/Compass and Zurb FoundationWorking with SASS/Compass and Zurb Foundation
Working with SASS/Compass and Zurb Foundation
Clint Robinson
 
.Less - CSS done right
.Less - CSS done right.Less - CSS done right
.Less - CSS done right
Daniel Hölbling
 
Biological Modelling, Powered by AngularJS
Biological Modelling, Powered by AngularJSBiological Modelling, Powered by AngularJS
Biological Modelling, Powered by AngularJS
Gil Fink
 
Object oriented css graeme blackwood
Object oriented css graeme blackwoodObject oriented css graeme blackwood
Object oriented css graeme blackwood
drupalconf
 
快速开发Css
快速开发Css快速开发Css
快速开发Css
tbmallf2e
 
Standards and guides in web design
Standards and guides in web designStandards and guides in web design
Standards and guides in web design
shaundickie
 
Welcome to css!
Welcome to css!Welcome to css!
Welcome to css!
sidneyodingo
 
CSS For Backend Developers
CSS For Backend DevelopersCSS For Backend Developers
CSS For Backend Developers
10Clouds
 
The Dark Arts of CSS
The Dark Arts of CSSThe Dark Arts of CSS
The Dark Arts of CSS
SiddharthBorderwala
 
Object Oriented CSS for rapid, scalable and maintainable development
Object Oriented CSS for rapid, scalable and maintainable developmentObject Oriented CSS for rapid, scalable and maintainable development
Object Oriented CSS for rapid, scalable and maintainable development
Graeme Blackwood
 
JavaScripters Event on Sep 10, 2016 · 10:30 AM: Sass
JavaScripters Event on Sep 10, 2016 · 10:30 AM: SassJavaScripters Event on Sep 10, 2016 · 10:30 AM: Sass
JavaScripters Event on Sep 10, 2016 · 10:30 AM: Sass
JavaScripters Community
 
Getting Sassy with CSS
Getting Sassy with CSSGetting Sassy with CSS
Getting Sassy with CSS
Julie Cameron
 
Css home
Css   homeCss   home
Beautifying senc
Beautifying sencBeautifying senc
Beautifying senc
Rachana Upadhyay
 
018 CSS, BEM, SASS e boas práticas
018 CSS, BEM, SASS e boas práticas018 CSS, BEM, SASS e boas práticas
018 CSS, BEM, SASS e boas práticas
Adewale Andrade
 

What's hot (20)

Web topic 14 cascading style sheets
Web topic 14  cascading style sheetsWeb topic 14  cascading style sheets
Web topic 14 cascading style sheets
 
HTML Tour - Buenas prácticas en el desarrollo web
HTML Tour - Buenas prácticas en el desarrollo webHTML Tour - Buenas prácticas en el desarrollo web
HTML Tour - Buenas prácticas en el desarrollo web
 
Web
WebWeb
Web
 
Efficient theming in Drupal
Efficient theming in DrupalEfficient theming in Drupal
Efficient theming in Drupal
 
Working with SASS/Compass and Zurb Foundation
Working with SASS/Compass and Zurb FoundationWorking with SASS/Compass and Zurb Foundation
Working with SASS/Compass and Zurb Foundation
 
.Less - CSS done right
.Less - CSS done right.Less - CSS done right
.Less - CSS done right
 
Biological Modelling, Powered by AngularJS
Biological Modelling, Powered by AngularJSBiological Modelling, Powered by AngularJS
Biological Modelling, Powered by AngularJS
 
Object oriented css graeme blackwood
Object oriented css graeme blackwoodObject oriented css graeme blackwood
Object oriented css graeme blackwood
 
快速开发Css
快速开发Css快速开发Css
快速开发Css
 
Standards and guides in web design
Standards and guides in web designStandards and guides in web design
Standards and guides in web design
 
Welcome to css!
Welcome to css!Welcome to css!
Welcome to css!
 
Css
CssCss
Css
 
CSS For Backend Developers
CSS For Backend DevelopersCSS For Backend Developers
CSS For Backend Developers
 
The Dark Arts of CSS
The Dark Arts of CSSThe Dark Arts of CSS
The Dark Arts of CSS
 
Object Oriented CSS for rapid, scalable and maintainable development
Object Oriented CSS for rapid, scalable and maintainable developmentObject Oriented CSS for rapid, scalable and maintainable development
Object Oriented CSS for rapid, scalable and maintainable development
 
JavaScripters Event on Sep 10, 2016 · 10:30 AM: Sass
JavaScripters Event on Sep 10, 2016 · 10:30 AM: SassJavaScripters Event on Sep 10, 2016 · 10:30 AM: Sass
JavaScripters Event on Sep 10, 2016 · 10:30 AM: Sass
 
Getting Sassy with CSS
Getting Sassy with CSSGetting Sassy with CSS
Getting Sassy with CSS
 
Css home
Css   homeCss   home
Css home
 
Beautifying senc
Beautifying sencBeautifying senc
Beautifying senc
 
018 CSS, BEM, SASS e boas práticas
018 CSS, BEM, SASS e boas práticas018 CSS, BEM, SASS e boas práticas
018 CSS, BEM, SASS e boas práticas
 

Similar to Make your CSS beautiful again

Getting SASSy with front end development
Getting SASSy with front end developmentGetting SASSy with front end development
Getting SASSy with front end development
Matthew Carleton
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
Amey Parab
 
Why are we using Sass to create Grid Frameworks?
Why are we using Sass to create Grid Frameworks?Why are we using Sass to create Grid Frameworks?
Why are we using Sass to create Grid Frameworks?
sharjeet
 
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqSass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by Shafeeq
DignitasDigital1
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
Suzette Franck
 
The CSS Handbook
The CSS HandbookThe CSS Handbook
The CSS Handbook
jackchenvlo
 
The sass way - Yatendra Bhardwaj
The sass way - Yatendra BhardwajThe sass way - Yatendra Bhardwaj
The sass way - Yatendra Bhardwaj
Yatendra Bhardwaj
 
An Introduction to CSS Frameworks
An Introduction to CSS FrameworksAn Introduction to CSS Frameworks
An Introduction to CSS Frameworks
Adrian Westlake
 
Styling your projects! leveraging css and r sass in r projects
Styling your projects! leveraging css and r sass in r projectsStyling your projects! leveraging css and r sass in r projects
Styling your projects! leveraging css and r sass in r projects
Appsilon Data Science
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Erin M. Kidwell
 
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
Stefan Bauer
 
Peggy sass vs scss
Peggy  sass vs scssPeggy  sass vs scss
Peggy sass vs scss
LearningTech
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
chriseppstein
 
SASS Lecture
SASS Lecture SASS Lecture
SASS Lecture
Adnan Arshad
 
Srijan presentation on CSS
Srijan presentation on CSSSrijan presentation on CSS
Srijan presentation on CSS
Shashank Merothiya
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
Cubet Techno Labs
 
Full
FullFull
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer Notes
Vskills
 
SASS Preprocessor
SASS PreprocessorSASS Preprocessor
SASS Preprocessor
Webkul Software Pvt. Ltd.
 
Css
CssCss

Similar to Make your CSS beautiful again (20)

Getting SASSy with front end development
Getting SASSy with front end developmentGetting SASSy with front end development
Getting SASSy with front end development
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
 
Why are we using Sass to create Grid Frameworks?
Why are we using Sass to create Grid Frameworks?Why are we using Sass to create Grid Frameworks?
Why are we using Sass to create Grid Frameworks?
 
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqSass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by Shafeeq
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
The CSS Handbook
The CSS HandbookThe CSS Handbook
The CSS Handbook
 
The sass way - Yatendra Bhardwaj
The sass way - Yatendra BhardwajThe sass way - Yatendra Bhardwaj
The sass way - Yatendra Bhardwaj
 
An Introduction to CSS Frameworks
An Introduction to CSS FrameworksAn Introduction to CSS Frameworks
An Introduction to CSS Frameworks
 
Styling your projects! leveraging css and r sass in r projects
Styling your projects! leveraging css and r sass in r projectsStyling your projects! leveraging css and r sass in r projects
Styling your projects! leveraging css and r sass in r projects
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
 
Peggy sass vs scss
Peggy  sass vs scssPeggy  sass vs scss
Peggy sass vs scss
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
 
SASS Lecture
SASS Lecture SASS Lecture
SASS Lecture
 
Srijan presentation on CSS
Srijan presentation on CSSSrijan presentation on CSS
Srijan presentation on CSS
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
 
Full
FullFull
Full
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer Notes
 
SASS Preprocessor
SASS PreprocessorSASS Preprocessor
SASS Preprocessor
 
Css
CssCss
Css
 

Recently uploaded

TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Jeffrey Haguewood
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 

Recently uploaded (20)

TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 

Make your CSS beautiful again

Editor's Notes

  1. We have a yml file which allows us to target modules and verticals separately as we still have many discrepancies across elements that should be styled the same. With the navigation we initially needed a separate test per channel, but now we just need one.Eventually when we have standardised all our styles, we will need fewer test instances as we will have fewer styling discrepancies. Then the styleguide going forward will reduce coding time in future. Styles will be inherited correctly and overwritten correctly.
  2. And as a little aside… by using a styleguide your HTML will also benefit. There is nothing like a styleguide to encourage semantic markup!
  3. P class heading should probably be a heading, inheriting a heading style. Here you’ve bastardised your HTML, inflated your CSS and ignored semantics. Your HTML has extra text in for an unnecessary class. Your CSS has extra text in for an unnecessary rule, and the poor screenreader has no idea that this p class heading is any more important than a regular p tag.
  4. Cactus has allowed us to refactor using Sass to make our stylesheets even more concise and beautiful
  5. I’ll firstly talk about nesting, which once you start using it, you’ll wonder why it was never introduced into standard CSS. It condenses your code neatly, and partitions it into sections that are clearly related. It also saves on repeating class names over and over. On the left is our standard CSS syntax. On the right you can see how it looks when it is nested. Much neater. However…
  6. When you look at the CSS generated from the nesting of the previous screengrab, you’ll see it’s very ineffective.4 out of the 5 rules use far too much specificity and so in future we would have to use an equal number of selectors to overwrite any styles applied. Inefficient selectors have a negative effect on your pagespeed score.
  7. Nesting can be very useful, and a very tidy way of writing code, but you have to cautious of how the CSS will be processed
  8. Here on the left we have our previous example of nesting, which created all the ineffective selectors, and on the right we have an example of nesting as it should be used. This nesting will be processed to appear exactly how our initial CSS file did.Think about how sass is going to concatenate your selectors, and as soon as you’re going above two selectors you’re probably being too specific and your cascading stylesheets are not going to cascade
  9. Variables allow you to repeat property values throughout your scss files. Not only are they more human friendly on the eye than something like a hex code, but they reduce the margin of error and maintains our styleguide. Goodtoknow had so many different variations of orange being used for headings and links and buttons – and that was just on recipes – the same issue went across each channel. Using a variable means that you’ll always use the correct color or font size etc. It also means that should it need updating in future you don’t need to run a find and replace, you just need to change the variable itself
  10. Simply put, this allows one selector to inherit the design properties of its parent. So rather than cluttering your HTML element with another class, you can extend it in the CSS.http://chriseppstein.github.com/blog/2010/08/02/sass-extend-challenge/
  11. In addition to just using variable values as they’re defined, you can also modify and combine them using math and useful predefined functions. This allows you to compute element sizing and even coloration dynamically.The standard math operations (+, -, *, /, and %) are supported for numbers, even those with units. For colors, there are all sorts of useful functions for changing the lightness, hue, saturation, and more.Variables can be used for more than just property values. You can use #{} to insert them into property names or selectors
  12. Mixins are one of the most powerful Sass features. They allow re-use of larger chunks of code.If you’re writing standard CSS, each time you want to create new border-radius values you will have to include the vendor prefixes. It’s tedious. That or write each variant once and repeat a class throughout your HTML. Neither is desirable and both are difficult to maintain.
  13. Sass has error handling on the command line and in the browser. It will tell you where the bad css has been written and what it is failing on. That’s got to be a bonus!
  14. And so here is an example of some code on goodtoknow. After refactoring the CSS for the tabbed panels I nearly halved the lines of code. It requires two CSS files – one for the base styles and one to add the channel colors.As you can see we have reduced the lines of code by half, and we’ve done the same for the CSS rules.You can also see that when the CSS is generated from the SCSS, it is only minimally inflated from the refactored code. As a general rule, your average stylesheet will increase by ~3k for every 100 lines of uncompressed code. If you’re adhering to best practices, and you’re not too crazy with nested selectors or otherwise overusing Sass features, then file size bloat and selector performance are non-issues.http://www.atomeye.com/accolades/sass/
  15. Recap