SlideShare a Scribd company logo
1 of 47
Download to read offline
OBJECT-ORIENTED CSS
                        for High Performance Websites and Applications




                                                             Nicole Sullivan
Wednesday, April 29, 2009
GOOD NEWS
                CSS and front-end architecture have a huge impact on
                                   performance.




Wednesday, April 29, 2009
AND BAD
  NEWS




              If I don’t do my job right, I can slow your site down to a crawl
Wednesday, April 29, 2009
REQUIRE EXPERT ABILITY
               JUST TO GET STARTED.
                            this is not a sign of maturity.




Wednesday, April 29, 2009
FILE SIZE JUST KEEPS
                          GETTING BIGGER
                   As the site evolves we continuously modify the CSS.




Wednesday, April 29, 2009
CODE RE-USE IS ALMOST
              NONEXISTENT
                            people don’t trust other developers code.




Wednesday, April 29, 2009
CODE IS TOO FRAGILE.
       Even the cleanest code gets ruined by the first non-expert to
                                 touch it.




Wednesday, April 29, 2009
WHAT IS THE MOST
                 IMPORTANT MISTAKE
                TALENTED CODERS ARE
                      MAKING?
                            Writing really clever modules.




Wednesday, April 29, 2009
THE SIZE OF THEIR CSS
                     WILL INCREASE
            in a 1:1 relationship with the number of blocks, pages, and
                               complexity of content.




Wednesday, April 29, 2009
“JAVASCRIPT DOESN’T SUCK
                            You’re just doing it wrong.” -- Doug Crockford




Wednesday, April 29, 2009
“JAVASCRIPT DOESN’T SUCK
                            You’re just doing it wrong.” -- Doug Crockford




Wednesday, April 29, 2009
CSS
         “JAVASCRIPT DOESN’T SUCK
                            You’re just doing it wrong.” -- Doug Crockford




Wednesday, April 29, 2009
O(n)
                            Natural to you, but not to designers.




Wednesday, April 29, 2009
CALCULATING
                            COMPLEXITY IN CSS
                              All solutions are not created equal




Wednesday, April 29, 2009
FRONT END ARCHITECTURE
       NEEDS TO BE RIGHT
             Even best practices, like CSS sprites, can have unintended
                                    consequences.




Wednesday, April 29, 2009
WHOA!




Wednesday, April 29, 2009
Wednesday, April 29, 2009
Wednesday, April 29, 2009
LET’S SORT THIS OUT.
               In what ways have the solutions introduced complexity?




Wednesday, April 29, 2009
4x HTTP
               REQUESTS
          Four images where one is
                  enough




Wednesday, April 29, 2009
4x HTTP
               REQUESTS
          Four images where one is
                  enough




Wednesday, April 29, 2009
1x HTTP
                 REQUEST
       because background color is
           tied to border color




       2x CSS CODE
                 because structure is
                 duplicated for both


Wednesday, April 29, 2009
1x HTTP
                 REQUEST
       because background color is
           tied to border color




       2x CSS CODE
                 because structure is
                 duplicated for both


Wednesday, April 29, 2009
EXTRA
                    WEIGHT
           because sprites duplicate
                iconography




       2x CSS CODE
    because the two cannot share
           the same CSS


Wednesday, April 29, 2009
EXTRA
                    WEIGHT
           because sprites duplicate
                iconography




       2x CSS CODE
    because the two cannot share
           the same CSS


Wednesday, April 29, 2009
EXTRA
                    WEIGHT
    because sprites include text as
               images




             EXTRA CSS
     because each button requires
             its own CSS


Wednesday, April 29, 2009
EXTRA
                    WEIGHT
    because sprites include text as
               images




             EXTRA CSS
     because each button requires
             its own CSS


Wednesday, April 29, 2009
3 METRICS


    1. HTTP requests

    2. Size of images

    3. Size of the CSS




Wednesday, April 29, 2009
OBJECT-ORIENTED CSS
                       CAN HELP




Wednesday, April 29, 2009
CREATE A COMPONENT
                     LIBRARY
                            of reusable “legos”




Wednesday, April 29, 2009
SEPARATE CONTAINER
                     AND CONTENT




Wednesday, April 29, 2009
Contour blocks               Background blocks       Content Objects -
                                                    headings, paragraphs, lists, headers,
                                                          footers, buttons, etc.


                                                        Capital of the Canterbury region and the largest city
                                                        on the South Island (population just over 300,000)
                                                        exudes a palpable air of gentility and a connectedness
                                                        with the mother country.
                                                        Read more...




                            X                       X



                                        1:n
Wednesday, April 29, 2009
EXTEND OBJECTS: APPLY
               MULTIPLE CLASSES




Wednesday, April 29, 2009
MEDIA
                            Extending objects, a simple
                                    example.


Wednesday, April 29, 2009
<!-- media -->
<div class=quot;media mediaExtquot;>
  <img class=quot;fixedMediaquot; src=quot;myImg.pngquot; />

 <div class=quot;bodyquot;>

 
 ...

 </div>
</div>




Wednesday, April 29, 2009
SEPARATE STRUCTURE
                         FROM SKIN
                            two separate classes




Wednesday, April 29, 2009
block
                                          inner
                                                  hd



          STRUCTURE
    Solves browser bugs, positions                bd
      presentational elems, and
    generally does the heavy lifting
                of CSS.
                                                  ft




Wednesday, April 29, 2009
SKIN
                        Makes it pretty.

       The goal is very predictable
      skins, complexity is absorbed
       by the structure object and
          shared across the site.


Wednesday, April 29, 2009
/* ----- simple (extends mod) ----- */
  .simple .inner {
     border:1px solid gray;
     -moz-border-radius: 7px;
     -webkit-border-radius: 7px;
     border-radius: 7px;
  }
  .simple b{
    *background-image:url(skin/mod/corners.png);
  }




Wednesday, April 29, 2009
AVOID LOCATION
                            DEPENDENT STYLES
                              to keep CSS file size in check




Wednesday, April 29, 2009
Heading should not become a
                            A                                       Heading

                                     in another part of the page.




Wednesday, April 29, 2009
CONSISTENCY
          Writing more rules to
      overwrite the crazy rules from
                 before.

          e.g. Heading should behave
          predictably in any module.


Wednesday, April 29, 2009
#weatherModule h2{...}
                            #weatherModule h3{...}
                            #weatherModule p{...}
                            #tabs h2{...}
                            #tabs h3{...}
                            #tabs p{...}


                            +1 FOR MODULARITY,
                             BUT STILL BROKEN
Wednesday, April 29, 2009
DEMO
Wednesday, April 29, 2009
PHOTO CREDITS


    • “South                Carolina” by Army.Mil

    • “So          Happy Together” by kalandrakas

    • “sometimes, a               hug is all what we need” by kalandrakas




Wednesday, April 29, 2009
PHOTO CREDITS

        “You Crack Me Up” by http://flickr.com/photos/nickwheeleroz/2474196275/in/photostream/
    •

        “red lego” by http://flickr.com/photos/niznoz/5753993/
    •

        “Pablo’s cubism period began at three” by http://flickr.com/photos/wwworks/2475349116/in/
    •
        set-72157608035966422/

        “Kuwait water tower” by http://flickr.com/photos/asam/327911794/
    •

        idigit_teddy: http://www.flickr.com/photos/design_inspiration/238542495/
    •

        lucianvenutian: http://www.flickr.com/photos/lucianvenutian/1142630637/
    •

        Gimli_36: http://www.flickr.com/photos/navillot/1878124531/
    •

        NathanFromDeVryEET: http://www.flickr.com/photos/thatguyfromcchs08/2300190277/
    •

        Stabilo Boss: http://flickr.com/photos/stabilo-boss/101793494/in/set-72057594060779001/
    •



Wednesday, April 29, 2009
LET’S KEEP TALKING...
                                       http://stubbornella.org
                              http://github.com/stubbornella/oocss/
                                      nicole@stubbornella.org
                                   “stubbornella” on the web...
                             twitter, dopplr, slideshare, everywhere...



Wednesday, April 29, 2009

More Related Content

Similar to Object Oriented Css For High Performance Websites And Applications

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
 
Scaling with Postgres
Scaling with PostgresScaling with Postgres
Scaling with Postgreselliando dias
 
Agile2009
Agile2009Agile2009
Agile2009twh
 
Beautiful Web Typography (#4)
Beautiful Web Typography (#4)Beautiful Web Typography (#4)
Beautiful Web Typography (#4)Pascal Klein
 
Mobile Mountains - OverTheAir 2009
Mobile Mountains - OverTheAir 2009Mobile Mountains - OverTheAir 2009
Mobile Mountains - OverTheAir 2009twh
 
Agenda2.Key
Agenda2.KeyAgenda2.Key
Agenda2.KeyBill
 
Social Media And Business
Social Media And BusinessSocial Media And Business
Social Media And BusinessBank of Ireland
 
NoTube User Model slides
NoTube User Model slidesNoTube User Model slides
NoTube User Model slidesDan Brickley
 

Similar to Object Oriented Css For High Performance Websites And Applications (14)

Object Oriented CSS
Object Oriented CSSObject Oriented CSS
Object Oriented CSS
 
Alternative Databases
Alternative DatabasesAlternative Databases
Alternative Databases
 
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
 
Scaling with Postgres
Scaling with PostgresScaling with Postgres
Scaling with Postgres
 
Agile2009
Agile2009Agile2009
Agile2009
 
Beautiful Web Typography (#4)
Beautiful Web Typography (#4)Beautiful Web Typography (#4)
Beautiful Web Typography (#4)
 
Web Design in 2009
Web Design in 2009Web Design in 2009
Web Design in 2009
 
Mobile Mountains - OverTheAir 2009
Mobile Mountains - OverTheAir 2009Mobile Mountains - OverTheAir 2009
Mobile Mountains - OverTheAir 2009
 
Wk09 Interfacet 29 09
Wk09 Interfacet 29 09Wk09 Interfacet 29 09
Wk09 Interfacet 29 09
 
Agenda2.Key
Agenda2.KeyAgenda2.Key
Agenda2.Key
 
Social Media And Business
Social Media And BusinessSocial Media And Business
Social Media And Business
 
NoTube User Model slides
NoTube User Model slidesNoTube User Model slides
NoTube User Model slides
 
Performance Strategies
Performance StrategiesPerformance Strategies
Performance Strategies
 
Generic Editor
Generic EditorGeneric Editor
Generic Editor
 

More from PerconaPerformance

Drizzles Approach To Improving Performance Of The Server
Drizzles  Approach To  Improving  Performance Of The  ServerDrizzles  Approach To  Improving  Performance Of The  Server
Drizzles Approach To Improving Performance Of The ServerPerconaPerformance
 
E M T Better Performance Monitoring
E M T  Better  Performance  MonitoringE M T  Better  Performance  Monitoring
E M T Better Performance MonitoringPerconaPerformance
 
Covering Indexes Ordersof Magnitude Improvements
Covering  Indexes  Ordersof Magnitude  ImprovementsCovering  Indexes  Ordersof Magnitude  Improvements
Covering Indexes Ordersof Magnitude ImprovementsPerconaPerformance
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And MavenPerconaPerformance
 
Galera Multi Master Synchronous My S Q L Replication Clusters
Galera  Multi Master  Synchronous  My S Q L  Replication  ClustersGalera  Multi Master  Synchronous  My S Q L  Replication  Clusters
Galera Multi Master Synchronous My S Q L Replication ClustersPerconaPerformance
 
My S Q L Replication Getting The Most From Slaves
My S Q L  Replication  Getting  The  Most  From  SlavesMy S Q L  Replication  Getting  The  Most  From  Slaves
My S Q L Replication Getting The Most From SlavesPerconaPerformance
 
Performance Instrumentation Beyond What You Do Now
Performance  Instrumentation  Beyond  What  You  Do  NowPerformance  Instrumentation  Beyond  What  You  Do  Now
Performance Instrumentation Beyond What You Do NowPerconaPerformance
 
Boost Performance With My S Q L 51 Partitions
Boost Performance With  My S Q L 51 PartitionsBoost Performance With  My S Q L 51 Partitions
Boost Performance With My S Q L 51 PartitionsPerconaPerformance
 
Trees And More With Postgre S Q L
Trees And  More With  Postgre S Q LTrees And  More With  Postgre S Q L
Trees And More With Postgre S Q LPerconaPerformance
 
Database Performance With Proxy Architectures
Database  Performance With  Proxy  ArchitecturesDatabase  Performance With  Proxy  Architectures
Database Performance With Proxy ArchitecturesPerconaPerformance
 
Running A Realtime Stats Service On My Sql
Running A Realtime Stats Service On My SqlRunning A Realtime Stats Service On My Sql
Running A Realtime Stats Service On My SqlPerconaPerformance
 
How To Think About Performance
How To Think About PerformanceHow To Think About Performance
How To Think About PerformancePerconaPerformance
 
Your Disk Array Is Slower Than It Should Be
Your Disk Array Is Slower Than It Should BeYour Disk Array Is Slower Than It Should Be
Your Disk Array Is Slower Than It Should BePerconaPerformance
 

More from PerconaPerformance (17)

Drizzles Approach To Improving Performance Of The Server
Drizzles  Approach To  Improving  Performance Of The  ServerDrizzles  Approach To  Improving  Performance Of The  Server
Drizzles Approach To Improving Performance Of The Server
 
E M T Better Performance Monitoring
E M T  Better  Performance  MonitoringE M T  Better  Performance  Monitoring
E M T Better Performance Monitoring
 
Covering Indexes Ordersof Magnitude Improvements
Covering  Indexes  Ordersof Magnitude  ImprovementsCovering  Indexes  Ordersof Magnitude  Improvements
Covering Indexes Ordersof Magnitude Improvements
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And Maven
 
Galera Multi Master Synchronous My S Q L Replication Clusters
Galera  Multi Master  Synchronous  My S Q L  Replication  ClustersGalera  Multi Master  Synchronous  My S Q L  Replication  Clusters
Galera Multi Master Synchronous My S Q L Replication Clusters
 
My S Q L Replication Getting The Most From Slaves
My S Q L  Replication  Getting  The  Most  From  SlavesMy S Q L  Replication  Getting  The  Most  From  Slaves
My S Q L Replication Getting The Most From Slaves
 
Performance Instrumentation Beyond What You Do Now
Performance  Instrumentation  Beyond  What  You  Do  NowPerformance  Instrumentation  Beyond  What  You  Do  Now
Performance Instrumentation Beyond What You Do Now
 
Boost Performance With My S Q L 51 Partitions
Boost Performance With  My S Q L 51 PartitionsBoost Performance With  My S Q L 51 Partitions
Boost Performance With My S Q L 51 Partitions
 
High Performance Erlang
High  Performance  ErlangHigh  Performance  Erlang
High Performance Erlang
 
Websites On Speed
Websites On  SpeedWebsites On  Speed
Websites On Speed
 
Trees And More With Postgre S Q L
Trees And  More With  Postgre S Q LTrees And  More With  Postgre S Q L
Trees And More With Postgre S Q L
 
Database Performance With Proxy Architectures
Database  Performance With  Proxy  ArchitecturesDatabase  Performance With  Proxy  Architectures
Database Performance With Proxy Architectures
 
Using Storage Class Memory
Using Storage Class MemoryUsing Storage Class Memory
Using Storage Class Memory
 
Websites On Speed
Websites On SpeedWebsites On Speed
Websites On Speed
 
Running A Realtime Stats Service On My Sql
Running A Realtime Stats Service On My SqlRunning A Realtime Stats Service On My Sql
Running A Realtime Stats Service On My Sql
 
How To Think About Performance
How To Think About PerformanceHow To Think About Performance
How To Think About Performance
 
Your Disk Array Is Slower Than It Should Be
Your Disk Array Is Slower Than It Should BeYour Disk Array Is Slower Than It Should Be
Your Disk Array Is Slower Than It Should Be
 

Recently uploaded

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
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
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
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
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Object Oriented Css For High Performance Websites And Applications

  • 1. OBJECT-ORIENTED CSS for High Performance Websites and Applications Nicole Sullivan Wednesday, April 29, 2009
  • 2. GOOD NEWS CSS and front-end architecture have a huge impact on performance. Wednesday, April 29, 2009
  • 3. AND BAD NEWS If I don’t do my job right, I can slow your site down to a crawl Wednesday, April 29, 2009
  • 4. REQUIRE EXPERT ABILITY JUST TO GET STARTED. this is not a sign of maturity. Wednesday, April 29, 2009
  • 5. FILE SIZE JUST KEEPS GETTING BIGGER As the site evolves we continuously modify the CSS. Wednesday, April 29, 2009
  • 6. CODE RE-USE IS ALMOST NONEXISTENT people don’t trust other developers code. Wednesday, April 29, 2009
  • 7. CODE IS TOO FRAGILE. Even the cleanest code gets ruined by the first non-expert to touch it. Wednesday, April 29, 2009
  • 8. WHAT IS THE MOST IMPORTANT MISTAKE TALENTED CODERS ARE MAKING? Writing really clever modules. Wednesday, April 29, 2009
  • 9. THE SIZE OF THEIR CSS WILL INCREASE in a 1:1 relationship with the number of blocks, pages, and complexity of content. Wednesday, April 29, 2009
  • 10. “JAVASCRIPT DOESN’T SUCK You’re just doing it wrong.” -- Doug Crockford Wednesday, April 29, 2009
  • 11. “JAVASCRIPT DOESN’T SUCK You’re just doing it wrong.” -- Doug Crockford Wednesday, April 29, 2009
  • 12. CSS “JAVASCRIPT DOESN’T SUCK You’re just doing it wrong.” -- Doug Crockford Wednesday, April 29, 2009
  • 13. O(n) Natural to you, but not to designers. Wednesday, April 29, 2009
  • 14. CALCULATING COMPLEXITY IN CSS All solutions are not created equal Wednesday, April 29, 2009
  • 15. FRONT END ARCHITECTURE NEEDS TO BE RIGHT Even best practices, like CSS sprites, can have unintended consequences. Wednesday, April 29, 2009
  • 19. LET’S SORT THIS OUT. In what ways have the solutions introduced complexity? Wednesday, April 29, 2009
  • 20. 4x HTTP REQUESTS Four images where one is enough Wednesday, April 29, 2009
  • 21. 4x HTTP REQUESTS Four images where one is enough Wednesday, April 29, 2009
  • 22. 1x HTTP REQUEST because background color is tied to border color 2x CSS CODE because structure is duplicated for both Wednesday, April 29, 2009
  • 23. 1x HTTP REQUEST because background color is tied to border color 2x CSS CODE because structure is duplicated for both Wednesday, April 29, 2009
  • 24. EXTRA WEIGHT because sprites duplicate iconography 2x CSS CODE because the two cannot share the same CSS Wednesday, April 29, 2009
  • 25. EXTRA WEIGHT because sprites duplicate iconography 2x CSS CODE because the two cannot share the same CSS Wednesday, April 29, 2009
  • 26. EXTRA WEIGHT because sprites include text as images EXTRA CSS because each button requires its own CSS Wednesday, April 29, 2009
  • 27. EXTRA WEIGHT because sprites include text as images EXTRA CSS because each button requires its own CSS Wednesday, April 29, 2009
  • 28. 3 METRICS 1. HTTP requests 2. Size of images 3. Size of the CSS Wednesday, April 29, 2009
  • 29. OBJECT-ORIENTED CSS CAN HELP Wednesday, April 29, 2009
  • 30. CREATE A COMPONENT LIBRARY of reusable “legos” Wednesday, April 29, 2009
  • 31. SEPARATE CONTAINER AND CONTENT Wednesday, April 29, 2009
  • 32. Contour blocks Background blocks Content Objects - headings, paragraphs, lists, headers, footers, buttons, etc. Capital of the Canterbury region and the largest city on the South Island (population just over 300,000) exudes a palpable air of gentility and a connectedness with the mother country. Read more... X X 1:n Wednesday, April 29, 2009
  • 33. EXTEND OBJECTS: APPLY MULTIPLE CLASSES Wednesday, April 29, 2009
  • 34. MEDIA Extending objects, a simple example. Wednesday, April 29, 2009
  • 35. <!-- media --> <div class=quot;media mediaExtquot;> <img class=quot;fixedMediaquot; src=quot;myImg.pngquot; /> <div class=quot;bodyquot;> ... </div> </div> Wednesday, April 29, 2009
  • 36. SEPARATE STRUCTURE FROM SKIN two separate classes Wednesday, April 29, 2009
  • 37. block inner hd STRUCTURE Solves browser bugs, positions bd presentational elems, and generally does the heavy lifting of CSS. ft Wednesday, April 29, 2009
  • 38. SKIN Makes it pretty. The goal is very predictable skins, complexity is absorbed by the structure object and shared across the site. Wednesday, April 29, 2009
  • 39. /* ----- simple (extends mod) ----- */ .simple .inner { border:1px solid gray; -moz-border-radius: 7px; -webkit-border-radius: 7px; border-radius: 7px; } .simple b{ *background-image:url(skin/mod/corners.png); } Wednesday, April 29, 2009
  • 40. AVOID LOCATION DEPENDENT STYLES to keep CSS file size in check Wednesday, April 29, 2009
  • 41. Heading should not become a A Heading in another part of the page. Wednesday, April 29, 2009
  • 42. CONSISTENCY Writing more rules to overwrite the crazy rules from before. e.g. Heading should behave predictably in any module. Wednesday, April 29, 2009
  • 43. #weatherModule h2{...} #weatherModule h3{...} #weatherModule p{...} #tabs h2{...} #tabs h3{...} #tabs p{...} +1 FOR MODULARITY, BUT STILL BROKEN Wednesday, April 29, 2009
  • 45. PHOTO CREDITS • “South Carolina” by Army.Mil • “So Happy Together” by kalandrakas • “sometimes, a hug is all what we need” by kalandrakas Wednesday, April 29, 2009
  • 46. PHOTO CREDITS “You Crack Me Up” by http://flickr.com/photos/nickwheeleroz/2474196275/in/photostream/ • “red lego” by http://flickr.com/photos/niznoz/5753993/ • “Pablo’s cubism period began at three” by http://flickr.com/photos/wwworks/2475349116/in/ • set-72157608035966422/ “Kuwait water tower” by http://flickr.com/photos/asam/327911794/ • idigit_teddy: http://www.flickr.com/photos/design_inspiration/238542495/ • lucianvenutian: http://www.flickr.com/photos/lucianvenutian/1142630637/ • Gimli_36: http://www.flickr.com/photos/navillot/1878124531/ • NathanFromDeVryEET: http://www.flickr.com/photos/thatguyfromcchs08/2300190277/ • Stabilo Boss: http://flickr.com/photos/stabilo-boss/101793494/in/set-72057594060779001/ • Wednesday, April 29, 2009
  • 47. LET’S KEEP TALKING... http://stubbornella.org http://github.com/stubbornella/oocss/ nicole@stubbornella.org “stubbornella” on the web... twitter, dopplr, slideshare, everywhere... Wednesday, April 29, 2009