SlideShare a Scribd company logo
WISH
                               CSS



Friday, November 11, 2011
                            TOOLS
@STUBBORNELLA
                            What CSS tool would you love to have?




Friday, November 11, 2011
Friday, November 11, 2011
GITHUB.COM
                            free for open source projects




Friday, November 11, 2011
FRAMEWORKS
                            organize code into logical abstractions




Friday, November 11, 2011
Friday, November 11, 2011
Friday, November 11, 2011
Friday, November 11, 2011
Friday, November 11, 2011
GRIDS
            Abstract layout, remove
             duplication, improve
                 performance




Friday, November 11, 2011
OOCSS
     GRIDS



                            http://www.stubbornella.org/content/2011/01/22/grids-improve-site-performance/
Friday, November 11, 2011
MEDIA BLOCK EXAMPLE




Friday, November 11, 2011
ALL OF THESE ARE THE
                       SAME OBJECT




Friday, November 11, 2011
WHAT DO WE KNOW?

                            ❖ Can be nested
                            ❖ Optional right button

                            ❖ Must clearfix




Friday, November 11, 2011
WHAT DON’T WE KNOW?

                            ❖ Image width and decoration vary
                            ❖ Right content is unknown

                            ❖ Width unknown




Friday, November 11, 2011
SEPARATE STRUCTURE
                        FROM CHROME




Friday, November 11, 2011
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, November 11, 2011
4 LINES OF CSS...


                                  _




Friday, November 11, 2011
Friday, November 11, 2011
HTML SIZE
                      reduced by 50%




                                   by Stefan Parker
Friday, November 11, 2011
“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, November 11, 2011
GET THE MEDIA BLOCK:
       https://github.com/stubbornella/oocss/tree/master/core/media




Friday, November 11, 2011
PREPROCESSORS
                            server-side CSS language additions




Friday, November 11, 2011
Friday, November 11, 2011
Friday, November 11, 2011
Friday, November 11, 2011
Friday, November 11, 2011
Mixins are for classes that are too presentational




Friday, November 11, 2011
Extends adds structure to your CSS

           Extends
           Tell one selector to inherit all the styles of another without duplicating the CSS properties.


                            // SASS                                       // compiled CSS
                .message {
                  border: 1px solid #f00;                           .message, .error, .warn {
                  background: #fdd;                                   border: 1px solid #f00;
                }                                                     background: #fdd;
                .error {                                            }
                  @extend .message;                                 .error {
                  border-color: red;                                  border-color: red;
                  background-color: red;                              background-color: red;
                }                                                   }

                .warn {                                             .warn {
                  @extend .message;                                   border-color: yellow;
                  border-color: yellow;                             }
                }




Friday, November 11, 2011
GRADIENT TOOLS
                            make converting sites to CSS3 so much faster




Friday, November 11, 2011
by Lea Verou
Friday, November 11, 2011
but the syntax is very
                            very ugly, and unstable




Friday, November 11, 2011
Friday, November 11, 2011
Friday, November 11, 2011
Friday, November 11, 2011
COLORZILLA TOOL
                            http://www.colorzilla.com/gradient-editor/




Friday, November 11, 2011
CHROME DEV TOOLS
                            are the new firebug




Friday, November 11, 2011
Friday, November 11, 2011
Friday, November 11, 2011
Friday, November 11, 2011
NORMALIZE.CSS
                               is the new reset




                                       A	
  project	
  by	
  Nicolas	
  Gallagher	
  and	
  Jonathan	
  Neal.

Friday, November 11, 2011
HOW MANY PEOPLE HAVE
    TRIED A RESET STYLESHEET?
                            like the one by Eric Meyer or in YUI




Friday, November 11, 2011
Friday, November 11, 2011
Friday, November 11, 2011
THE GOAL IS TO HAVE THE
            SAME STYLES
                            across all browsers




Friday, November 11, 2011
Friday, November 11, 2011
by James Butler - http://www.flickr.com/photos/slimjim/5004687965/
Friday, November 11, 2011
IT’S NOT
                                                                  THAT YOU
                                                                    CAN’T
                                                                  but it might be overkill?




Kevin Walsh - http://www.flickr.com/photos/kev_walsh/2216144544/
Friday, November 11, 2011
Friday, November 11, 2011
Friday, November 11, 2011
Friday, November 11, 2011
CSS LINT
                            beyond validation




Friday, November 11, 2011
THE FLAVOR OF
                              DUPLICATION
                            Find yours and you’ll find your solution.


                                 http://www.flickr.com/photos/the_justified_sinner/4694158195/sizes/l/in/photostream/
Friday, November 11, 2011
Friday, November 11, 2011
CHOOSE THE RULES
                            RELEVANT TO YOU
              Our goal is to allow custom rulesets, for example, the
            Salesforce.com custom rules, or special rules for your blog
Friday, November 11, 2011
OUTPUT
                            searchable, sortable

Friday, November 11, 2011
ERRORS HIGHLIGHTED
                       IN CONTEXT
                            In this case, don’t use !important

Friday, November 11, 2011
MAKE UP YOUR OWN
                          RULES!




Friday, November 11, 2011
EASIER THAN YOU THINK!

    1. Download source from:
       github.com/stubbornella/csslint

    2. Find a rule that does
       something similar to what you
       want to do. e.g. the rule tests
       for a property value pair and
       you want to test for a different
       property and value

    3. Copy! Seriously.

Friday, November 11, 2011
TEXT-INDENT EXAMPLE
                                                   Name the
                                                  rule, and give
                                                     it an id



 Add the rule to                             Describe the rule
   CSS Lint
                             Tell CSS Lint
                            which browsers
                             are affected.

Friday, November 11, 2011
TEXT-INDENT EXAMPLE



      Make the rule listen to
                                Try:
         the parts of the
                                • startstylesheet,
       stylesheet you care
                                • endstylesheet,
        about. In this case,
                                • startrule,
            properties.
                                • endrule, etc

Friday, November 11, 2011
TEXT-INDENT EXAMPLE




             Get the property   And the value



Friday, November 11, 2011
TEXT-INDENT EXAMPLE
       Test if the property is                    And the value is
             text-indent                          less than -99




     If text indent is being used to hide text,
    send the reporter a message that it may
                fail in RTL languages.


Friday, November 11, 2011
TEXT-INDENT EXAMPLE




      Make sure to tell CSS Lint the
       line, column, and rule so the
          user can find their error.

Friday, November 11, 2011
WRITE TESTS FOR YOUR
                       TEST ;)
 Give CSS Lint some CSS
         to test




                                       Tell us how many
                                       errors are in that
            This helps everyone work
                                              CSS.
                     together.

Friday, November 11, 2011
USE CSS LINT TO TEST FOR
            DUPLICATION

                            • floats

                            • headings

                            • font-sizes

                            • color   values coming soon!

                            • padding   & margins coming soon!

Friday, November 11, 2011
BUILD AND SHARE TOOLS
     THAT YOU WANT TO EXIST!
                            you’ll learn so much from open source.




Friday, November 11, 2011
LET’S KEEP TALKING...
                                  http://stubbornella.org
                                      @stubbornella


                            http://github.com/stubbornella/oocss/
                    http://groups.google.com/group/object-oriented-css


Friday, November 11, 2011

More Related Content

PPT
Basketball Powerpoint
PPTX
Grade 8: Music Cambodian Music
PDF
Ia mechanical-drafting-tg-grade-7-8-p-d
PPTX
Volleyball Positions
PPTX
Presentation of Joins In Database
PDF
He bread and pastry production cg
PPTX
Trainers methodology (TM) Level I.pptx
PPTX
CSS 10 Q1 Week 2 Day 2-Materials, Tools, Devices and Equipment.pptx
Basketball Powerpoint
Grade 8: Music Cambodian Music
Ia mechanical-drafting-tg-grade-7-8-p-d
Volleyball Positions
Presentation of Joins In Database
He bread and pastry production cg
Trainers methodology (TM) Level I.pptx
CSS 10 Q1 Week 2 Day 2-Materials, Tools, Devices and Equipment.pptx

What's hot (7)

PDF
1.1 elements and principles of Art.pdf
PPT
Volleyball skills
PDF
K to 12 PC Hardware Servicing Learning Module
PPTX
Task Identfication.pptx
PPTX
Lesson 7_Practice Occupational Health and Safety Procedures (LO1)
PDF
K to 12 household services learning module
PDF
Computer Hardware-servicing-learning-module
1.1 elements and principles of Art.pdf
Volleyball skills
K to 12 PC Hardware Servicing Learning Module
Task Identfication.pptx
Lesson 7_Practice Occupational Health and Safety Procedures (LO1)
K to 12 household services learning module
Computer Hardware-servicing-learning-module
Ad

Viewers also liked (20)

KEY
Object Oriented CSS
PDF
[译]Efficient, maintainable CSS
PPTX
CSS introduction
PDF
CSS Bloat!
PDF
CSS: a rapidly changing world
PDF
제 5회 DGMIT R&D 컨퍼런스: JavsScript Event Bubbling & Capturing
PDF
Our Best Practices Are Killing Us
ODP
How to Make HTML and CSS Files
PPTX
HTML CSS | Computer Science
PDF
Efficient, maintainable CSS
PDF
Compose Async with RxJS
PDF
Angular2 ecosystem
DOC
BÀI 19 NHÂN DÂN VIỆT NAM KHÁNG CHIẾN CHỐNG PHÁP XÂM LƯỢC (Từ năm 1858 đến t...
PDF
System webpack-jspm
PDF
CSS - OOCSS, SMACSS and more
PPTX
Cascading Style Sheets - CSS
PDF
Ionic adventures - Hybrid Mobile App Development rocks
PPTX
HTML, CSS and Java Scripts Basics
PPTX
Css grid-layout
PDF
Module, AMD, RequireJS
Object Oriented CSS
[译]Efficient, maintainable CSS
CSS introduction
CSS Bloat!
CSS: a rapidly changing world
제 5회 DGMIT R&D 컨퍼런스: JavsScript Event Bubbling & Capturing
Our Best Practices Are Killing Us
How to Make HTML and CSS Files
HTML CSS | Computer Science
Efficient, maintainable CSS
Compose Async with RxJS
Angular2 ecosystem
BÀI 19 NHÂN DÂN VIỆT NAM KHÁNG CHIẾN CHỐNG PHÁP XÂM LƯỢC (Từ năm 1858 đến t...
System webpack-jspm
CSS - OOCSS, SMACSS and more
Cascading Style Sheets - CSS
Ionic adventures - Hybrid Mobile App Development rocks
HTML, CSS and Java Scripts Basics
Css grid-layout
Module, AMD, RequireJS
Ad

Similar to CSS Power Tools (20)

PDF
永不止步的“重构”
KEY
Greach 2011 - Engrandeciendo Grails con MongoDB
PDF
Conquistando el Servidor con Node.JS
PDF
Caridy patino - node-js
PDF
Web Scraping using Diazo!
PDF
The Fast, The Slow and the Lazy
PDF
Layer 7 denial of services attack mitigation
PDF
CSS3 - Novo contexto
KEY
Social design (Seattle 09-2011)
PDF
Open Source - DevInVale 2011
PDF
Clouds against the Floods (RubyConfBR2011)
PDF
The Easy Way - Plone Conference 2011
PDF
Online journalism: thinking about platforms
PDF
How I Learned To Stop Worrying & Love HTML5
PDF
Taking SM to Next Level - Governor's Conference 2011
PDF
Practical Cloud Security
PDF
Mobile? WT... F?
PDF
Knowing is Half the Battle
PDF
JS Tooling in Rails 3.1
PDF
3D in the Browser via WebGL: It's Go Time
永不止步的“重构”
Greach 2011 - Engrandeciendo Grails con MongoDB
Conquistando el Servidor con Node.JS
Caridy patino - node-js
Web Scraping using Diazo!
The Fast, The Slow and the Lazy
Layer 7 denial of services attack mitigation
CSS3 - Novo contexto
Social design (Seattle 09-2011)
Open Source - DevInVale 2011
Clouds against the Floods (RubyConfBR2011)
The Easy Way - Plone Conference 2011
Online journalism: thinking about platforms
How I Learned To Stop Worrying & Love HTML5
Taking SM to Next Level - Governor's Conference 2011
Practical Cloud Security
Mobile? WT... F?
Knowing is Half the Battle
JS Tooling in Rails 3.1
3D in the Browser via WebGL: It's Go Time

More from Nicole Sullivan (14)

PDF
Building the Media Block in ReactJS
PDF
Why are you here?
PDF
Creating Living Style Guides to Improve Performance
PDF
Don't feed the trolls
PDF
5 Mistakes of Massive CSS
KEY
CSS Wish List @JSConf
KEY
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
KEY
Taming CSS Selectors
KEY
The Fast And The Fabulous
KEY
What is Object Oriented CSS?
PDF
Pourquoi la performance?
PDF
Design Fast Websites
PDF
7 Habits of Exceptional Performance
PPT
After YSlow "A"
Building the Media Block in ReactJS
Why are you here?
Creating Living Style Guides to Improve Performance
Don't feed the trolls
5 Mistakes of Massive CSS
CSS Wish List @JSConf
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
Taming CSS Selectors
The Fast And The Fabulous
What is Object Oriented CSS?
Pourquoi la performance?
Design Fast Websites
7 Habits of Exceptional Performance
After YSlow "A"

Recently uploaded (20)

PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PDF
DevOps & Developer Experience Summer BBQ
PDF
Event Presentation Google Cloud Next Extended 2025
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Newfamily of error-correcting codes based on genetic algorithms
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Cloud computing and distributed systems.
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PDF
REPORT: Heating appliances market in Poland 2024
PDF
SAP855240_ALP - Defining the Global Template PUBLIC.pdf
PDF
Electronic commerce courselecture one. Pdf
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
DevOps & Developer Experience Summer BBQ
Event Presentation Google Cloud Next Extended 2025
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Newfamily of error-correcting codes based on genetic algorithms
Understanding_Digital_Forensics_Presentation.pptx
Cloud computing and distributed systems.
Sensors and Actuators in IoT Systems using pdf
NewMind AI Monthly Chronicles - July 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
cuic standard and advanced reporting.pdf
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
REPORT: Heating appliances market in Poland 2024
SAP855240_ALP - Defining the Global Template PUBLIC.pdf
Electronic commerce courselecture one. Pdf

CSS Power Tools

  • 1. WISH CSS Friday, November 11, 2011 TOOLS
  • 2. @STUBBORNELLA What CSS tool would you love to have? Friday, November 11, 2011
  • 4. GITHUB.COM free for open source projects Friday, November 11, 2011
  • 5. FRAMEWORKS organize code into logical abstractions Friday, November 11, 2011
  • 10. GRIDS Abstract layout, remove duplication, improve performance Friday, November 11, 2011
  • 11. OOCSS GRIDS http://www.stubbornella.org/content/2011/01/22/grids-improve-site-performance/ Friday, November 11, 2011
  • 12. MEDIA BLOCK EXAMPLE Friday, November 11, 2011
  • 13. ALL OF THESE ARE THE SAME OBJECT Friday, November 11, 2011
  • 14. WHAT DO WE KNOW? ❖ Can be nested ❖ Optional right button ❖ Must clearfix Friday, November 11, 2011
  • 15. WHAT DON’T WE KNOW? ❖ Image width and decoration vary ❖ Right content is unknown ❖ Width unknown Friday, November 11, 2011
  • 16. SEPARATE STRUCTURE FROM CHROME Friday, November 11, 2011
  • 17. 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, November 11, 2011
  • 18. 4 LINES OF CSS... _ Friday, November 11, 2011
  • 20. HTML SIZE reduced by 50% by Stefan Parker Friday, November 11, 2011
  • 21. “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, November 11, 2011
  • 22. GET THE MEDIA BLOCK: https://github.com/stubbornella/oocss/tree/master/core/media Friday, November 11, 2011
  • 23. PREPROCESSORS server-side CSS language additions Friday, November 11, 2011
  • 28. Mixins are for classes that are too presentational Friday, November 11, 2011
  • 29. Extends adds structure to your CSS Extends Tell one selector to inherit all the styles of another without duplicating the CSS properties. // SASS // compiled CSS .message { border: 1px solid #f00; .message, .error, .warn { background: #fdd; border: 1px solid #f00; } background: #fdd; .error { } @extend .message; .error { border-color: red; border-color: red; background-color: red; background-color: red; } } .warn { .warn { @extend .message; border-color: yellow; border-color: yellow; } } Friday, November 11, 2011
  • 30. GRADIENT TOOLS make converting sites to CSS3 so much faster Friday, November 11, 2011
  • 31. by Lea Verou Friday, November 11, 2011
  • 32. but the syntax is very very ugly, and unstable Friday, November 11, 2011
  • 36. COLORZILLA TOOL http://www.colorzilla.com/gradient-editor/ Friday, November 11, 2011
  • 37. CHROME DEV TOOLS are the new firebug Friday, November 11, 2011
  • 41. NORMALIZE.CSS is the new reset A  project  by  Nicolas  Gallagher  and  Jonathan  Neal. Friday, November 11, 2011
  • 42. HOW MANY PEOPLE HAVE TRIED A RESET STYLESHEET? like the one by Eric Meyer or in YUI Friday, November 11, 2011
  • 45. THE GOAL IS TO HAVE THE SAME STYLES across all browsers Friday, November 11, 2011
  • 47. by James Butler - http://www.flickr.com/photos/slimjim/5004687965/ Friday, November 11, 2011
  • 48. IT’S NOT THAT YOU CAN’T but it might be overkill? Kevin Walsh - http://www.flickr.com/photos/kev_walsh/2216144544/ Friday, November 11, 2011
  • 52. CSS LINT beyond validation Friday, November 11, 2011
  • 53. THE FLAVOR OF DUPLICATION Find yours and you’ll find your solution. http://www.flickr.com/photos/the_justified_sinner/4694158195/sizes/l/in/photostream/ Friday, November 11, 2011
  • 55. CHOOSE THE RULES RELEVANT TO YOU Our goal is to allow custom rulesets, for example, the Salesforce.com custom rules, or special rules for your blog Friday, November 11, 2011
  • 56. OUTPUT searchable, sortable Friday, November 11, 2011
  • 57. ERRORS HIGHLIGHTED IN CONTEXT In this case, don’t use !important Friday, November 11, 2011
  • 58. MAKE UP YOUR OWN RULES! Friday, November 11, 2011
  • 59. EASIER THAN YOU THINK! 1. Download source from: github.com/stubbornella/csslint 2. Find a rule that does something similar to what you want to do. e.g. the rule tests for a property value pair and you want to test for a different property and value 3. Copy! Seriously. Friday, November 11, 2011
  • 60. TEXT-INDENT EXAMPLE Name the rule, and give it an id Add the rule to Describe the rule CSS Lint Tell CSS Lint which browsers are affected. Friday, November 11, 2011
  • 61. TEXT-INDENT EXAMPLE Make the rule listen to Try: the parts of the • startstylesheet, stylesheet you care • endstylesheet, about. In this case, • startrule, properties. • endrule, etc Friday, November 11, 2011
  • 62. TEXT-INDENT EXAMPLE Get the property And the value Friday, November 11, 2011
  • 63. TEXT-INDENT EXAMPLE Test if the property is And the value is text-indent less than -99 If text indent is being used to hide text, send the reporter a message that it may fail in RTL languages. Friday, November 11, 2011
  • 64. TEXT-INDENT EXAMPLE Make sure to tell CSS Lint the line, column, and rule so the user can find their error. Friday, November 11, 2011
  • 65. WRITE TESTS FOR YOUR TEST ;) Give CSS Lint some CSS to test Tell us how many errors are in that This helps everyone work CSS. together. Friday, November 11, 2011
  • 66. USE CSS LINT TO TEST FOR DUPLICATION • floats • headings • font-sizes • color values coming soon! • padding & margins coming soon! Friday, November 11, 2011
  • 67. BUILD AND SHARE TOOLS THAT YOU WANT TO EXIST! you’ll learn so much from open source. Friday, November 11, 2011
  • 68. LET’S KEEP TALKING... http://stubbornella.org @stubbornella http://github.com/stubbornella/oocss/ http://groups.google.com/group/object-oriented-css Friday, November 11, 2011