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)

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

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Unobtrusive CSS