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

20100627 sobe2
20100627 sobe220100627 sobe2
20100627 sobe2
Shu 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 Midwest
Alex Sharp
 
Responsive web design - Drupal theming
Responsive web design - Drupal themingResponsive web design - Drupal theming
Responsive web design - Drupal theming
adifferentdesign
 
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
minddog
 

Ähnlich wie Unobtrusive CSS (20)

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
 
Campus Party 2010
Campus Party 2010Campus Party 2010
Campus Party 2010
 

Kürzlich hochgeladen

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Unobtrusive CSS