SlideShare a Scribd company logo
WHAT IS OBJECT-ORIENTED
         CSS?
     A framework? A tool? A philosophy?
MORE LIKE AN EVOLUTION
  OF THE LANGUAGE
      it makes CSS more powerful
HOW IS IT DIFFERENT?


          ul{...}
       ul li{...}
     ul li a{...}
HOW IS IT DIFFERENT?


                        ul{...}
                     ul li{...}
                   ul li a{...}



Until now, we focused all our effort here

Recommended for you

JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation

JavaScript can dynamically manipulate the content, structure, and styling of an HTML document through the Document Object Model (DOM). The DOM represents an HTML document as nodes that can be accessed and modified with JavaScript. Common tasks include dynamically creating and adding elements, handling user events like clicks, and updating content by accessing DOM elements by their id or other attributes.

manipulationdomjavascript
The consequences of sync_binlog != 1
The consequences of sync_binlog != 1The consequences of sync_binlog != 1
The consequences of sync_binlog != 1

Have you ever needed to get some additional write throughput from MySQL ? If yes, you probably found that setting sync_binlog to 0 (and trx_commit to 2) gives you an extra performance boost. As all such easy optimisation, it comes at a cost. This talk explains how this tuning works, presents its consequences and makes recommendations to avoid them. This will bring us to the details of how MySQL commits transactions and how those are replicated to slaves. Come to this talk to learn how to get the benefit of this tuning the right way and to learn some replication internals.

mysqlreplicationdurability
CSS Best practice
CSS Best practiceCSS Best practice
CSS Best practice

This document provides tips for best practices when writing CSS code. It recommends avoiding inline styles, header styles, multiple CSS files, and !important. It also recommends using shorthand properties, avoiding universal selectors and IDs when possible, optimizing images, and using CSS3 properties instead of images. In summary, the document outlines techniques for writing efficient, well-structured CSS code to improve performance and maintainability.

cssbest practice
HOW IS IT DIFFERENT?


                   ul{...}
                ul li{...}
              ul li a{...}



But, the architecture lives here
“JAVASCRIPT DOESN’T SUCK
  You’re just doing it wrong.” -- Doug Crockford
“JAVASCRIPT DOESN’T SUCK
  You’re just doing it wrong.” -- Doug Crockford
CSS
“JAVASCRIPT DOESN’T SUCK
  You’re just doing it wrong.” -- Doug Crockford

Recommended for you

Vectors are the new JSON in PostgreSQL
Vectors are the new JSON in PostgreSQLVectors are the new JSON in PostgreSQL
Vectors are the new JSON in PostgreSQL

There are parallels between storing JSON data in PostgreSQL and storing vectors that are produced from AI/ML systems. This lightning talk briefly covers the similarities in use-cases in storing JSON and vectors in PostgreSQL, shows some of the use-cases developers have for querying vectors in Postgres, and some roadmap items for improving PostgreSQL as a vector database.

postgresqlpostgresjson
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3

This presentation about HTML5 and CSS3 presents with example and described valid points with simple example code and live preview.

htmlhtml5java
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview

The document discusses various aspects of HTML5 including its history, new elements, offline storage capabilities, and responsive web design. It provides information on HTML, CSS, JavaScript and how they make up the three layers of web design. It also summarizes the roles of different standards organizations and differences between HTML5 and the HTML living standard.

html5csscss3
CSS CIRCA 2005
    total spaghetti
What is Object Oriented CSS?
CSS CIRCA 2008
    a little better
RATHER THAN MAKING
 OUR CODE PLAY NICE
      We built big fences

Recommended for you

BEM It! for Brandwatch
BEM It! for BrandwatchBEM It! for Brandwatch
BEM It! for Brandwatch

The document introduces the BEM (Block, Element, Modifier) methodology for organizing CSS, HTML, and JavaScript code into reusable components. It describes BEM as a semantic model that defines blocks, elements, and modifiers to structure interfaces. Blocks are standalone parts of an interface, elements are integral parts of blocks, and modifiers define block/element properties or states. The document provides examples of BEM naming conventions and discusses benefits like improved reusability, reduced specificity issues, and serving as a common language for designers and developers.

htmlmethodologycss
Bootstrap 5 whats new
Bootstrap 5   whats newBootstrap 5   whats new
Bootstrap 5 whats new

Bootstrap 5 introduces several major changes including removing jQuery, switching to vanilla JavaScript, adding responsive font sizes, dropping support for older browsers like Internet Explorer 10 and 11, changing the gutter width unit to rem, removing unnecessary classes like card decks, optimizing the navbar component, switching from Jekyll to Hugo for documentation, updating various classes, introducing a new SVG icon library, and providing tools to assist with migrating to the new version.

csshtmljavascript
CSS
CSSCSS
CSS

CSS, Introduction CSS Selector CSS Style CSS Background CSS Border CSS Display CSS Float CSS Font CSS Text CSS Button CSS Table CSS Form

cssintroductionform
BUT FOR PERFORMANCE?
What is Object Oriented CSS?
SITES GET SLOW
As file size and HTTP requests are not optimized
CSS CIRCA 2009

Recommended for you

CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive Design

This document discusses responsive web design using CSS3 media queries. It begins with an introduction to media queries and their syntax for modifying CSS based on screen width. It then covers examples of adapting layouts, images, and other design elements for different screen sizes. Finally, it addresses techniques for supporting older browsers that do not support media queries, such as using conditional comments or JavaScript libraries.

web designmedia queriesresponsive web design
All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...

Techniques for fast and modular JS loading. Talk presented at JSConf Brazil 2013 in Fortaleza by Sérgio Lopes

caelumjsconfjavascript
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS

This PPT is about my best friends, HTML, CSS and JS. Here I am just talk/show few features of them. all three combined make our web site more powerful in this WWW world.

cascading style sheetshtml5css3
OBJECT ORIENTED CSS




         best practices for performance,
        scalability, and most importantly,
                     easy to use.
1. Create objects rather than pages or modules
2. Set good global defaults on content objects
3. Abstract reusable elements
4. Separate structure and skin (into two classes)
5. Separate container and content (open editable
   zones)
6. Tame the cascade
7. Use multiple classes to simulate OO
CREATE OBJECTS
 rather than pages or modules
SET GOOD GLOBAL
    DEFAULTS?
  for standard content objects

Recommended for you

MySQL GTID 시작하기
MySQL GTID 시작하기MySQL GTID 시작하기
MySQL GTID 시작하기

MySQL PowerGroup Tech Seminar (2017.1) - 8.MySQL GTID 시작하기 (by 전세웅) - URL : cafe.naver.com/mysqlpg

전세웅mysqlgtid
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3

This presentation is target for developers that are new to CSS3, and would like to know what CSS3 they need to understand for Windows 8 development.

codecss3demo
Html 5
Html 5Html 5
Html 5

HTML5 is the newest version of HTML that adds new semantic elements, built-in audio and video playback, and features like the canvas element for drawing graphics. It simplifies the syntax of earlier HTML versions and aims to make web pages more semantic, reduce the need for plugins, and work across devices. New elements in HTML5 include <header>, <footer>, <nav>, <video>, <audio>, <canvas>, and new form input types. It is still a work in progress with partial browser support.

html 5
ABSTRACT REUSABLE
    ELEMENTS?
to allow maximum scalability, and less code
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
TAME THE CASCADE
Apply classes to the object we wish to extend, rather than
           random parent nodes. Predictability!
TAMING THE CASCADE


❖   Within any one object use the cascade fully
❖   All sub-nodes of an object should be prefaced with the object
    class name. For example: .mymodule .inner{...}
❖   Avoid the cascade as much as possible between objects

Recommended for you

Maven
MavenMaven
Maven

Maven is a build tool that helps manage Java projects and automates common tasks like compiling code, running tests, and managing dependencies. It uses a Project Object Model (POM) XML file to store build configuration which defines project dependencies, plugins, and other metadata. Maven standardizes project layout, builds, documentation, and the release process.

AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013

Sample code: https://github.com/cqsupport/webinar-dispatchercache Webinar Recording: http://my.adobeconnect.com/p7th2gf8k43/ Optimizing dispatcher cache covering: Best practices for using the dispatcher Tips and tricks for improving performance Common pitfalls to avoid How to design your site so you get the most out of your Dispatcher

adobeadobe confidentialcq5
The Fast And The Fabulous
The Fast And The FabulousThe Fast And The Fabulous
The Fast And The Fabulous

You've got a sneaking suspicion that design impacts performance. What next? Your engineers know nothing about design and your designers know nothing about performance. How can you get everyone on the same page? Which design flaws must you absolutely avoid? How do engineers slow designs with poor CSS? This presentation covers the best practices in design and OO CSS for fast, maintainable sites. * Abstraction * Flexibility * Grids * Location dependent styles Velocity Conference, 2009

SEPARATE CONTAINER
   AND CONTENT
  define the boundaries of each object
Media
           Subheading
           Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
           aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
           aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
           cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.




 image
or flash   OPEN EDITABLE ZONE
image
or flash   OPEN EDITABLE ZONE
USE MULTIPLE CLASSES?
      to simulate inheritance

Recommended for you

The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...

The cascade is a poker game, but we've been playing our cards all wrong. Here Nicole suggests we stop trying to play to win to prevent code bloat, and simplify the cascade, using the order of the rulesets to allow overrides.

taetae09css
Building Better Responsive Websites
Building Better Responsive WebsitesBuilding Better Responsive Websites
Building Better Responsive Websites

The document discusses responsive web design and some best practices. It notes that responsive design is more than just fluid grids, flexible images, and media queries - it also requires considering architecture, performance, font sizing, breakpoints, image optimization, and more. The document provides tips on using relative units like ems and rems for font sizing, organizing media queries, selecting classes, and testing responsive sites.

frameworksresponsive web designhtml
Juggling
JugglingJuggling
Juggling

This document discusses various aspects of interface design including color, typography, iconography, microformats, and flexibility. It provides tips on choosing color palettes, using typography effectively, designing icons and favicons, implementing microformats, and making interfaces adaptable. Examples of microformats like hCard and hCalendar are shown to demonstrate how they can work together to provide structured data on the web. The document emphasizes starting simply, reusing elements, and testing designs for robustness by turning off images and CSS.

Media
                     Subheading
                     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
                     aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
                     aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
                     cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.




Media Extended
Subheading
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.




                                                       MEDIA
                                   Extending objects, a simple
                                           example.

<div class=quot;media mediaExtquot;>
  <img class=quot;fixedMediaquot; src=quot;myImg.pngquot; />

 <div class=quot;bodyquot;>

 
 ...

 </div>
</div>
SEPARATE STRUCTURE
    FROM SKIN
     two separate classes
mod
                                   block
                                      inner
                                              hd



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

Recommended for you

Juggling
JugglingJuggling
Juggling

This document discusses various topics related to interface design including color, typography, iconography, microformats, and flexibility. It provides tips for choosing color palettes, using CSS for typography, designing favicons, and using microformats to embed semantic information in HTML. It emphasizes designing with flexibility in mind by making sure interfaces are usable even when images or CSS is disabled, text is enlarged, or markup and stylesheets are validated.

Front End Best Practices
Front End Best PracticesFront End Best Practices
Front End Best Practices

Front End Best Practices: A Selection of Best Practices, Tips, Tricks & Good Advice For Today’s Front End Development. Practices mentioned in this presentation range from basic principles to more advanced tools and techniques. By Holger Bartel for WomenWhoCodeHK 23/07/2014

developmentcssfrontend
Famo.us - New generation of HTML5 Web Application Framework
Famo.us - New generation of HTML5 Web Application FrameworkFamo.us - New generation of HTML5 Web Application Framework
Famo.us - New generation of HTML5 Web Application Framework

This document provides an overview of Famo.us, a new generation HTML5 web application framework. It discusses Famo.us' render engine and how it improves performance over traditional approaches by utilizing a virtual "render tree". Key aspects of Famo.us like modifiers, events handling, and views/widgets are explained. Examples are provided to illustrate challenges and their solutions in Famo.us. Integration with other frameworks like Angular and tools for building with Famo.us are also mentioned.

famo.us
mod
                                   block
                                      inner
                                              hd



  STRUCTURE
Solves browser bugs, positions                bd
  presentational elems, and
generally does the heavy lifting
            of CSS.
                                              ft
mod complex
 mod complex
mod pop
SKIN
      Makes it pretty.

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

Recommended for you

Reveal
RevealReveal
Reveal

This document summarizes the features and capabilities of the Reveal.js presentation framework. It shows how Reveal.js allows you to create HTML presentations with features like vertical slides, navigation controls, themes, transitions, backgrounds, fragments, markdown support, and export to PDF. The document serves as both a tutorial and reference for using Reveal.js.

Brad frost: Atomic design (Webdagene 2014)
Brad frost: Atomic design (Webdagene 2014)Brad frost: Atomic design (Webdagene 2014)
Brad frost: Atomic design (Webdagene 2014)

The document discusses the concept of atomic design for building interfaces and design systems. It provides examples of existing style guides and pattern libraries. It also describes how atomic design breaks interfaces down into basic elements called atoms, and combines them into larger components called molecules, organisms and templates. Real content can then be piped into the templates.

webdagene 2014webdagene
OOScss Architecture For Rails Apps
OOScss Architecture For Rails AppsOOScss Architecture For Rails Apps
OOScss Architecture For Rails Apps

This document discusses using OOScss architecture for Rails applications. It proposes dividing CSS into components, modules, and layouts. Placeholder selectors from Sass can be used to create reusable CSS modules without code bloat. Examples show issues with directly using Bootstrap for complex designs. Following OOScss principles like identifying reusable objects, using semantic HTML, and separating styles from content can help build custom designs on top of frameworks like Bootstrap more effectively.

sassprogrammingrails
/* ----- 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);
}
WHAT BELONGS IN THE
           SKIN?

Every value in the skin should be predictable, something that
can easily be calculated or measured.

Colors

Borders

Images
What is Object Oriented CSS?
What is Object Oriented CSS?

Recommended for you

Refresh OKC
Refresh OKCRefresh OKC
Refresh OKC

This document discusses the 960 Grid System, a CSS framework that utilizes a 12-column grid layout with widths of 60px each and gutters of 20px. It can be used for rapid prototyping and integrated into production environments. The document provides code examples of typical grid layouts and nested grids. It also discusses related topics like fixed-width grids, grid generators, and myths around CSS best practices.

oklahoma citycsssass
Rapid web development, the right way.
Rapid web development, the right way.Rapid web development, the right way.
Rapid web development, the right way.

The founder of ctrleff demonstrates his methodology of web development that has evolved through the years to find the perfect balance between speed and scalability.

web design and developmenthtmljavascript
Display Suite: A Themers Perspective
Display Suite: A Themers PerspectiveDisplay Suite: A Themers Perspective
Display Suite: A Themers Perspective

Display Suite is a Drupal module that allows users to take full control over how content is displayed using a drag and drop interface without having to work with template files. It provides predefined layouts and allows users to create custom layouts and view modes. Display Suite also features code fields to add custom variables and styles to control field formatting. The module is actively maintained and widely used with thousands of active sites.

drupalthemedisplay suite
WHAT NOT TO DO!
inappropriate dependence on the cascade is not object
                     oriented.
LOCATION DEPENDENT
       STYLES
        avoid!
FUNCTION AREA()
FUNCTION AREA()

Recommended for you

Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014

This document discusses strategies for making CSS more scalable and maintainable. It recommends automating CSS with preprocessors, using clear and descriptive class names, avoiding descendant selectors when possible, and minimizing unnecessary nesting and complexity. Pseudoselectors should only be used when other options aren't available. Overall, the document emphasizes writing CSS according to first principles of maintainability, predictability and avoiding premature optimization.

cssweb developmenthtml5
He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!

Derrière ce titre putaclic se cache une réalité pour une partie de notre industrie. Les boucles for/while sont des structures itératives proposant le plus bas niveau d'abstraction. Les langages modernes proposent encore de nos jours ces structures car elles ont leur utilité dans quelques cas exceptionnels. Ces 10 dernières années, de nouvelles structures d'itérations sont apparues, proposant un plus haut niveau d'abstraction : donc une meilleure productivité, moins de ligne de code, donc moins de bug potentiels (que nous décrirons). Nous partirons d'exemples de code simple et montrerons leur équivalent via ces nouvelles structures puis observerons les avantages (et inconvénients ?). Les exemples seront en JavaScript mais bien entendu applicable dans d'autres langages (Java, C#, Python, Ruby, C++, Scala, Go, Rust, ...).

declarative-programmingfunctional-programmingimperative-programming
Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)

The document discusses CSS frameworks and grid-based design. It introduces CSS frameworks as sets of tools and best practices that abstract routine tasks into reusable modules. Grid-based design uses a grid system to organize content spatially on a page in a clear, meaningful way for users. The document examines specific CSS frameworks, Blueprint and 960gs, and discusses advantages and disadvantages of working with grids, including how grids can facilitate creativity but also impose restrictions. It also explores using the 960gs framework with the Drupal CMS.

drupalcampau08drupalsdug
FUNCTION AREA()
EVERY NOW AND THEN...
RETURNED DIAMETER
BROKEN.

Recommended for you

Deterministic capacity planning for OpenStack as elastic cloud infrastructure
Deterministic capacity planning for OpenStack as elastic cloud infrastructureDeterministic capacity planning for OpenStack as elastic cloud infrastructure
Deterministic capacity planning for OpenStack as elastic cloud infrastructure

Capacity planning for elastic cloud infrastructure platforms like OpenStack is critical for successful deployments. The proper sizing of compute resources within OpenStack allows for easier scheduling, optimal efficiency in hardware utilization, and consistency of resource allocation. Google Compute Engine and Amazon Web Services offer deterministic compute resources designed to meet both cloud provider business requirements and cloud consumer service-level requirements. In this session, we'll explore these public provider approaches, extend them to OpenStack, and provide sizing data and tools to help with your deployment. In this session, Keith Basil, Sean Cohen, and Tushar Katarki discuss: -Approaches for providing consistent compute service levels in OpenStack. -Building instance families for your workloads. -Sizing compute node for OpenStack. -Storage & Network sizing or elastic clouds - Capacity planning tools & benchmarks

openstackcapacity planning for elastic cloud
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development

A talk on front-end developer tools including Yeoman, Grunt.js, Require.js, Bower, and SASS given at Drupal Camp LA 2013. This talk doesn't address Drupal specifically, but it was aimed to give the audience of drupal developers a look into the state of the art.

require.jsyeomanbower
WEBASSEMBLY - What's the right thing to write? -
WEBASSEMBLY - What's the right thing to write? -WEBASSEMBLY - What's the right thing to write? -
WEBASSEMBLY - What's the right thing to write? -

https://github.com/wbcchsyn/slide-WEBASSEMBLY-whats-the-right-thing-to-write.git What is WebAssembly? According to webassembly.org, WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. I think that it is a standard to make the programming logic abstract. “standard to make the programming logic abstract.” What does it mean? What is the advantage? Let’s talk about WebAssembly while looking back on the computer history. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with one Invariant Sections: “Shin Yoshida wrote this document with the goal of contributing to a fair and safe world. Funai Soken Digital Incorporated agrees with the vision and compensated him for his work.” no Front-Cover Texts, and no Back-Cover Text. A copy of the license is included in the section entitled “GNU Free Documentation License”. https://github.com/wbcchsyn/slide-WEBASSEMBLY-whats-the-right-thing-to-write.git

webassemblywasmwasi
IN CSS WE DO THIS
   ALL THE TIME
BROKEN.
A   Heading should not become a          Heading

          in another part of the page.
AVOID
                  CODE EXAMPLE
             #weatherModule h3{color:red;}
             #tabs h3{color:blue}


❖   Global color undefined for h3, so it will be
    ‣   unstyled in new modules,
    ‣   developers forced to write more CSS for the same style

Recommended for you

Atomic Design - An Event Apart San Diego
Atomic Design - An Event Apart San DiegoAtomic Design - An Event Apart San Diego
Atomic Design - An Event Apart San Diego

Design systems, not pages. This is an introduction to atomic design (http://bradfrostweb.com/blog/post/atomic-web-design/), a methodology for crafting an effective interface design system. It also introduces Pattern Lab (http://patternlab.io/), a tool for implementing atomic design systems and pattern libraries.

atomic designrwdpattern lab
Building the Media Block in ReactJS
Building the Media Block in ReactJS Building the Media Block in ReactJS
Building the Media Block in ReactJS

the API is an interface that needs to be designed. http://styleguide.pivotal.io/react_beta.html https://www.npmjs.com/search?q=pui

reactan event apartan event apart - san diego 2015
Why are you here?
Why are you here?Why are you here?
Why are you here?

A reflection on career and community. A call to follow your heart rather than some abstract notion of success.

cssconfcurationcssconf.eu
AVOID
                  CODE EXAMPLE
             h3{color:black;}
             #weatherModule h3{color:red;}
             #tabs h3{color:blue}
❖   Global color defined (better!)
❖   Weather and tabs override default h3
    ‣   three styles for h3 cannot co-exist in the same module
    ‣   default style cannot be used in weather and tabs without costly
        overrides
❖   Weather and tabs h3 can never be used outside of those
    modules
CONSISTENCY
    Writing more rules to
overwrite the crazy rules from
           before.

 e.g. Heading should behave
 predictably in any module.
TRY THIS INSTEAD
                        h1,    .h1{...}
                        h2,    .h2{...}
                        h3,    .h3{...}
                        h4,    .h4{...}
                        h5,    .h5{...}
                        h6,    .h6{...}

❖   Global values defined
❖   Semantics respected (while allowing visual flexibility)
NEED MORE THAN 6
   HEADINGS?
 Really? Any duplicates? Any too similar?

Recommended for you

Creating Living Style Guides to Improve Performance
Creating Living Style Guides to Improve PerformanceCreating Living Style Guides to Improve Performance
Creating Living Style Guides to Improve Performance

Refactoring Trulia’s UI with SASS, OOCSS, and handlebars. My slides from jsconf 2013. Lot's of yummy details about the performance improvements we were able to make.

sassoocssstyle guides
Don't feed the trolls
Don't feed the trollsDon't feed the trolls
Don't feed the trolls

The JavaScript community is one of the most vibrant and fun groups I've ever been lucky enough to be a part of. Like any vibrant community, sometimes people don't play nicely. In this session, I will discuss what it has been like to be shy *and* be on twitter, mailing lists, and open source. I'll talk about my experiences consulting on massive CSS overhauls, and ways to defeat trolls -- including your own inner troll! I'll also share a timing attack for your brain that might just surprise you.

fluentconfjavascriptjsconf
CSS Power Tools
CSS Power ToolsCSS Power Tools
CSS Power Tools

Let’s admit it, the tools for writing CSS aren’t very advanced. For the most part, the people who write tools don’t know about CSS and the people who know about CSS don’t write tools. Quite a conundrum! In this session, you’ll learn about good tools that can make development faster and maintenance easier. We’ll also talk a bit about where we can go from here. What tools do we need as sites are becoming more and more complex? We need to get beyond tools whose primary goal is to avoid hand-coding and realize that, as our techniques for writing CSS become more powerful, our tools can too! Session will include: * Validators * Preprocessors * Finding dead rules * Linting * CSS3 gradient tools * Performance measurement tools * Unit testing

image optimizationcompassblueprint
STILL NEED MORE
                HEADINGS?
           .category{...}
           .section{...}
           .product{...}
           .prediction{...}

❖   Extend the heading object via a class on the object itself
❖   Avoid using the cascade to place classes on parent objects
CALCULATING
COMPLEXITY IN CSS
  All solutions are not created equal
O(n)
Natural to you, but not to designers.
FRONT END ARCHITECTURE
   NEEDS TO BE RIGHT
 Even best practices, like CSS sprites, can have unintended
                        consequences.

Recommended for you

5 Mistakes of Massive CSS
5 Mistakes of Massive CSS5 Mistakes of Massive CSS
5 Mistakes of Massive CSS

Nicole Sullivan and Stoyan Stefanov discuss their work optimizing CSS at Facebook and Yahoo!, As well as the state of CSS optimizations in the Alexa Top 1000 websites. What a mess! From Velocity Conference and Texas-Javascript.

css performance optimization facebook yahoo veloci
CSS Wish List @JSConf
CSS Wish List @JSConfCSS Wish List @JSConf
CSS Wish List @JSConf

From Nicole's talk at JSConf.eu where she presented her wish list for the future of CSS. She presents a brand-new expanded syntax which allows for prototypes, mixins, and variables and explains how a preprocessor can be used today to achieve a richer language in older browsers.

css specification prototype mixin variable oocss j
Taming CSS Selectors
Taming CSS SelectorsTaming CSS Selectors
Taming CSS Selectors

From Nicole's presentation at the CSS Summit. This is brand new research regarding efficient CSS selector design. Practicing the rules outlined here will make your CSS lean, your site fast, and your maintenance minimal. A beautiful combination for people concerned with building performance into their sites.

selectorscssperformance
3 METRICS


1. HTTP requests

2. Size of images

3. Size of the CSS
OUTCOMES
If the theory is right, it should yield better results.
TEMPLATE


• 807   bytes

• 13   lines of code

• easily
      extended to custom
 page and column width
GRIDS
•   574 bytes

•   14 lines of code

•   Percentage widths adapt to
    different page sizes

•   Includes halfs, thirds, fourths, and
    fifths

•   No gutters

•   Infinite nesting and stacking

Recommended for you

Pourquoi la performance?
Pourquoi la performance?Pourquoi la performance?
Pourquoi la performance?

Quantifier et améliorer la performance de tout produit Yahoo! mondial avec Éric Daspet pour ParisWeb 2008

smushitÉricdaspet"
Design Fast Websites
Design Fast WebsitesDesign Fast Websites
Design Fast Websites

Nicole Sullivan gives a presentation on designing fast websites. She discusses why performance matters, how websites have grown more complex over time, and how poor performance can negatively impact businesses. She provides several best practices for optimizing websites, such as creating reusable components, using consistent styles, making modules transparent, optimizing images through sprites and compression, avoiding non-standard fonts and using columns instead of rows.

f2esummit08yahooyslow
7 Habits of Exceptional Performance
7 Habits of Exceptional Performance7 Habits of Exceptional Performance
7 Habits of Exceptional Performance

The 7 Habits of Exceptional Performance discusses techniques for optimizing website performance. It recommends flushing the buffer early, using GET requests for AJAX, preloading components, avoiding filters, measuring performance metrics, and balancing new features with performance improvements. High performance should be baked into the development process from the start. Key metrics to track include page weight, response time, and HTTP requests.

businessperformancebreakthroughs
MODULE

• 1.3K   (structure)

• 22   lines of code

• Width    and height agnostic

• Three   structures

• 264 different combos of
 skins
JS COMMUNITY
 How to remain JS lib agnostic?
      DHTML objects?
   Easily adding behaviors?
     Trigger parameters?
FLICKR PHOTO CREDITS
❖   “spaghetti con salsa de tomate y carne + albahaca” by pablovenegas
❖   “Jenga” by j3ku (3 photos, same title)
❖   “Sandbox Fun” by engelsrud
❖   “Golden Gate from Alcatraz” by Tolka Rover
❖   “Treasure Island / The Island / L'île Perdu / La Isla Maravillosa - Version II” by Aaron Escobar
❖   “Razor Wire (01)” by Amy
❖   “At the landfill” by digitalsadhu
❖   “Happy Day” by Daniel Gebhart
❖   “Finding Time to Laugh” by Leepack
❖   “Very Happy Baby” by Yogi
LET’S KEEP TALKING


❖   “Stubbornella” on the web. Twitter, doppler, everywhere...
❖   http://stubbornella.org
❖   nicole@stubbornella.org

Recommended for you

After YSlow "A"
After YSlow "A"After YSlow "A"
After YSlow "A"

The document discusses 20 additional best practices for improving web performance beyond the original 14 recommendations from YSlow. It covers techniques like flushing the buffer early, splitting components for post-loading, preloading necessary assets, reducing unnecessary DOM elements, optimizing images through techniques like converting to smaller file formats and using CSS sprites, and designing for mobile performance. The document provides examples and case studies to illustrate the recommendations and cites additional resources on web performance.

performanceyslowwebsite
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides

If you’ve ever had to analyze a map or GPS data, chances are you’ve encountered and even worked with coordinate systems. As historical data continually updates through GPS, understanding coordinate systems is increasingly crucial. However, not everyone knows why they exist or how to effectively use them for data-driven insights. During this webinar, you’ll learn exactly what coordinate systems are and how you can use FME to maintain and transform your data’s coordinate systems in an easy-to-digest way, accurately representing the geographical space that it exists within. During this webinar, you will have the chance to: - Enhance Your Understanding: Gain a clear overview of what coordinate systems are and their value - Learn Practical Applications: Why we need datams and projections, plus units between coordinate systems - Maximize with FME: Understand how FME handles coordinate systems, including a brief summary of the 3 main reprojectors - Custom Coordinate Systems: Learn how to work with FME and coordinate systems beyond what is natively supported - Look Ahead: Gain insights into where FME is headed with coordinate systems in the future Don’t miss the opportunity to improve the value you receive from your coordinate system data, ultimately allowing you to streamline your data analysis and maximize your time. See you there!

What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx

This is a slide deck that showcases the updates in Microsoft Copilot for May 2024

microsoftmicrosoft copilot

More Related Content

What's hot

An Overview on Nuxt.js
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.js
Squash Apps Pvt Ltd
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentation
Bojan Golubović
 
Our Best Practices Are Killing Us
Our Best Practices Are Killing UsOur Best Practices Are Killing Us
Our Best Practices Are Killing Us
Nicole Sullivan
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
Mohammed Arif
 
The consequences of sync_binlog != 1
The consequences of sync_binlog != 1The consequences of sync_binlog != 1
The consequences of sync_binlog != 1
Jean-François Gagné
 
CSS Best practice
CSS Best practiceCSS Best practice
CSS Best practice
Russ Weakley
 
Vectors are the new JSON in PostgreSQL
Vectors are the new JSON in PostgreSQLVectors are the new JSON in PostgreSQL
Vectors are the new JSON in PostgreSQL
Jonathan Katz
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3
Gopi A
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview
Jacob Nelson
 
BEM It! for Brandwatch
BEM It! for BrandwatchBEM It! for Brandwatch
BEM It! for Brandwatch
Max Shirshin
 
Bootstrap 5 whats new
Bootstrap 5   whats newBootstrap 5   whats new
Bootstrap 5 whats new
Sandun Perera
 
CSS
CSSCSS
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive Design
Zoe Gillenwater
 
All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...
Caelum
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
Naga Harish M
 
MySQL GTID 시작하기
MySQL GTID 시작하기MySQL GTID 시작하기
MySQL GTID 시작하기
I Goo Lee
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
Doris Chen
 
Html 5
Html 5Html 5
Maven
MavenMaven
AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013
Andrew Khoury
 

What's hot (20)

An Overview on Nuxt.js
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.js
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentation
 
Our Best Practices Are Killing Us
Our Best Practices Are Killing UsOur Best Practices Are Killing Us
Our Best Practices Are Killing Us
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
The consequences of sync_binlog != 1
The consequences of sync_binlog != 1The consequences of sync_binlog != 1
The consequences of sync_binlog != 1
 
CSS Best practice
CSS Best practiceCSS Best practice
CSS Best practice
 
Vectors are the new JSON in PostgreSQL
Vectors are the new JSON in PostgreSQLVectors are the new JSON in PostgreSQL
Vectors are the new JSON in PostgreSQL
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview
 
BEM It! for Brandwatch
BEM It! for BrandwatchBEM It! for Brandwatch
BEM It! for Brandwatch
 
Bootstrap 5 whats new
Bootstrap 5   whats newBootstrap 5   whats new
Bootstrap 5 whats new
 
CSS
CSSCSS
CSS
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive Design
 
All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
 
MySQL GTID 시작하기
MySQL GTID 시작하기MySQL GTID 시작하기
MySQL GTID 시작하기
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Html 5
Html 5Html 5
Html 5
 
Maven
MavenMaven
Maven
 
AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013AEM (CQ) Dispatcher Caching Webinar 2013
AEM (CQ) Dispatcher Caching Webinar 2013
 

Similar to What is Object Oriented CSS?

The Fast And The Fabulous
The Fast And The FabulousThe Fast And The Fabulous
The Fast And The Fabulous
Nicole Sullivan
 
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
Nicole Sullivan
 
Building Better Responsive Websites
Building Better Responsive WebsitesBuilding Better Responsive Websites
Building Better Responsive Websites
Holger Bartel
 
Juggling
JugglingJuggling
Juggling
Ross Lawley
 
Juggling
JugglingJuggling
Juggling
Casey Bradford
 
Front End Best Practices
Front End Best PracticesFront End Best Practices
Front End Best Practices
Holger Bartel
 
Famo.us - New generation of HTML5 Web Application Framework
Famo.us - New generation of HTML5 Web Application FrameworkFamo.us - New generation of HTML5 Web Application Framework
Famo.us - New generation of HTML5 Web Application Framework
Hina Chen
 
Reveal
RevealReveal
Reveal
natekapi
 
Brad frost: Atomic design (Webdagene 2014)
Brad frost: Atomic design (Webdagene 2014)Brad frost: Atomic design (Webdagene 2014)
Brad frost: Atomic design (Webdagene 2014)
webdagene
 
OOScss Architecture For Rails Apps
OOScss Architecture For Rails AppsOOScss Architecture For Rails Apps
OOScss Architecture For Rails Apps
Netguru
 
Refresh OKC
Refresh OKCRefresh OKC
Refresh OKC
Nathan Smith
 
Rapid web development, the right way.
Rapid web development, the right way.Rapid web development, the right way.
Rapid web development, the right way.
nubela
 
Display Suite: A Themers Perspective
Display Suite: A Themers PerspectiveDisplay Suite: A Themers Perspective
Display Suite: A Themers Perspective
Mediacurrent
 
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Christian Lilley
 
He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!
François-Guillaume Ribreau
 
Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)
Ryan Cross
 
Deterministic capacity planning for OpenStack as elastic cloud infrastructure
Deterministic capacity planning for OpenStack as elastic cloud infrastructureDeterministic capacity planning for OpenStack as elastic cloud infrastructure
Deterministic capacity planning for OpenStack as elastic cloud infrastructure
Sean Cohen
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
mwrather
 
WEBASSEMBLY - What's the right thing to write? -
WEBASSEMBLY - What's the right thing to write? -WEBASSEMBLY - What's the right thing to write? -
WEBASSEMBLY - What's the right thing to write? -
Shin Yoshida
 
Atomic Design - An Event Apart San Diego
Atomic Design - An Event Apart San DiegoAtomic Design - An Event Apart San Diego
Atomic Design - An Event Apart San Diego
Brad Frost
 

Similar to What is Object Oriented CSS? (20)

The Fast And The Fabulous
The Fast And The FabulousThe Fast And The Fabulous
The Fast And The Fabulous
 
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
 
Building Better Responsive Websites
Building Better Responsive WebsitesBuilding Better Responsive Websites
Building Better Responsive Websites
 
Juggling
JugglingJuggling
Juggling
 
Juggling
JugglingJuggling
Juggling
 
Front End Best Practices
Front End Best PracticesFront End Best Practices
Front End Best Practices
 
Famo.us - New generation of HTML5 Web Application Framework
Famo.us - New generation of HTML5 Web Application FrameworkFamo.us - New generation of HTML5 Web Application Framework
Famo.us - New generation of HTML5 Web Application Framework
 
Reveal
RevealReveal
Reveal
 
Brad frost: Atomic design (Webdagene 2014)
Brad frost: Atomic design (Webdagene 2014)Brad frost: Atomic design (Webdagene 2014)
Brad frost: Atomic design (Webdagene 2014)
 
OOScss Architecture For Rails Apps
OOScss Architecture For Rails AppsOOScss Architecture For Rails Apps
OOScss Architecture For Rails Apps
 
Refresh OKC
Refresh OKCRefresh OKC
Refresh OKC
 
Rapid web development, the right way.
Rapid web development, the right way.Rapid web development, the right way.
Rapid web development, the right way.
 
Display Suite: A Themers Perspective
Display Suite: A Themers PerspectiveDisplay Suite: A Themers Perspective
Display Suite: A Themers Perspective
 
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
 
He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!
 
Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)
 
Deterministic capacity planning for OpenStack as elastic cloud infrastructure
Deterministic capacity planning for OpenStack as elastic cloud infrastructureDeterministic capacity planning for OpenStack as elastic cloud infrastructure
Deterministic capacity planning for OpenStack as elastic cloud infrastructure
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
 
WEBASSEMBLY - What's the right thing to write? -
WEBASSEMBLY - What's the right thing to write? -WEBASSEMBLY - What's the right thing to write? -
WEBASSEMBLY - What's the right thing to write? -
 
Atomic Design - An Event Apart San Diego
Atomic Design - An Event Apart San DiegoAtomic Design - An Event Apart San Diego
Atomic Design - An Event Apart San Diego
 

More from Nicole Sullivan

Building the Media Block in ReactJS
Building the Media Block in ReactJS Building the Media Block in ReactJS
Building the Media Block in ReactJS
Nicole Sullivan
 
Why are you here?
Why are you here?Why are you here?
Why are you here?
Nicole Sullivan
 
Creating Living Style Guides to Improve Performance
Creating Living Style Guides to Improve PerformanceCreating Living Style Guides to Improve Performance
Creating Living Style Guides to Improve Performance
Nicole Sullivan
 
Don't feed the trolls
Don't feed the trollsDon't feed the trolls
Don't feed the trolls
Nicole Sullivan
 
CSS Power Tools
CSS Power ToolsCSS Power Tools
CSS Power Tools
Nicole Sullivan
 
5 Mistakes of Massive CSS
5 Mistakes of Massive CSS5 Mistakes of Massive CSS
5 Mistakes of Massive CSS
Nicole Sullivan
 
CSS Wish List @JSConf
CSS Wish List @JSConfCSS Wish List @JSConf
CSS Wish List @JSConf
Nicole Sullivan
 
Taming CSS Selectors
Taming CSS SelectorsTaming CSS Selectors
Taming CSS Selectors
Nicole Sullivan
 
Pourquoi la performance?
Pourquoi la performance?Pourquoi la performance?
Pourquoi la performance?
Nicole Sullivan
 
Design Fast Websites
Design Fast WebsitesDesign Fast Websites
Design Fast Websites
Nicole Sullivan
 
7 Habits of Exceptional Performance
7 Habits of Exceptional Performance7 Habits of Exceptional Performance
7 Habits of Exceptional Performance
Nicole Sullivan
 
After YSlow "A"
After YSlow "A"After YSlow "A"
After YSlow "A"
Nicole Sullivan
 

More from Nicole Sullivan (12)

Building the Media Block in ReactJS
Building the Media Block in ReactJS Building the Media Block in ReactJS
Building the Media Block in ReactJS
 
Why are you here?
Why are you here?Why are you here?
Why are you here?
 
Creating Living Style Guides to Improve Performance
Creating Living Style Guides to Improve PerformanceCreating Living Style Guides to Improve Performance
Creating Living Style Guides to Improve Performance
 
Don't feed the trolls
Don't feed the trollsDon't feed the trolls
Don't feed the trolls
 
CSS Power Tools
CSS Power ToolsCSS Power Tools
CSS Power Tools
 
5 Mistakes of Massive CSS
5 Mistakes of Massive CSS5 Mistakes of Massive CSS
5 Mistakes of Massive CSS
 
CSS Wish List @JSConf
CSS Wish List @JSConfCSS Wish List @JSConf
CSS Wish List @JSConf
 
Taming CSS Selectors
Taming CSS SelectorsTaming CSS Selectors
Taming CSS Selectors
 
Pourquoi la performance?
Pourquoi la performance?Pourquoi la performance?
Pourquoi la performance?
 
Design Fast Websites
Design Fast WebsitesDesign Fast Websites
Design Fast Websites
 
7 Habits of Exceptional Performance
7 Habits of Exceptional Performance7 Habits of Exceptional Performance
7 Habits of Exceptional Performance
 
After YSlow "A"
After YSlow "A"After YSlow "A"
After YSlow "A"
 

Recently uploaded

Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
Stephanie Beckett
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
Aurora Consulting
 

Recently uploaded (20)

Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
 

What is Object Oriented CSS?

  • 1. WHAT IS OBJECT-ORIENTED CSS? A framework? A tool? A philosophy?
  • 2. MORE LIKE AN EVOLUTION OF THE LANGUAGE it makes CSS more powerful
  • 3. HOW IS IT DIFFERENT? ul{...} ul li{...} ul li a{...}
  • 4. HOW IS IT DIFFERENT? ul{...} ul li{...} ul li a{...} Until now, we focused all our effort here
  • 5. HOW IS IT DIFFERENT? ul{...} ul li{...} ul li a{...} But, the architecture lives here
  • 6. “JAVASCRIPT DOESN’T SUCK You’re just doing it wrong.” -- Doug Crockford
  • 7. “JAVASCRIPT DOESN’T SUCK You’re just doing it wrong.” -- Doug Crockford
  • 8. CSS “JAVASCRIPT DOESN’T SUCK You’re just doing it wrong.” -- Doug Crockford
  • 9. CSS CIRCA 2005 total spaghetti
  • 11. CSS CIRCA 2008 a little better
  • 12. RATHER THAN MAKING OUR CODE PLAY NICE We built big fences
  • 15. SITES GET SLOW As file size and HTTP requests are not optimized
  • 17. OBJECT ORIENTED CSS best practices for performance, scalability, and most importantly, easy to use.
  • 18. 1. Create objects rather than pages or modules 2. Set good global defaults on content objects 3. Abstract reusable elements 4. Separate structure and skin (into two classes) 5. Separate container and content (open editable zones) 6. Tame the cascade 7. Use multiple classes to simulate OO
  • 19. CREATE OBJECTS rather than pages or modules
  • 20. SET GOOD GLOBAL DEFAULTS? for standard content objects
  • 21. ABSTRACT REUSABLE ELEMENTS? to allow maximum scalability, and less code
  • 22. 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
  • 23. TAME THE CASCADE Apply classes to the object we wish to extend, rather than random parent nodes. Predictability!
  • 24. TAMING THE CASCADE ❖ Within any one object use the cascade fully ❖ All sub-nodes of an object should be prefaced with the object class name. For example: .mymodule .inner{...} ❖ Avoid the cascade as much as possible between objects
  • 25. SEPARATE CONTAINER AND CONTENT define the boundaries of each object
  • 26. Media Subheading Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. image or flash OPEN EDITABLE ZONE
  • 27. image or flash OPEN EDITABLE ZONE
  • 28. USE MULTIPLE CLASSES? to simulate inheritance
  • 29. Media Subheading Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Media Extended Subheading Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. MEDIA Extending objects, a simple example.
  • 30. <!-- media --> <div class=quot;media mediaExtquot;> <img class=quot;fixedMediaquot; src=quot;myImg.pngquot; /> <div class=quot;bodyquot;> ... </div> </div>
  • 31. SEPARATE STRUCTURE FROM SKIN two separate classes
  • 32. mod block inner hd STRUCTURE Solves browser bugs, positions bd presentational elems, and generally does the heavy lifting of CSS. ft
  • 33. mod block inner hd STRUCTURE Solves browser bugs, positions bd presentational elems, and generally does the heavy lifting of CSS. ft
  • 34. mod complex mod complex
  • 36. SKIN Makes it pretty. The goal is very predictable skins, complexity is absorbed by the structure object and shared across the site.
  • 37. /* ----- 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); }
  • 38. WHAT BELONGS IN THE SKIN? Every value in the skin should be predictable, something that can easily be calculated or measured. Colors Borders Images
  • 41. WHAT NOT TO DO! inappropriate dependence on the cascade is not object oriented.
  • 42. LOCATION DEPENDENT STYLES avoid!
  • 46. EVERY NOW AND THEN...
  • 49. IN CSS WE DO THIS ALL THE TIME
  • 51. A Heading should not become a Heading in another part of the page.
  • 52. AVOID CODE EXAMPLE #weatherModule h3{color:red;} #tabs h3{color:blue} ❖ Global color undefined for h3, so it will be ‣ unstyled in new modules, ‣ developers forced to write more CSS for the same style
  • 53. AVOID CODE EXAMPLE h3{color:black;} #weatherModule h3{color:red;} #tabs h3{color:blue} ❖ Global color defined (better!) ❖ Weather and tabs override default h3 ‣ three styles for h3 cannot co-exist in the same module ‣ default style cannot be used in weather and tabs without costly overrides ❖ Weather and tabs h3 can never be used outside of those modules
  • 54. CONSISTENCY Writing more rules to overwrite the crazy rules from before. e.g. Heading should behave predictably in any module.
  • 55. TRY THIS INSTEAD h1, .h1{...} h2, .h2{...} h3, .h3{...} h4, .h4{...} h5, .h5{...} h6, .h6{...} ❖ Global values defined ❖ Semantics respected (while allowing visual flexibility)
  • 56. NEED MORE THAN 6 HEADINGS? Really? Any duplicates? Any too similar?
  • 57. STILL NEED MORE HEADINGS? .category{...} .section{...} .product{...} .prediction{...} ❖ Extend the heading object via a class on the object itself ❖ Avoid using the cascade to place classes on parent objects
  • 58. CALCULATING COMPLEXITY IN CSS All solutions are not created equal
  • 59. O(n) Natural to you, but not to designers.
  • 60. FRONT END ARCHITECTURE NEEDS TO BE RIGHT Even best practices, like CSS sprites, can have unintended consequences.
  • 61. 3 METRICS 1. HTTP requests 2. Size of images 3. Size of the CSS
  • 62. OUTCOMES If the theory is right, it should yield better results.
  • 63. TEMPLATE • 807 bytes • 13 lines of code • easily extended to custom page and column width
  • 64. GRIDS • 574 bytes • 14 lines of code • Percentage widths adapt to different page sizes • Includes halfs, thirds, fourths, and fifths • No gutters • Infinite nesting and stacking
  • 65. MODULE • 1.3K (structure) • 22 lines of code • Width and height agnostic • Three structures • 264 different combos of skins
  • 66. JS COMMUNITY How to remain JS lib agnostic? DHTML objects? Easily adding behaviors? Trigger parameters?
  • 67. FLICKR PHOTO CREDITS ❖ “spaghetti con salsa de tomate y carne + albahaca” by pablovenegas ❖ “Jenga” by j3ku (3 photos, same title) ❖ “Sandbox Fun” by engelsrud ❖ “Golden Gate from Alcatraz” by Tolka Rover ❖ “Treasure Island / The Island / L'île Perdu / La Isla Maravillosa - Version II” by Aaron Escobar ❖ “Razor Wire (01)” by Amy ❖ “At the landfill” by digitalsadhu ❖ “Happy Day” by Daniel Gebhart ❖ “Finding Time to Laugh” by Leepack ❖ “Very Happy Baby” by Yogi
  • 68. LET’S KEEP TALKING ❖ “Stubbornella” on the web. Twitter, doppler, everywhere... ❖ http://stubbornella.org ❖ nicole@stubbornella.org

Editor's Notes

  1. After which he said that &#x201C;CSS is broken&#x201D; Very common to say that CSS is broken when it is misunderstood. &#x201C;Emerging frameworks are a sign that CSS is broken.&#x201D; Java developers -- Math class TRANSITION On the other hand, I honestly do believe we are doing it wrong.
  2. After which he said that &#x201C;CSS is broken&#x201D; Very common to say that CSS is broken when it is misunderstood. &#x201C;Emerging frameworks are a sign that CSS is broken.&#x201D; Java developers -- Math class TRANSITION On the other hand, I honestly do believe we are doing it wrong.
  3. Modular CSS is a great idea in theory, but in practice...
  4. Nothing is shared between modules, each reinvents the CSS wheel. Wastefully file sizes and http requests grow and...
  5. What is ... ?
  6. lists, headings, etc should all be global
  7. grids
  8. contours X backgrounds X content objects = complexity 1 X foo bar X 1 2 X 4 = 8 HTTP req 5 X 5 = 25 HTTP req
  9. Classes on object we wish to extend.
  10. media, media extended, wrap Open editable zone
  11. media, media extended, wrap Open editable zone
  12. media, media extended, wrap Open editable zone
  13. function created to return area that occasionally returns the diameter instead.
  14. There is a general belief in CSS development that there are many &#x2018;right&#x2019; ways. This isn&#x2019;t always true.
  15. Each time you analyze a solution, there are three main metrics that should be considered.