SlideShare ist ein Scribd-Unternehmen logo
1 von 57
Downloaden Sie, um offline zu lesen
OBJECT-ORIENTED
                          UNOBTRUSIVE CSS




Saturday, July 17, 2010                     1
OBJECT-ORIENTED
                          UNOBTRUSIVE CSS




Saturday, July 17, 2010                     2
JOHN HWANG
                          CEO @ MUTUALLY HUMAN




Saturday, July 17, 2010                          3
MUTUALLY HUMAN is   an expert custom
                 software strategy & design consultancy
                 specializing in mobile & web-based
                 products & services.




Saturday, July 17, 2010                                   4
Saturday, July 17, 2010   5
ERIC MEYER
                          "Semantic Frameworks are a game-changer."




Saturday, July 17, 2010                                               6
RAILS 3.1
                          Preprocessors for JavaScript and CSS




Saturday, July 17, 2010                                          7
Saturday, July 17, 2010   8
UNOBTRUSIVE CSS




Saturday, July 17, 2010                     9
ASSUMPTIONS

    • Write               beautiful and valid markup

    • Mostly              Use Semantic Markup & Class/ID Names

    • Agree  that separate of content, presentation and behavior is a
        Good Thing®

    • Appreciate               Unobtrusive JavaScript

    • Aware               of


Saturday, July 17, 2010                                                 10
WHAT IS UNOBTRUSIVE CSS?

                 • True    separation of presentation and content

                 • No     presentational classes in your HTML




Saturday, July 17, 2010                                             11
THIS IS PRETTY CLEAN, BUT...




Saturday, July 17, 2010                  12
WHY BUILD UNOBTRUSIVE
                  STYLESHEETS?
                 • Implementation     is faster

                 • Changing    design is faster

                 • More   flexibility for theming and alternate stylesheets

                 • Redesigns   made easier

                 • Better   SEO




Saturday, July 17, 2010                                                      13
UNOBTRUSIVE CSS IS HARD




Saturday, July 17, 2010              14
WHAT MAKES UNOBTRUSIVE
               HARD?
                          The issues with current CSS techniques




Saturday, July 17, 2010                                            15
REPETITIVE SELECTORS
                                  Not DRY




Saturday, July 17, 2010                          16
Saturday, July 17, 2010   17
CSS LACKS ABSTRACTION
                          Classes are not for style reuse




Saturday, July 17, 2010                                     18
DIFFICULT TO CONTROL
                           LAYOUT
    • Grid   Layouts are great, but requires a lot of careful pre-
        planning

    • Must                manually calculate widths and dimensions

    • Internet              Explorer




Saturday, July 17, 2010                                              19
EFFICIENCY/
               ORGANIZATIONAL ISSUES
    • IE       imposes a maximum limit of 31 individual stylesheets




Saturday, July 17, 2010                                               20
WHAT DOES THIS ALL MEAN?
    • Code                Reuse is almost non-existent

    • Code                Organization is non-existent

    • File         size just keep getting bigger

    • Very   difficult to create a sensible easy to understand CSS
        system

    • Difficult              to maintain or change



Saturday, July 17, 2010                                             21
CSS FRAMEWORKS
                          Blueprint CSS, 960 Grid, YUI and many more...




Saturday, July 17, 2010                                                   22
CSS FRAMEWORKS
                 GAINED SOME TRACTION
    • Promoted                  Grid Layout

    • Best            Practices

    • Sensible             Defaults

    • Reset               CSS

    • Typography




Saturday, July 17, 2010                       23
Saturday, July 17, 2010   24
PROBLEM WITH CSS
                               FRAMEWORKS
    • Nothing                more than a collection of CSS snippets

    • Tight               coupling of presentation and content

    • Almost                as bad as using <table> for layout




Saturday, July 17, 2010                                               25
HISTORY LESSON
                          Evolution of Programming Languages

Saturday, July 17, 2010                                        26
EVOLUTION OF
      PROGRAMMING LANGUAGES
    • Punchcards/Assembly             Language

    • Procedural             Code (C/Cobol/Fortran)

    • Object              Oriented Code (Java/C#/C++/Ruby)

    • The All             Compile Down to Assembly Language




Saturday, July 17, 2010                                       27
EVOLUTION OF CSS
                            DEVELOPMENT
    • CSS

    • CSS            Frameworks

    • Semantic/Meta          Frameworks

         • Compiles        down to CSS




Saturday, July 17, 2010                      28
SEMANTIC/META
                           FRAMEWORKS




Saturday, July 17, 2010                   29
WHAT ARE CSS META
                            FRAMEWORKS?
              CSS, plus nested rules, variables, mixins, and more, all in a
                              concise, readable syntax




Saturday, July 17, 2010                                                       30
SASS
                          "Syntactically Awesome Style Sheets"



Saturday, July 17, 2010                                          31
WHAT IS SASS?

    • Nested              Rules

    • Variables

    • Mixins

    • Compiles             & Outputs CSS

    • Fully           CSS3-compatible (SCSS Syntax)



Saturday, July 17, 2010                               32
CSS3 COMPATIBLE




Saturday, July 17, 2010                     33
VARIABLES




Saturday, July 17, 2010               34
NESTING




Saturday, July 17, 2010             35
MIXIN




Saturday, July 17, 2010           36
SELECTOR INHERITANCE




Saturday, July 17, 2010                    37
HOW DOES SASS MAKE
                   UNOBTRUSIVE CSS EASY?
                           Case Study




Saturday, July 17, 2010                    38
STAGE 1




Saturday, July 17, 2010             39
Saturday, July 17, 2010   40
BETTER YET...



Saturday, July 17, 2010                   41
Saturday, July 17, 2010   42
STAGE 2
      Implement new shell to house legacy content and new content




Saturday, July 17, 2010                                             43
NAMESPACE LEGACY CSS
                          50+ legacy css files




Saturday, July 17, 2010                         44
NESTED RULES FTW!
                           CSS to SASS converter script FTW!




Saturday, July 17, 2010                                        45
Saturday, July 17, 2010   46
ELIMINATED ALL
              PRESENTATIONAL CLASSES




Saturday, July 17, 2010                47
Saturday, July 17, 2010   48
NESTED RULES MAKES CSS
                   MORE CONCISE




Saturday, July 17, 2010                 49
EFFICIENCY/ORGANIZATIONAL ISSUES
                          Imports are compiled down to 1 single CSS file




Saturday, July 17, 2010                                                   50
OTHER BENEFITS OF
                              COMPILATION
    • Environment-dependent               output formats

    • Partials             & imports

    • Silent              comments

    • SassScript             (Turing Complete)




Saturday, July 17, 2010                                    51
PROVOCATIVE STATEMENT #1
                          HAML feels like an unnecessary abstraction




Saturday, July 17, 2010                                                52
If you're product is 10 times better
               than your competitor, ship it now!

Saturday, July 17, 2010                               53
PROVOCATIVE STATEMENT #2
                          HTML/CSS is Your Problem




Saturday, July 17, 2010                              54
PROVOCATIVE STATEMENT #3
                          You probably don’t know CSS




Saturday, July 17, 2010                                 55
ERIC MEYER




Saturday, July 17, 2010                56
Q&A




Saturday, July 17, 2010         57

Weitere ähnliche Inhalte

Ähnlich wie Unobtrusive CSS

Building Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQueryBuilding Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQuerybenvinegar
 
5 Mistakes of Massive CSS
5 Mistakes of Massive CSS5 Mistakes of Massive CSS
5 Mistakes of Massive CSSNicole Sullivan
 
Mobile Development with uPortal and Infusion
Mobile Development with uPortal and InfusionMobile Development with uPortal and Infusion
Mobile Development with uPortal and Infusioncolinbdclark
 
GGUG:Practical DSL Design
GGUG:Practical DSL DesignGGUG:Practical DSL Design
GGUG:Practical DSL DesignSkills Matter
 
SASS: The Next Wave in Styling and Theming
SASS: The Next Wave in Styling and ThemingSASS: The Next Wave in Styling and Theming
SASS: The Next Wave in Styling and ThemingSencha
 
20100627 sobe2
20100627 sobe220100627 sobe2
20100627 sobe2Shu Shimbo
 
Practical Ruby Projects with MongoDB - Ruby Midwest
Practical Ruby Projects with MongoDB - Ruby MidwestPractical Ruby Projects with MongoDB - Ruby Midwest
Practical Ruby Projects with MongoDB - Ruby MidwestAlex Sharp
 
When is a Website Not Enough? Now.
When is a Website Not Enough? Now.When is a Website Not Enough? Now.
When is a Website Not Enough? Now.bethgsanders
 
Responsive web design - Drupal theming
Responsive web design - Drupal themingResponsive web design - Drupal theming
Responsive web design - Drupal themingadifferentdesign
 
Customizing WordPress Themes / Child Themes - WordCamp Savannah 2010
Customizing WordPress Themes / Child Themes - WordCamp Savannah 2010Customizing WordPress Themes / Child Themes - WordCamp Savannah 2010
Customizing WordPress Themes / Child Themes - WordCamp Savannah 2010Sara Cannon
 
HTML 5: The Future of the Web
HTML 5: The Future of the WebHTML 5: The Future of the Web
HTML 5: The Future of the WebTim Wright
 
WordPress Front End Optimizations
WordPress Front End OptimizationsWordPress Front End Optimizations
WordPress Front End OptimizationsScott Taylor
 
Html5 coredevsummit
Html5 coredevsummitHtml5 coredevsummit
Html5 coredevsummitJen Simmons
 
Groovy Introduction at Javaforum 2010
Groovy Introduction at Javaforum 2010Groovy Introduction at Javaforum 2010
Groovy Introduction at Javaforum 2010Leonard Axelsson
 
Plone Conference 2010 – Where we go from here
Plone Conference 2010 – Where we go from herePlone Conference 2010 – Where we go from here
Plone Conference 2010 – Where we go from hereEric Steele
 
CSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp BostonCSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp BostonJen Simmons
 
Developing Plugins on OpenVBX at Greater San Francisco Bay Area LAMP Group
Developing Plugins on OpenVBX at Greater San Francisco Bay Area LAMP GroupDeveloping Plugins on OpenVBX at Greater San Francisco Bay Area LAMP Group
Developing Plugins on OpenVBX at Greater San Francisco Bay Area LAMP Groupminddog
 

Ähnlich wie Unobtrusive CSS (20)

Building Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQueryBuilding Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQuery
 
5 Mistakes of Massive CSS
5 Mistakes of Massive CSS5 Mistakes of Massive CSS
5 Mistakes of Massive CSS
 
Mobile Development with uPortal and Infusion
Mobile Development with uPortal and InfusionMobile Development with uPortal and Infusion
Mobile Development with uPortal and Infusion
 
GGUG:Practical DSL Design
GGUG:Practical DSL DesignGGUG:Practical DSL Design
GGUG:Practical DSL Design
 
Symfony in the Cloud
Symfony in the CloudSymfony in the Cloud
Symfony in the Cloud
 
SASS: The Next Wave in Styling and Theming
SASS: The Next Wave in Styling and ThemingSASS: The Next Wave in Styling and Theming
SASS: The Next Wave in Styling and Theming
 
20100627 sobe2
20100627 sobe220100627 sobe2
20100627 sobe2
 
Practical Ruby Projects with MongoDB - Ruby Midwest
Practical Ruby Projects with MongoDB - Ruby MidwestPractical Ruby Projects with MongoDB - Ruby Midwest
Practical Ruby Projects with MongoDB - Ruby Midwest
 
Postcss brewbox slides
Postcss brewbox slidesPostcss brewbox slides
Postcss brewbox slides
 
When is a Website Not Enough? Now.
When is a Website Not Enough? Now.When is a Website Not Enough? Now.
When is a Website Not Enough? Now.
 
Responsive web design - Drupal theming
Responsive web design - Drupal themingResponsive web design - Drupal theming
Responsive web design - Drupal theming
 
Customizing WordPress Themes / Child Themes - WordCamp Savannah 2010
Customizing WordPress Themes / Child Themes - WordCamp Savannah 2010Customizing WordPress Themes / Child Themes - WordCamp Savannah 2010
Customizing WordPress Themes / Child Themes - WordCamp Savannah 2010
 
HTML 5: The Future of the Web
HTML 5: The Future of the WebHTML 5: The Future of the Web
HTML 5: The Future of the Web
 
WordPress Front End Optimizations
WordPress Front End OptimizationsWordPress Front End Optimizations
WordPress Front End Optimizations
 
Html5 coredevsummit
Html5 coredevsummitHtml5 coredevsummit
Html5 coredevsummit
 
Node.js and Ruby
Node.js and RubyNode.js and Ruby
Node.js and Ruby
 
Groovy Introduction at Javaforum 2010
Groovy Introduction at Javaforum 2010Groovy Introduction at Javaforum 2010
Groovy Introduction at Javaforum 2010
 
Plone Conference 2010 – Where we go from here
Plone Conference 2010 – Where we go from herePlone Conference 2010 – Where we go from here
Plone Conference 2010 – Where we go from here
 
CSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp BostonCSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp Boston
 
Developing Plugins on OpenVBX at Greater San Francisco Bay Area LAMP Group
Developing Plugins on OpenVBX at Greater San Francisco Bay Area LAMP GroupDeveloping Plugins on OpenVBX at Greater San Francisco Bay Area LAMP Group
Developing Plugins on OpenVBX at Greater San Francisco Bay Area LAMP Group
 

Kürzlich hochgeladen

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 

Kürzlich hochgeladen (20)

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 

Unobtrusive CSS