SlideShare a Scribd company logo
CSS BLOAT!
                             with Nicole Sullivan




Friday, September 10, 2010
TWEET!


                             @stubbornella




Friday, September 10, 2010
WHY OPTIMIZE CSS?


    • It blocks progressive rendering
     
 test: http://www.phpied.com/files/css-loading/table.php
    • It’s verbose (property value pairs cannot be minified like JS)
     
              text-decoration: underline
 != td: u


Friday, September 10, 2010
TOP 1000 STUDY


    1. Grab top Alexa sites
    2. Start Fiddler
    3. Load each site
    4. Export from Fiddler



Friday, September 10, 2010

Recommended for you

BEM it! Introduction to BEM
BEM it! Introduction to BEMBEM it! Introduction to BEM
BEM it! Introduction to BEM

This document provides an introduction to the BEM (Block, Element, Modifier) methodology for organizing HTML, CSS, and JavaScript code in a consistent and modular way. It explains the basic concepts of BEM including blocks, elements, and modifiers. It also discusses how to implement BEM through CSS naming conventions and provides examples. Best practices for using BEM with HTML, CSS, JavaScript, file structure, and build processes are covered. The goal of BEM is to provide a common semantic framework for building user interfaces and managing front-end code.

Html
HtmlHtml
Html

This document provides an overview of HTML including: - A brief history of HTML from its creation in 1989 to modern standards. - An explanation of basic HTML tags for formatting text, creating links, inserting images, and organizing content using lists, tables, and frames. - Descriptions of common HTML attributes for further customizing tags. - Recommendations for the essential tools and resources needed to get started with HTML.

html
BEM It! for Brandwatch
BEM It! for BrandwatchBEM It! for Brandwatch
BEM It! for Brandwatch

The document introduces the BEM (Block, Element, Modifier) methodology for organizing CSS, HTML, and JavaScript code into reusable components. It describes BEM as a semantic model that defines blocks, elements, and modifiers to structure interfaces. Blocks are standalone parts of an interface, elements are integral parts of blocks, and modifiers define block/element properties or states. The document provides examples of BEM naming conventions and discusses benefits like improved reusability, reduced specificity issues, and serving as a common language for designers and developers.

htmlmethodologycss
<?php

         $file = file('alexa.txt');

         foreach ($file as $url) {

                  launch($url);

         }

         function launch($url) {

                  try {

                             $ie = new COM("InternetExplorer.Application");

                             $ie->Visible = true;

                             $ie->Navigate2($url);

                             while ($ie->ReadyState != 4) sleep(1);

                             $ie->Quit();

                  } catch (Exception $e) {}

         }

         ?>
Friday, September 10, 2010
42% DON’T GZIP CSS




Friday, September 10, 2010
44% HAVE MORE THAN 2
                 CSS FILES
                             56%

                                   44%




Friday, September 10, 2010
56% SERVE CSS WITH
                            COOKIES




Friday, September 10, 2010

Recommended for you

Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3

This presentation about HTML5 and CSS3 presents with example and described valid points with simple example code and live preview.

htmlhtml5java
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...

This Edureka "What Is Spring Framework" tutorial will help you in understanding the fundamentals of Spring Framework and build a strong foundation in Spring. Below are the topics covered in this tutorial: 1. Java Frameworks 2. Spring Framework 3. Why Spring Framework? 4. Spring Architecture 5. Spring Modules 6. Spring Features

what is spring frameworkspring architecturespring tutorial
Html & CSS
Html & CSSHtml & CSS
Html & CSS

The document discusses HTML and CSS. HTML is the markup language used to create webpages, while CSS describes how HTML elements are displayed. It provides definitions of HTML 5 and CSS 3, the current major versions. Free courses for learning HTML and CSS are listed from YouTube, Khan Academy, and W3Schools. Paid course options are also listed from Coursera, Udemy, and Pluralsight. Experts in HTML and CSS mentioned include Tim Berners-Lee and Bucky Roberts. Contact information is provided at the end.

htmlhtml5css
62% DON’T MINIFY




         would get more than 10% savings from YUI compressor
Friday, September 10, 2010
21% HAVE >100K OF CSS
                                   21%


                             11%
                             11%


                                          44%


                                    24%
Friday, September 10, 2010
HASTE TRACE-BASED PACKAGING




                                                            homepage     homepage
              Date           CSS files          CSS weight
                                                              files         weight

       Nov 2008                487                  1.7MB      24            69KB

        May 2009               706                  1.9MB      15            64KB

   http://velocityconference.blip.tv/file/2293221/               David Wei & Changhao Jiang
Friday, September 10, 2010
KUDZU
      Was introduced to the United States between 1935 and 1950
       by the Soil Conservation Service to prevent soil erosion.


Friday, September 10, 2010

Recommended for you

Basic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdfBasic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdf

This document provides an introduction to HTML and CSS. It defines HTML as a markup language used to structure web pages with tags, and CSS as a style sheet language used to describe how HTML elements are displayed. It lists common HTML elements like headings, paragraphs, and divs that can be block or inline, and describes how CSS can be applied internally, inline, or via external stylesheets to control things like colors, fonts, and layout. Key differences between HTML and CSS are also outlined, with HTML for structure and CSS for presentation.

HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt

The document provides an overview of full stack web development, including front-end technologies like HTML, CSS, JavaScript and back-end technologies like PHP, Java, and Python. It discusses how websites are structured and hosted, how web pages are built using HTML, and how text editors can be used to write HTML code. It also covers common web development terms like protocols, URLs, and how CSS is used to style web pages.

student
Html and css
Html and cssHtml and css
Html and css

HTML and CSS are markup languages used to structure and style web pages. HTML is used to define the structure and semantics of content, while CSS handles the presentation and layout. Some key points covered include: - HTML stands for Hypertext Markup Language and uses tags to structure content into headings, paragraphs, lists etc. CSS is used to specify rules that control the presentation and formatting of HTML elements. - The box model is a fundamental concept in CSS that treats each HTML element as a box, including properties like margins, borders, padding and content. - Common CSS selectors include element selectors, class selectors, ID selectors and pseudo-classes. The specificity of selectors determines which styles

htmlhypertext markup languagecss
CSS KUDZU!


Friday, September 10, 2010
“OBJECT ORIENTED CSS
                   SOUNDS GREAT, BUT WE
                    HAVE A GIANT MESS!”
                             how do we get from here to there?




Friday, September 10, 2010
FACEBOOK DECIDED TO
                  GO ON A DIET
                             The CSS was one piece of the puzzle




Friday, September 10, 2010
Jason Sobel -
                             Perf Manager Fu

                               MANY PIECES                    Nan Gao
  Kyle Delong - PHP                  David Wei & Changhao Jiang BigPipe




            Marcel
            Laverdet -                         Tom Occhino - JS
            XHP
     Makinde                                 Shaun McIntyre -
     Adeagbo - JS                          Automated Spriting
Friday, September 10, 2010

Recommended for you

HTML/CSS/java Script/Jquery
HTML/CSS/java Script/JqueryHTML/CSS/java Script/Jquery
HTML/CSS/java Script/Jquery

The document provides an overview of HTML, CSS, JavaScript and jQuery. It describes what each technology is, examples of common tags and syntax, and how they are used together. HTML is a markup language used to define the structure and layout of web pages using tags. CSS is used to style and lay out HTML elements, and can be linked externally or embedded internally or inline. JavaScript can be used to add interactive elements and dynamic behavior to HTML pages client-side. jQuery is a JavaScript library that simplifies tasks like HTML document traversal and manipulation, events, animations and Ajax.

About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS

This PPT is about my best friends, HTML, CSS and JS. Here I am just talk/show few features of them. all three combined make our web site more powerful in this WWW world.

cascading style sheetshtml5css3
HTML Semantic Elements
HTML Semantic ElementsHTML Semantic Elements
HTML Semantic Elements

Semantic HTML elements like <header>, <nav>, <article>, <section>, and <footer> help describe the meaning and purpose of content. Non-semantic elements like <div> do not provide semantic information. Common sections of a webpage such as navigation, content articles, and footers can now be marked up with the appropriate semantic elements to clearly define the structure and roles for both browsers and developers.

THEY REDUCED THEIR
            RESPONSE TIME BY HALF
                             in only six months




Friday, September 10, 2010
WHAT IS OBJECT
                             ORIENTED CSS?
                             A philosophy? A framework? A tool?




Friday, September 10, 2010
MORE LIKE AN EVOLUTION
      OF THE LANGUAGE
                             it makes CSS more powerful




Friday, September 10, 2010
HOW IS IT DIFFERENT?


                                  ul{...}
                               ul li{...}
                             ul li a{...}




Friday, September 10, 2010

Recommended for you

Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3

This presentation is target for developers that are new to CSS3, and would like to know what CSS3 they need to understand for Windows 8 development.

codecss3demo
Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Java Script Object Notation (JSON)
Java Script Object Notation (JSON)

JSON (JavaScript Object Notation) is a lightweight data format that is easy for humans to read and write and easy for machines to parse and generate. It is built upon two structures: collections of name-value pairs and ordered lists of values. JSON has advantages over XML as it is lighter, easier to parse, and does not require tags.

benefitsxmlvs
Basics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointBasics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPoint

Here are some tips for hands-on part 2: - Add a class like .paragraph to the <p> tags containing your sentences - Add an ID like #image to the <img> tag - In an internal or external CSS file: .paragraph { color: blue; font-size: 20px; } #image { padding: 10px; display: block; margin: 0 auto; } - For background: body { background-color: lightgray; } - Play around with other CSS properties like text-align, font-family etc.

HOW IS IT DIFFERENT?


                                  ul{...}
                               ul li{...}
                             ul li a{...}



   Until now, we focused all our effort here

Friday, September 10, 2010
HOW IS IT DIFFERENT?


                                     ul{...}
                                  ul li{...}
                                ul li a{...}



                  But, the architecture lives here

Friday, September 10, 2010
MUCH LESS CODE
                               easier to work with newbies




Friday, September 10, 2010
GRIDS
    •   574 bytes

    •   14 lines of code

    •   Percentage widths adapt to
        different page sizes

    •   Includes halfs, thirds, fourths, and
        fifths

    •   No gutters

    •   Infinite nesting and stacking

Friday, September 10, 2010

Recommended for you

Document Object Model
Document Object ModelDocument Object Model
Document Object Model

The document discusses the Document Object Model (DOM), which is the browser's programmatic representation of a webpage that can be manipulated with JavaScript. It describes how a webpage is loaded and displayed in four steps - request, response, parsing, and building. Key points include how the DOM presents documents as a hierarchy of node objects, and methods for getting elements, adding text to a page, and traversing the DOM tree.

JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation

JavaScript can dynamically manipulate the content, structure, and styling of an HTML document through the Document Object Model (DOM). The DOM represents an HTML document as nodes that can be accessed and modified with JavaScript. Common tasks include dynamically creating and adding elements, handling user events like clicks, and updating content by accessing DOM elements by their id or other attributes.

manipulationdomjavascript
Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScriptSencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript

A presentation reviewing the features, coding style, and demos, given at Silicon Valley Code Camp 2010.

senchatouchioshtml5
GRANULARITY FAIL
                            + STALE RULES
                         + UNPREDICTABILITY
                           + DUPLICATION
                         + SPECIFICITY WARS
                           = MASSIVE CSS
Friday, September 10, 2010
5              Text


                             GRANULARITY FAIL
                       the CSS objects shouldn’t match the PHP objects



Friday, September 10, 2010
Friday, September 10, 2010
Friday, September 10, 2010

Recommended for you

"Introduction Open Graph and Facebook Platform" - Facebook Developer Garage ...
"Introduction Open Graph and Facebook Platform" -  Facebook Developer Garage ..."Introduction Open Graph and Facebook Platform" -  Facebook Developer Garage ...
"Introduction Open Graph and Facebook Platform" - Facebook Developer Garage ...

Shreyas, NH7.in presentation on introduction to open graph and his experience's working with FB Platform

fdgblrfacebook developer garage bangalore
WordPress Front End Optimizations
WordPress Front End OptimizationsWordPress Front End Optimizations
WordPress Front End Optimizations

This document discusses various tips for optimizing the front-end of a WordPress blog to improve speed. It covers optimizing HTML, CSS, JavaScript, images, and media. Specific recommendations include using semantic HTML, shorter CSS selectors, image sprites, minifying files, caching resources, reducing HTTP requests, and leveraging browser caching through Expires headers and gzip compression. It also recommends tools like YSlow and Google PageSpeed for auditing performance.

htmlwordpresscss
Advanced android
Advanced androidAdvanced android
Advanced android

This document outlines topics that will be covered in a talk about intermediate Android development. The topics include: using RoboGuice for dependency injection, basic Java unit testing with JUnit, Android unit testing, the Droid-Fu development framework, and using Hudson for continuous integration of Android builds. Code demos will be provided for RoboGuice, JUnit testing, and Droid-Fu. Questions from attendees are welcomed at the end.

android
Friday, September 10, 2010
http://www.brickartist.com/
Friday, September 10, 2010
http://www.brickartist.com/
Friday, September 10, 2010
WE WANT TO DO THE
                SAME THING WITH CSS




Friday, September 10, 2010

Recommended for you

Dr. Strangelove: or How I learned to love HTML, CSS, and Javascript
Dr. Strangelove: or How I learned to love HTML, CSS, and JavascriptDr. Strangelove: or How I learned to love HTML, CSS, and Javascript
Dr. Strangelove: or How I learned to love HTML, CSS, and Javascript

This document provides an overview of HTML, CSS, and JavaScript. It discusses writing semantic HTML using appropriate elements and attributes. It also covers CSS topics like selectors, frameworks, and graceful degradation. JavaScript techniques like unobtrusive JavaScript, writing reusable code, and best practices are explained. Microformats and responsive design principles are also mentioned.

htmlrailscss
BDD and Cucumber at barcampGZ
BDD and Cucumber at barcampGZBDD and Cucumber at barcampGZ
BDD and Cucumber at barcampGZ

This document discusses Behavior Driven Development (BDD) and the associated tools used for BDD. It describes BDD as a methodology that focuses on behavior over internal structure and eases communication. The BDD cycle involves writing features and scenarios in plain text with steps, and defining those steps in code. Popular BDD tools mentioned are Cucumber for writing system behaviors in plain text and RSpec for testing internal behaviors. The document also briefly discusses using Cucumber scenarios, examples, and email-spec for testing emails.

bddcucumber at barcampgz
IE9 для разработчиков
IE9 для разработчиковIE9 для разработчиков
IE9 для разработчиков

The document is a presentation about new features in Internet Explorer 9 for web developers. It summarizes that IE9 has improved support for HTML5, CSS3, SVG and passes more ACID3 tests compared to previous versions. Specifically, it now supports features like border-radius, CSS selectors like :nth-child(), RGBA/HSLA colors, @font-face fonts using WOFF format and media queries for responsive design. Developer tools have also been improved in IE9 for debugging web pages.

ie9 beta css3 ukraine
CREATE THE
                             BUILDING BLOCKS




Friday, September 10, 2010
MOST SITES GET THE
               GRANULARITY WRONG
                             and their architecture is set up to fail




Friday, September 10, 2010
HOW? FIRST, A VISUAL
                     INVENTORY




Friday, September 10, 2010
TAKE A PHP OBJECT
Friday, September 10, 2010

Recommended for you

In depth with html5 java2days 2010
In depth with html5 java2days 2010In depth with html5 java2days 2010
In depth with html5 java2days 2010

The document provides an overview of HTML5 including: - A brief history of HTML standards from 1991 to the development of HTML5 in 2009. - An explanation that HTML5 is intended as a replacement for older HTML and XHTML standards. - A preview of some new features covered in HTML5 like video, audio, canvas, forms, local storage and web workers.

htmlaudiosemantics
Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010

This document provides an overview of HTML5 and CSS3 standards and capabilities. It discusses the evolution of HTML standards over time from HTML4 to XHTML to HTML5. It highlights new HTML5 features like canvas, video, forms, and offline applications. It also summarizes new CSS3 features for borders, backgrounds, shadows, transitions, transforms, and web fonts. The document encourages adoption of open web standards and provides examples and links for further reading.

html5standardsshanghai
Introducing Django-Servee
Introducing Django-ServeeIntroducing Django-Servee
Introducing Django-Servee

This document provides instructions for installing the Django-Servee app using pip and links to its GitHub page. It then shows various screenshots of the Servee content management interface, including a typical site view, an edit view when logged in, using a WYSIWYG field, inline inserting content, changing styles, and the on-site toolbar. The document ends by listing an individual, Issac Kelly, and their contact information.

django wysiwyg servee
BREAK IT DOWN
Friday, September 10, 2010
7 SMALLER OBJECTS




Friday, September 10, 2010
headings




Friday, September 10, 2010
HEADINGS
   Heading      - 16px bold #3B5998
   Heading     - 16px normal #333333
   Heading     - 15px bold #3B5998     • 12px   headings eliminated
   Heading     - 15px normal #333333
   Heading     - 14px bold #3B5998     • Blue   only for links
   Heading    - 14px normal #333333
   Heading    - 13px bold #3B5998      • Bold   for all titles
   Heading    - 13px normal #333333    • Chad Little went through
   Heading   - 11px bold #3B5998        the entire site eliminating
   Heading   - 11px normal #333333      duplicates.
Friday, September 10, 2010

Recommended for you

From Singapore to Slovenia
From Singapore to SloveniaFrom Singapore to Slovenia
From Singapore to Slovenia

I spent my one month of Summer 2010 in Slovenia. This presentation shares some of the beautiful nature that I was close to. It was like fairytale I would say!

ljubljanasloveniachallengefuture
Snowflake in music
Snowflake in musicSnowflake in music
Snowflake in music

This document discusses the "Snowflake Effect" in learning and research. It notes that as information has become more abundant online through sources like Facebook, YouTube, and massive open online courses, there is a need to better tailor learning to individual learners. It provides examples from the music industry of how services like Pandora and Shazam create personalized recommendations, and suggests designing for more personalized, "snowflake" learning experiences as the amount of information continues to grow.

mume10
Building Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQueryBuilding Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQuery

This document summarizes a presentation about creating distributed JavaScript widgets using jQuery. The presentation discusses defining distributed JavaScript widgets, integrating jQuery to avoid conflicts, communicating with servers across domains using techniques like JSONP and postMessage, and rendering the widget interface securely on third-party sites. It provides examples of building a basic widget that retrieves and displays data from an external server.

javascriptjqconjquery
IT’S ALL ABOUT PATTERN
                    MATCHING
                             but you have to take a step back




Friday, September 10, 2010
PHP OBJECTS != CSS OBJECTS
                             you will be tempted, beware!




Friday, September 10, 2010
4        Text


                             STALE RULES
                                 CSS gets crufty



Friday, September 10, 2010
STALE IS TWO THINGS



    ❖   Truly stale - rules that are no longer used on the site
    ❖   Rules used on subsequent PV or activated on user action




Friday, September 10, 2010

Recommended for you

Progressive Advancement, by way of progressive enhancement
Progressive Advancement, by way of progressive enhancementProgressive Advancement, by way of progressive enhancement
Progressive Advancement, by way of progressive enhancement

The document discusses progressive enhancement and feature detection using Modernizr. It emphasizes starting with modern capabilities like HTML5 and CSS3, while providing graceful fallback for older browsers. Modernizr helps detect features to conditionally apply native and polyfill code, improving performance for all browsers. The presentation encourages teams to adopt progressive enhancement and performance best practices.

html5css3
Persistence Smoothie: Blending SQL and NoSQL (RubyNation Edition)
Persistence  Smoothie: Blending SQL and NoSQL (RubyNation Edition)Persistence  Smoothie: Blending SQL and NoSQL (RubyNation Edition)
Persistence Smoothie: Blending SQL and NoSQL (RubyNation Edition)

Persistence Smoothie is a talk given at RubyNation 2010 about when, how, and why to use combinations of persistence engines (including both SQL and NoSQL options) with a live example. The code is available at http://github.com/mbleigh/persistence-smoothie

mongodbrailssql
OvertheAir 2010 html5 impact on application programming
OvertheAir 2010 html5 impact on application programmingOvertheAir 2010 html5 impact on application programming
OvertheAir 2010 html5 impact on application programming

The document discusses emerging HTML5 communication technologies and their impact. It covers new technologies like WebSockets and EventSource that enable real-time bidirectional and server-sent events between web apps and servers. It argues this will influence native apps and lead to more interconnected, adaptive and synchronized web experiences across different screens.

connectivityovertheairhtml5
WHAT KIND DO YOU
                            HAVE?




Friday, September 10, 2010
WHAT KIND DO YOU
                            HAVE?


    ❖   Try dust-me selectors




Friday, September 10, 2010
WHAT KIND DO YOU
                            HAVE?


    ❖   Try dust-me selectors
    ❖   Track them over time -
         ‣   changes are more important than an absolute number




Friday, September 10, 2010
3         Text


                             UNPREDICTABILITY
               Make each object predictable and location independent



Friday, September 10, 2010

Recommended for you

HTML5 impact on application programming
HTML5 impact on application programmingHTML5 impact on application programming
HTML5 impact on application programming

The document discusses emerging HTML5 communication technologies and their impact. It covers new technologies like WebSockets, EventSource, and cross-origin XMLHttpRequest that enable real-time communication. It argues these technologies will influence native apps and lead to more interconnected, adaptive applications that can span devices and automatically synchronize data.

connectivityhtml5application
Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010

This document summarizes a presentation on Django web application security given by Adam Baldwin. The presentation covered common security failures in Django projects including cross-site scripting due to improper validation of user input in templates, file uploads that do not check extensions or store files in protected directories, direct access to objects without authorization checks, and other issues. Baldwin emphasized avoiding security problems by following best practices like input validation, using middleware to set security headers, and not allowing privileged operations with HTTP GET.

djangocon security django
DjangoCon 2009 Keynote
DjangoCon 2009 KeynoteDjangoCon 2009 Keynote
DjangoCon 2009 Keynote

The document appears to be a presentation about web application development trends. It discusses the rising popularity of frameworks like Django, Rails and PHP. It also covers topics like rich internet applications, latency, cloud computing, frameworks like Lift and Webmachine, and how web applications are changing for users, developers and operators. The presentation includes several images and recommends following Ted Leung online for more information.

pythondjangodjangocon
h3




Friday, September 10, 2010
h3




Friday, September 10, 2010
A        Heading should not become a          Heading

                                   in another part of the page.




Friday, September 10, 2010
AVOID
                                    EXAMPLE
                             #weatherModule h3{color:red;}
                             #tabs h3{color:blue}


    ❖   Global color undefined for h3, so it will be
         ‣   unstyled in new modules,
         ‣   developers forced to write more CSS for the same style




Friday, September 10, 2010

Recommended for you

"Designing School 2.0 - Inspired by Agile Learners" - Christian Long keynote ...
"Designing School 2.0 - Inspired by Agile Learners" - Christian Long keynote ..."Designing School 2.0 - Inspired by Agile Learners" - Christian Long keynote ...
"Designing School 2.0 - Inspired by Agile Learners" - Christian Long keynote ...

Defining School 2.0, Part 1 - Christian Long, school planner and technology expert This day-long symposium brings together school districts, design professionals, legislators, students of education and architecture, construction managers, state agencies and many others. Two 21st Century learning and school design enthusiasts and experts - Randy Fielding, award winning international architect and coauthor of "The Language of School Design: Design Patterns for 21st Century Schools," and Christian Long, educator, school planner, and passionate advocate for innovative learning communities, are your guides as you answer the questions, "What is a 21st Century Learning Environment, and What Does it Look Like?" The first presentation by Christian focuses on 21st Century learning, learning ideas and models. This serves as a set-up to the second session, where Randy will focus on tying those ideas and models to design principles, strategies and outcomes of 21st Century school designs in the creative age.

education design technology
Building the Media Block in ReactJS
Building the Media Block in ReactJS Building the Media Block in ReactJS
Building the Media Block in ReactJS

the API is an interface that needs to be designed. http://styleguide.pivotal.io/react_beta.html https://www.npmjs.com/search?q=pui

reactan event apartan event apart - san diego 2015
Why are you here?
Why are you here?Why are you here?
Why are you here?

A reflection on career and community. A call to follow your heart rather than some abstract notion of success.

cssconfcurationcssconf.eu
HOW DO YOU TEST FOR
             UNPREDICTABLE CODE?
                             #foo h3{...}
                             #bar h3{...}
                             #baz h3{...}

                             grep
                             h[1-6]



Friday, September 10, 2010
h1-h6
                     How many? You need site-wide headings




Friday, September 10, 2010
511
                             declarations setting styles for h1-h6


  56% >10
  9% >100
Friday, September 10, 2010
HEADINGS BEFORE



                               958
                                 declarations h1-h6



                                                      Facebook
Friday, September 10, 2010

Recommended for you

Creating Living Style Guides to Improve Performance
Creating Living Style Guides to Improve PerformanceCreating Living Style Guides to Improve Performance
Creating Living Style Guides to Improve Performance

Refactoring Trulia’s UI with SASS, OOCSS, and handlebars. My slides from jsconf 2013. Lot's of yummy details about the performance improvements we were able to make.

sassoocssstyle guides
Don't feed the trolls
Don't feed the trollsDon't feed the trolls
Don't feed the trolls

The JavaScript community is one of the most vibrant and fun groups I've ever been lucky enough to be a part of. Like any vibrant community, sometimes people don't play nicely. In this session, I will discuss what it has been like to be shy *and* be on twitter, mailing lists, and open source. I'll talk about my experiences consulting on massive CSS overhauls, and ways to defeat trolls -- including your own inner troll! I'll also share a timing attack for your brain that might just surprise you.

fluentconfjavascriptjsconf
CSS Power Tools
CSS Power ToolsCSS Power Tools
CSS Power Tools

Let’s admit it, the tools for writing CSS aren’t very advanced. For the most part, the people who write tools don’t know about CSS and the people who know about CSS don’t write tools. Quite a conundrum! In this session, you’ll learn about good tools that can make development faster and maintenance easier. We’ll also talk a bit about where we can go from here. What tools do we need as sites are becoming more and more complex? We need to get beyond tools whose primary goal is to avoid hand-coding and realize that, as our techniques for writing CSS become more powerful, our tools can too! Session will include: * Validators * Preprocessors * Finding dead rules * Linting * CSS3 gradient tools * Performance measurement tools * Unit testing

image optimizationcompassblueprint
HEADINGS AFTER:



                                 25
                                       Chad Little - Facebook
Friday, September 10, 2010
2                   Text


                              SPECIFICITY WARS
                             lobbing specificity grenades over the cube wall



Friday, September 10, 2010
SPECIFICITY SCREWS UP
                   THE CASCADE
                        and the cascade kind of rocks, so how do we use
                                        the good parts?




Friday, September 10, 2010
SIMPLIFY SPECIFICITY




Friday, September 10, 2010

Recommended for you

5 Mistakes of Massive CSS
5 Mistakes of Massive CSS5 Mistakes of Massive CSS
5 Mistakes of Massive CSS

Nicole Sullivan and Stoyan Stefanov discuss their work optimizing CSS at Facebook and Yahoo!, As well as the state of CSS optimizations in the Alexa Top 1000 websites. What a mess! From Velocity Conference and Texas-Javascript.

css performance optimization facebook yahoo veloci
CSS Wish List @JSConf
CSS Wish List @JSConfCSS Wish List @JSConf
CSS Wish List @JSConf

From Nicole's talk at JSConf.eu where she presented her wish list for the future of CSS. She presents a brand-new expanded syntax which allows for prototypes, mixins, and variables and explains how a preprocessor can be used today to achieve a richer language in older browsers.

css specification prototype mixin variable oocss j
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...

The cascade is a poker game, but we've been playing our cards all wrong. Here Nicole suggests we stop trying to play to win to prevent code bloat, and simplify the cascade, using the order of the rulesets to allow overrides.

taetae09css
.mod .hd{...}
.ie .mod .hd{...}
.weatherMod .hd {...}




                 USE HACKS SPARINGLY
                             And don’t let them change your specificity




Friday, September 10, 2010
.mod .hd{...}
           X
.ie .mod .hd{...}
.weatherMod .hd {...}




                 USE HACKS SPARINGLY
                             And don’t let them change your specificity



                         .mod .hd{color: red; _zoom:1;}
                         .weatherMod .hd{...}

Friday, September 10, 2010
#navigation{...}
    #header{...}




                             AVOID STYLING IDS
                             IDs impact specificity and can’t be reused




 IDs are for JS
Friday, September 10, 2010
X
    #navigation{...}
    #header{...}




                             AVOID STYLING IDS
                             IDs impact specificity and can’t be reused




 IDs are for JS
Friday, September 10, 2010

Recommended for you

Taming CSS Selectors
Taming CSS SelectorsTaming CSS Selectors
Taming CSS Selectors

From Nicole's presentation at the CSS Summit. This is brand new research regarding efficient CSS selector design. Practicing the rules outlined here will make your CSS lean, your site fast, and your maintenance minimal. A beautiful combination for people concerned with building performance into their sites.

selectorscssperformance
The Fast And The Fabulous
The Fast And The FabulousThe Fast And The Fabulous
The Fast And The Fabulous

You've got a sneaking suspicion that design impacts performance. What next? Your engineers know nothing about design and your designers know nothing about performance. How can you get everyone on the same page? Which design flaws must you absolutely avoid? How do engineers slow designs with poor CSS? This presentation covers the best practices in design and OO CSS for fast, maintainable sites. * Abstraction * Flexibility * Grids * Location dependent styles Velocity Conference, 2009

Pourquoi la performance?
Pourquoi la performance?Pourquoi la performance?
Pourquoi la performance?

Quantifier et améliorer la performance de tout produit Yahoo! mondial avec Éric Daspet pour ParisWeb 2008

smushitÉricdaspet"
.nav {color: red !important;}




                             AVOID !IMPORTANT
                                 except on leaf nodes




Friday, September 10, 2010
.nav {color: red !important;}      X

                             AVOID !IMPORTANT
                                 except on leaf nodes




Friday, September 10, 2010
!IMPORTANT



                              518
                             declarations using important



 12% have greater than 50
Friday, September 10, 2010
div.error{...}




                             STYLE CLASSES
                               rather than elements




Friday, September 10, 2010

Recommended for you

Design Fast Websites
Design Fast WebsitesDesign Fast Websites
Design Fast Websites

Nicole Sullivan gives a presentation on designing fast websites. She discusses why performance matters, how websites have grown more complex over time, and how poor performance can negatively impact businesses. She provides several best practices for optimizing websites, such as creating reusable components, using consistent styles, making modules transparent, optimizing images through sprites and compression, avoiding non-standard fonts and using columns instead of rows.

f2esummit08yahooyslow
7 Habits of Exceptional Performance
7 Habits of Exceptional Performance7 Habits of Exceptional Performance
7 Habits of Exceptional Performance

The 7 Habits of Exceptional Performance discusses techniques for optimizing website performance. It recommends flushing the buffer early, using GET requests for AJAX, preloading components, avoiding filters, measuring performance metrics, and balancing new features with performance improvements. High performance should be baked into the development process from the start. Key metrics to track include page weight, response time, and HTTP requests.

businessperformancebreakthroughs
After YSlow "A"
After YSlow "A"After YSlow "A"
After YSlow "A"

The document discusses 20 additional best practices for improving web performance beyond the original 14 recommendations from YSlow. It covers techniques like flushing the buffer early, splitting components for post-loading, preloading necessary assets, reducing unnecessary DOM elements, optimizing images through techniques like converting to smaller file formats and using CSS sprites, and designing for mobile performance. The document provides examples and case studies to illustrate the recommendations and cites additional resources on web performance.

performanceyslowwebsite
X
              div.error{...}




                             STYLE CLASSES
                               rather than elements


                  .error{        most of the code goes here   }



Friday, September 10, 2010
X
              div.error{...}




                             STYLE CLASSES
                               rather than elements


        .error{                  most of the code goes here   }
     div.error{                                               }
       p.error{                         exceptions only       }
      em.error{                                               }
Friday, September 10, 2010
html body .myModule div .hd{...}
.myModule2 .hd {...}


                                 GIVE RULES THE
                                SAME STRENGTH
                             Use cascade order to overwrite previous rules




Friday, September 10, 2010
X
html body .myModule div .hd{...}
.myModule2 .hd {...}


                                 GIVE RULES THE
                                SAME STRENGTH
                             Use cascade order to overwrite previous rules



                         .myModule .hd{...}
                         .myModule2 .hd{...}

Friday, September 10, 2010

Recommended for you

1           Text


                             DUPLICATION
                                 CSS kudzu on steroids



Friday, September 10, 2010
GREP IS YOUR FRIEND
                    look at the stylesheets globally rather than per page




Friday, September 10, 2010
margin  too many? You need reset.css




Friday, September 10, 2010
518
                             declarations reset margin to zero


  64% > 10
 14% > 100
Friday, September 10, 2010

Recommended for you

float
                             too many? You need grids




Friday, September 10, 2010
733
                             declarations floated elements


  56% > 10
 13% > 100
Friday, September 10, 2010
font-size               headings may be disguised in class names




Friday, September 10, 2010
FONT-SIZE



                                889
                             declarations changed the font-size


 78% >10
 23% >100
Friday, September 10, 2010

Recommended for you

HOW DID FACEBOOK
                REDUCE DUPLICATION?
                             let’s look at an example




Friday, September 10, 2010
MEDIA BLOCK EXAMPLE




Friday, September 10, 2010
ALL OF THESE ARE THE
                       SAME OBJECT




Friday, September 10, 2010
WHAT DO WE KNOW?

                             ❖ Can be nested
                             ❖ Optional right button

                             ❖ Must clearfix




Friday, September 10, 2010

Recommended for you

WHAT DON’T WE KNOW?

                             ❖ Image width and decoration vary
                             ❖ Right content is unknown

                             ❖ Width unknown




Friday, September 10, 2010
SEPARATE STRUCTURE
                        FROM CHROME




Friday, September 10, 2010
A FEW LINES OF HTML...

            <div class="media attribution">
              <a href="http://twitter.com/stubbornella" class="img">
                <img src="mini.jpg" alt="Stubbornella" />
              </a>
              <div class="bd">@Stubbornella 14 minutes ago</div>
            </div>




Friday, September 10, 2010
4 LINES OF CSS...


                                   _




Friday, September 10, 2010

Recommended for you

Friday, September 10, 2010
HTML SIZE
                      reduced by 50%




                                   by Stefan Parker
Friday, September 10, 2010
“Due to these efforts, we cut our average
            CSS bytes per page by 19% (after gzip) and
            HTML bytes per page by 44% (before
            gzip).”



                             Jason Sobel
                             http://www.facebook.com/note.php?note_id=307069903919
Friday, September 10, 2010
LET’S KEEP TALKING...
                                  www.stubbornella.org
                                    @stubbornella




                 OOCSS Project: http://github.com/stubbornella/oocss/

Friday, September 10, 2010

Recommended for you

More Related Content

What's hot

BEM it! Introduction to BEM methodology
BEM it! Introduction to BEM methodologyBEM it! Introduction to BEM methodology
BEM it! Introduction to BEM methodology
Varya Stepanova
 
CSS For Backend Developers
CSS For Backend DevelopersCSS For Backend Developers
CSS For Backend Developers
10Clouds
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
Mario Hernandez
 
BEM it! Introduction to BEM
BEM it! Introduction to BEMBEM it! Introduction to BEM
BEM it! Introduction to BEM
Varya Stepanova
 
Html
HtmlHtml
BEM It! for Brandwatch
BEM It! for BrandwatchBEM It! for Brandwatch
BEM It! for Brandwatch
Max Shirshin
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3
Gopi A
 
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
Edureka!
 
Html & CSS
Html & CSSHtml & CSS
Html & CSS
JainilSampat
 
Basic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdfBasic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdf
Kalyani Government Engineering College
 
HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt
vaseemshaik21
 
Html and css
Html and cssHtml and css
Html and css
Sukrit Gupta
 
HTML/CSS/java Script/Jquery
HTML/CSS/java Script/JqueryHTML/CSS/java Script/Jquery
HTML/CSS/java Script/Jquery
FAKHRUN NISHA
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
Naga Harish M
 
HTML Semantic Elements
HTML Semantic ElementsHTML Semantic Elements
HTML Semantic Elements
Reema
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
Doris Chen
 
Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Java Script Object Notation (JSON)
Java Script Object Notation (JSON)
Adnan Sohail
 
Basics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointBasics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPoint
Sahil Gandhi
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
Mayur Mudgal
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
Mohammed Arif
 

What's hot (20)

BEM it! Introduction to BEM methodology
BEM it! Introduction to BEM methodologyBEM it! Introduction to BEM methodology
BEM it! Introduction to BEM methodology
 
CSS For Backend Developers
CSS For Backend DevelopersCSS For Backend Developers
CSS For Backend Developers
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
BEM it! Introduction to BEM
BEM it! Introduction to BEMBEM it! Introduction to BEM
BEM it! Introduction to BEM
 
Html
HtmlHtml
Html
 
BEM It! for Brandwatch
BEM It! for BrandwatchBEM It! for Brandwatch
BEM It! for Brandwatch
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3
 
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
 
Html & CSS
Html & CSSHtml & CSS
Html & CSS
 
Basic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdfBasic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdf
 
HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt
 
Html and css
Html and cssHtml and css
Html and css
 
HTML/CSS/java Script/Jquery
HTML/CSS/java Script/JqueryHTML/CSS/java Script/Jquery
HTML/CSS/java Script/Jquery
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
 
HTML Semantic Elements
HTML Semantic ElementsHTML Semantic Elements
HTML Semantic Elements
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Java Script Object Notation (JSON)
Java Script Object Notation (JSON)
 
Basics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointBasics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPoint
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 

Similar to CSS Bloat!

Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScriptSencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
David Kaneda
 
"Introduction Open Graph and Facebook Platform" - Facebook Developer Garage ...
"Introduction Open Graph and Facebook Platform" -  Facebook Developer Garage ..."Introduction Open Graph and Facebook Platform" -  Facebook Developer Garage ...
"Introduction Open Graph and Facebook Platform" - Facebook Developer Garage ...
Vijay Rayapati
 
WordPress Front End Optimizations
WordPress Front End OptimizationsWordPress Front End Optimizations
WordPress Front End Optimizations
Scott Taylor
 
Advanced android
Advanced androidAdvanced android
Advanced android
donnfelker
 
Dr. Strangelove: or How I learned to love HTML, CSS, and Javascript
Dr. Strangelove: or How I learned to love HTML, CSS, and JavascriptDr. Strangelove: or How I learned to love HTML, CSS, and Javascript
Dr. Strangelove: or How I learned to love HTML, CSS, and Javascript
RobotDeathSquad
 
BDD and Cucumber at barcampGZ
BDD and Cucumber at barcampGZBDD and Cucumber at barcampGZ
BDD and Cucumber at barcampGZ
leondu
 
IE9 для разработчиков
IE9 для разработчиковIE9 для разработчиков
IE9 для разработчиков
Yuriy Artyukh
 
In depth with html5 java2days 2010
In depth with html5 java2days 2010In depth with html5 java2days 2010
In depth with html5 java2days 2010
Mystic Coders, LLC
 
Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010
Zi Bin Cheah
 
Introducing Django-Servee
Introducing Django-ServeeIntroducing Django-Servee
Introducing Django-Servee
issackelly
 
From Singapore to Slovenia
From Singapore to SloveniaFrom Singapore to Slovenia
From Singapore to Slovenia
Sayanee Basu
 
Snowflake in music
Snowflake in musicSnowflake in music
Snowflake in music
Erik Duval
 
Building Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQueryBuilding Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQuery
benvinegar
 
Progressive Advancement, by way of progressive enhancement
Progressive Advancement, by way of progressive enhancementProgressive Advancement, by way of progressive enhancement
Progressive Advancement, by way of progressive enhancement
Paul Irish
 
Persistence Smoothie: Blending SQL and NoSQL (RubyNation Edition)
Persistence  Smoothie: Blending SQL and NoSQL (RubyNation Edition)Persistence  Smoothie: Blending SQL and NoSQL (RubyNation Edition)
Persistence Smoothie: Blending SQL and NoSQL (RubyNation Edition)
Michael Bleigh
 
OvertheAir 2010 html5 impact on application programming
OvertheAir 2010 html5 impact on application programmingOvertheAir 2010 html5 impact on application programming
OvertheAir 2010 html5 impact on application programming
Tor Björn Minde
 
HTML5 impact on application programming
HTML5 impact on application programmingHTML5 impact on application programming
HTML5 impact on application programming
Ericsson Labs
 
Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010
Adam Baldwin
 
DjangoCon 2009 Keynote
DjangoCon 2009 KeynoteDjangoCon 2009 Keynote
DjangoCon 2009 Keynote
Ted Leung
 
"Designing School 2.0 - Inspired by Agile Learners" - Christian Long keynote ...
"Designing School 2.0 - Inspired by Agile Learners" - Christian Long keynote ..."Designing School 2.0 - Inspired by Agile Learners" - Christian Long keynote ...
"Designing School 2.0 - Inspired by Agile Learners" - Christian Long keynote ...
Christian Long
 

Similar to CSS Bloat! (20)

Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScriptSencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
 
"Introduction Open Graph and Facebook Platform" - Facebook Developer Garage ...
"Introduction Open Graph and Facebook Platform" -  Facebook Developer Garage ..."Introduction Open Graph and Facebook Platform" -  Facebook Developer Garage ...
"Introduction Open Graph and Facebook Platform" - Facebook Developer Garage ...
 
WordPress Front End Optimizations
WordPress Front End OptimizationsWordPress Front End Optimizations
WordPress Front End Optimizations
 
Advanced android
Advanced androidAdvanced android
Advanced android
 
Dr. Strangelove: or How I learned to love HTML, CSS, and Javascript
Dr. Strangelove: or How I learned to love HTML, CSS, and JavascriptDr. Strangelove: or How I learned to love HTML, CSS, and Javascript
Dr. Strangelove: or How I learned to love HTML, CSS, and Javascript
 
BDD and Cucumber at barcampGZ
BDD and Cucumber at barcampGZBDD and Cucumber at barcampGZ
BDD and Cucumber at barcampGZ
 
IE9 для разработчиков
IE9 для разработчиковIE9 для разработчиков
IE9 для разработчиков
 
In depth with html5 java2days 2010
In depth with html5 java2days 2010In depth with html5 java2days 2010
In depth with html5 java2days 2010
 
Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010
 
Introducing Django-Servee
Introducing Django-ServeeIntroducing Django-Servee
Introducing Django-Servee
 
From Singapore to Slovenia
From Singapore to SloveniaFrom Singapore to Slovenia
From Singapore to Slovenia
 
Snowflake in music
Snowflake in musicSnowflake in music
Snowflake in music
 
Building Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQueryBuilding Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQuery
 
Progressive Advancement, by way of progressive enhancement
Progressive Advancement, by way of progressive enhancementProgressive Advancement, by way of progressive enhancement
Progressive Advancement, by way of progressive enhancement
 
Persistence Smoothie: Blending SQL and NoSQL (RubyNation Edition)
Persistence  Smoothie: Blending SQL and NoSQL (RubyNation Edition)Persistence  Smoothie: Blending SQL and NoSQL (RubyNation Edition)
Persistence Smoothie: Blending SQL and NoSQL (RubyNation Edition)
 
OvertheAir 2010 html5 impact on application programming
OvertheAir 2010 html5 impact on application programmingOvertheAir 2010 html5 impact on application programming
OvertheAir 2010 html5 impact on application programming
 
HTML5 impact on application programming
HTML5 impact on application programmingHTML5 impact on application programming
HTML5 impact on application programming
 
Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010
 
DjangoCon 2009 Keynote
DjangoCon 2009 KeynoteDjangoCon 2009 Keynote
DjangoCon 2009 Keynote
 
"Designing School 2.0 - Inspired by Agile Learners" - Christian Long keynote ...
"Designing School 2.0 - Inspired by Agile Learners" - Christian Long keynote ..."Designing School 2.0 - Inspired by Agile Learners" - Christian Long keynote ...
"Designing School 2.0 - Inspired by Agile Learners" - Christian Long keynote ...
 

More from Nicole Sullivan

Building the Media Block in ReactJS
Building the Media Block in ReactJS Building the Media Block in ReactJS
Building the Media Block in ReactJS
Nicole Sullivan
 
Why are you here?
Why are you here?Why are you here?
Why are you here?
Nicole Sullivan
 
Creating Living Style Guides to Improve Performance
Creating Living Style Guides to Improve PerformanceCreating Living Style Guides to Improve Performance
Creating Living Style Guides to Improve Performance
Nicole Sullivan
 
Don't feed the trolls
Don't feed the trollsDon't feed the trolls
Don't feed the trolls
Nicole Sullivan
 
CSS Power Tools
CSS Power ToolsCSS Power Tools
CSS Power Tools
Nicole Sullivan
 
5 Mistakes of Massive CSS
5 Mistakes of Massive CSS5 Mistakes of Massive CSS
5 Mistakes of Massive CSS
Nicole Sullivan
 
CSS Wish List @JSConf
CSS Wish List @JSConfCSS Wish List @JSConf
CSS Wish List @JSConf
Nicole Sullivan
 
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
Nicole Sullivan
 
Taming CSS Selectors
Taming CSS SelectorsTaming CSS Selectors
Taming CSS Selectors
Nicole Sullivan
 
The Fast And The Fabulous
The Fast And The FabulousThe Fast And The Fabulous
The Fast And The Fabulous
Nicole Sullivan
 
Pourquoi la performance?
Pourquoi la performance?Pourquoi la performance?
Pourquoi la performance?
Nicole Sullivan
 
Design Fast Websites
Design Fast WebsitesDesign Fast Websites
Design Fast Websites
Nicole Sullivan
 
7 Habits of Exceptional Performance
7 Habits of Exceptional Performance7 Habits of Exceptional Performance
7 Habits of Exceptional Performance
Nicole Sullivan
 
After YSlow "A"
After YSlow "A"After YSlow "A"
After YSlow "A"
Nicole Sullivan
 

More from Nicole Sullivan (14)

Building the Media Block in ReactJS
Building the Media Block in ReactJS Building the Media Block in ReactJS
Building the Media Block in ReactJS
 
Why are you here?
Why are you here?Why are you here?
Why are you here?
 
Creating Living Style Guides to Improve Performance
Creating Living Style Guides to Improve PerformanceCreating Living Style Guides to Improve Performance
Creating Living Style Guides to Improve Performance
 
Don't feed the trolls
Don't feed the trollsDon't feed the trolls
Don't feed the trolls
 
CSS Power Tools
CSS Power ToolsCSS Power Tools
CSS Power Tools
 
5 Mistakes of Massive CSS
5 Mistakes of Massive CSS5 Mistakes of Massive CSS
5 Mistakes of Massive CSS
 
CSS Wish List @JSConf
CSS Wish List @JSConfCSS Wish List @JSConf
CSS Wish List @JSConf
 
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
 
Taming CSS Selectors
Taming CSS SelectorsTaming CSS Selectors
Taming CSS Selectors
 
The Fast And The Fabulous
The Fast And The FabulousThe Fast And The Fabulous
The Fast And The Fabulous
 
Pourquoi la performance?
Pourquoi la performance?Pourquoi la performance?
Pourquoi la performance?
 
Design Fast Websites
Design Fast WebsitesDesign Fast Websites
Design Fast Websites
 
7 Habits of Exceptional Performance
7 Habits of Exceptional Performance7 Habits of Exceptional Performance
7 Habits of Exceptional Performance
 
After YSlow "A"
After YSlow "A"After YSlow "A"
After YSlow "A"
 

CSS Bloat!

  • 1. CSS BLOAT! with Nicole Sullivan Friday, September 10, 2010
  • 2. TWEET! @stubbornella Friday, September 10, 2010
  • 3. WHY OPTIMIZE CSS? • It blocks progressive rendering test: http://www.phpied.com/files/css-loading/table.php • It’s verbose (property value pairs cannot be minified like JS) text-decoration: underline != td: u Friday, September 10, 2010
  • 4. TOP 1000 STUDY 1. Grab top Alexa sites 2. Start Fiddler 3. Load each site 4. Export from Fiddler Friday, September 10, 2010
  • 5. <?php $file = file('alexa.txt'); foreach ($file as $url) { launch($url); } function launch($url) { try { $ie = new COM("InternetExplorer.Application"); $ie->Visible = true; $ie->Navigate2($url); while ($ie->ReadyState != 4) sleep(1); $ie->Quit(); } catch (Exception $e) {} } ?> Friday, September 10, 2010
  • 6. 42% DON’T GZIP CSS Friday, September 10, 2010
  • 7. 44% HAVE MORE THAN 2 CSS FILES 56% 44% Friday, September 10, 2010
  • 8. 56% SERVE CSS WITH COOKIES Friday, September 10, 2010
  • 9. 62% DON’T MINIFY would get more than 10% savings from YUI compressor Friday, September 10, 2010
  • 10. 21% HAVE >100K OF CSS 21% 11% 11% 44% 24% Friday, September 10, 2010
  • 11. HASTE TRACE-BASED PACKAGING homepage homepage Date CSS files CSS weight files weight Nov 2008 487 1.7MB 24 69KB May 2009 706 1.9MB 15 64KB http://velocityconference.blip.tv/file/2293221/ David Wei & Changhao Jiang Friday, September 10, 2010
  • 12. KUDZU Was introduced to the United States between 1935 and 1950 by the Soil Conservation Service to prevent soil erosion. Friday, September 10, 2010
  • 14. “OBJECT ORIENTED CSS SOUNDS GREAT, BUT WE HAVE A GIANT MESS!” how do we get from here to there? Friday, September 10, 2010
  • 15. FACEBOOK DECIDED TO GO ON A DIET The CSS was one piece of the puzzle Friday, September 10, 2010
  • 16. Jason Sobel - Perf Manager Fu MANY PIECES Nan Gao Kyle Delong - PHP David Wei & Changhao Jiang BigPipe Marcel Laverdet - Tom Occhino - JS XHP Makinde Shaun McIntyre - Adeagbo - JS Automated Spriting Friday, September 10, 2010
  • 17. THEY REDUCED THEIR RESPONSE TIME BY HALF in only six months Friday, September 10, 2010
  • 18. WHAT IS OBJECT ORIENTED CSS? A philosophy? A framework? A tool? Friday, September 10, 2010
  • 19. MORE LIKE AN EVOLUTION OF THE LANGUAGE it makes CSS more powerful Friday, September 10, 2010
  • 20. HOW IS IT DIFFERENT? ul{...} ul li{...} ul li a{...} Friday, September 10, 2010
  • 21. HOW IS IT DIFFERENT? ul{...} ul li{...} ul li a{...} Until now, we focused all our effort here Friday, September 10, 2010
  • 22. HOW IS IT DIFFERENT? ul{...} ul li{...} ul li a{...} But, the architecture lives here Friday, September 10, 2010
  • 23. MUCH LESS CODE easier to work with newbies Friday, September 10, 2010
  • 24. GRIDS • 574 bytes • 14 lines of code • Percentage widths adapt to different page sizes • Includes halfs, thirds, fourths, and fifths • No gutters • Infinite nesting and stacking Friday, September 10, 2010
  • 25. GRANULARITY FAIL + STALE RULES + UNPREDICTABILITY + DUPLICATION + SPECIFICITY WARS = MASSIVE CSS Friday, September 10, 2010
  • 26. 5 Text GRANULARITY FAIL the CSS objects shouldn’t match the PHP objects Friday, September 10, 2010
  • 32. WE WANT TO DO THE SAME THING WITH CSS Friday, September 10, 2010
  • 33. CREATE THE BUILDING BLOCKS Friday, September 10, 2010
  • 34. MOST SITES GET THE GRANULARITY WRONG and their architecture is set up to fail Friday, September 10, 2010
  • 35. HOW? FIRST, A VISUAL INVENTORY Friday, September 10, 2010
  • 36. TAKE A PHP OBJECT Friday, September 10, 2010
  • 37. BREAK IT DOWN Friday, September 10, 2010
  • 38. 7 SMALLER OBJECTS Friday, September 10, 2010
  • 40. HEADINGS Heading - 16px bold #3B5998 Heading - 16px normal #333333 Heading - 15px bold #3B5998 • 12px headings eliminated Heading - 15px normal #333333 Heading - 14px bold #3B5998 • Blue only for links Heading - 14px normal #333333 Heading - 13px bold #3B5998 • Bold for all titles Heading - 13px normal #333333 • Chad Little went through Heading - 11px bold #3B5998 the entire site eliminating Heading - 11px normal #333333 duplicates. Friday, September 10, 2010
  • 41. IT’S ALL ABOUT PATTERN MATCHING but you have to take a step back Friday, September 10, 2010
  • 42. PHP OBJECTS != CSS OBJECTS you will be tempted, beware! Friday, September 10, 2010
  • 43. 4 Text STALE RULES CSS gets crufty Friday, September 10, 2010
  • 44. STALE IS TWO THINGS ❖ Truly stale - rules that are no longer used on the site ❖ Rules used on subsequent PV or activated on user action Friday, September 10, 2010
  • 45. WHAT KIND DO YOU HAVE? Friday, September 10, 2010
  • 46. WHAT KIND DO YOU HAVE? ❖ Try dust-me selectors Friday, September 10, 2010
  • 47. WHAT KIND DO YOU HAVE? ❖ Try dust-me selectors ❖ Track them over time - ‣ changes are more important than an absolute number Friday, September 10, 2010
  • 48. 3 Text UNPREDICTABILITY Make each object predictable and location independent Friday, September 10, 2010
  • 51. A Heading should not become a Heading in another part of the page. Friday, September 10, 2010
  • 52. AVOID EXAMPLE #weatherModule h3{color:red;} #tabs h3{color:blue} ❖ Global color undefined for h3, so it will be ‣ unstyled in new modules, ‣ developers forced to write more CSS for the same style Friday, September 10, 2010
  • 53. HOW DO YOU TEST FOR UNPREDICTABLE CODE? #foo h3{...} #bar h3{...} #baz h3{...} grep h[1-6] Friday, September 10, 2010
  • 54. h1-h6 How many? You need site-wide headings Friday, September 10, 2010
  • 55. 511 declarations setting styles for h1-h6 56% >10 9% >100 Friday, September 10, 2010
  • 56. HEADINGS BEFORE 958 declarations h1-h6 Facebook Friday, September 10, 2010
  • 57. HEADINGS AFTER: 25 Chad Little - Facebook Friday, September 10, 2010
  • 58. 2 Text SPECIFICITY WARS lobbing specificity grenades over the cube wall Friday, September 10, 2010
  • 59. SPECIFICITY SCREWS UP THE CASCADE and the cascade kind of rocks, so how do we use the good parts? Friday, September 10, 2010
  • 61. .mod .hd{...} .ie .mod .hd{...} .weatherMod .hd {...} USE HACKS SPARINGLY And don’t let them change your specificity Friday, September 10, 2010
  • 62. .mod .hd{...} X .ie .mod .hd{...} .weatherMod .hd {...} USE HACKS SPARINGLY And don’t let them change your specificity .mod .hd{color: red; _zoom:1;} .weatherMod .hd{...} Friday, September 10, 2010
  • 63. #navigation{...} #header{...} AVOID STYLING IDS IDs impact specificity and can’t be reused IDs are for JS Friday, September 10, 2010
  • 64. X #navigation{...} #header{...} AVOID STYLING IDS IDs impact specificity and can’t be reused IDs are for JS Friday, September 10, 2010
  • 65. .nav {color: red !important;} AVOID !IMPORTANT except on leaf nodes Friday, September 10, 2010
  • 66. .nav {color: red !important;} X AVOID !IMPORTANT except on leaf nodes Friday, September 10, 2010
  • 67. !IMPORTANT 518 declarations using important 12% have greater than 50 Friday, September 10, 2010
  • 68. div.error{...} STYLE CLASSES rather than elements Friday, September 10, 2010
  • 69. X div.error{...} STYLE CLASSES rather than elements .error{ most of the code goes here } Friday, September 10, 2010
  • 70. X div.error{...} STYLE CLASSES rather than elements .error{ most of the code goes here } div.error{ } p.error{ exceptions only } em.error{ } Friday, September 10, 2010
  • 71. html body .myModule div .hd{...} .myModule2 .hd {...} GIVE RULES THE SAME STRENGTH Use cascade order to overwrite previous rules Friday, September 10, 2010
  • 72. X html body .myModule div .hd{...} .myModule2 .hd {...} GIVE RULES THE SAME STRENGTH Use cascade order to overwrite previous rules .myModule .hd{...} .myModule2 .hd{...} Friday, September 10, 2010
  • 73. 1 Text DUPLICATION CSS kudzu on steroids Friday, September 10, 2010
  • 74. GREP IS YOUR FRIEND look at the stylesheets globally rather than per page Friday, September 10, 2010
  • 75. margin too many? You need reset.css Friday, September 10, 2010
  • 76. 518 declarations reset margin to zero 64% > 10 14% > 100 Friday, September 10, 2010
  • 77. float too many? You need grids Friday, September 10, 2010
  • 78. 733 declarations floated elements 56% > 10 13% > 100 Friday, September 10, 2010
  • 79. font-size headings may be disguised in class names Friday, September 10, 2010
  • 80. FONT-SIZE 889 declarations changed the font-size 78% >10 23% >100 Friday, September 10, 2010
  • 81. HOW DID FACEBOOK REDUCE DUPLICATION? let’s look at an example Friday, September 10, 2010
  • 82. MEDIA BLOCK EXAMPLE Friday, September 10, 2010
  • 83. ALL OF THESE ARE THE SAME OBJECT Friday, September 10, 2010
  • 84. WHAT DO WE KNOW? ❖ Can be nested ❖ Optional right button ❖ Must clearfix Friday, September 10, 2010
  • 85. WHAT DON’T WE KNOW? ❖ Image width and decoration vary ❖ Right content is unknown ❖ Width unknown Friday, September 10, 2010
  • 86. SEPARATE STRUCTURE FROM CHROME Friday, September 10, 2010
  • 87. A FEW LINES OF HTML... <div class="media attribution"> <a href="http://twitter.com/stubbornella" class="img"> <img src="mini.jpg" alt="Stubbornella" /> </a> <div class="bd">@Stubbornella 14 minutes ago</div> </div> Friday, September 10, 2010
  • 88. 4 LINES OF CSS... _ Friday, September 10, 2010
  • 90. HTML SIZE reduced by 50% by Stefan Parker Friday, September 10, 2010
  • 91. “Due to these efforts, we cut our average CSS bytes per page by 19% (after gzip) and HTML bytes per page by 44% (before gzip).” Jason Sobel http://www.facebook.com/note.php?note_id=307069903919 Friday, September 10, 2010
  • 92. LET’S KEEP TALKING... www.stubbornella.org @stubbornella OOCSS Project: http://github.com/stubbornella/oocss/ Friday, September 10, 2010