Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Writing & Evolving Hootsuite’s UI

stevemynett
February 19, 2015

Writing & Evolving Hootsuite’s UI

Ideology, Methodology and Implementation

Presented at CodeCore | February 19th 2015

stevemynett

February 19, 2015

Transcript

63 slides
  1. Overview 1. CSS in Single Page Applications 2. Components 3.

    Ideology 4. Methodology 5. Implementation Brad Westfall - CSS Methodologies
  2. – Pete Hunt “All the problems you have with CSS

    get 10X worse when you write Single Page Applications. Any or all of your CSS may get loaded at any time; and in any order ” Pete Hunt - How Instargram Works
  3. Single Page App • We only want to download the

    assets that we need at any point in time • Subsequent assets should not be downloaded unless required with no duplicates • Want to reuse the assets we have already downloaded
  4. CSS in SPA’s • Specificity Wars • Random Cascade •

    Hard to remove code • Unknown dependencies for UI Components
  5. An ideology is a set of conscious ideas which constitute

    one's goals, expectations, and actions. An ideology is a comprehensive normative vision, a way of looking at things. Wikipedia
  6. There is no special or unique CSS or preprocessor magic

    that happens with a Methodology. It's a re- conceiving of how organize and think of writing CSS.
  7. Design Principles • Single Responsibility • Extension over Modification •

    Composition over inheritance • Avoid Dependencies • Encapsulation Adapted from Nicholas Gallagher - SuitCSS
  8. LESS @ Hootsuite • Nesting • Variables • Mixins •

    Import • Parent Selectors • Colour Functions (Operation and Blending Functions)
  9. Variables • Only for values (not selectors or properties) •

    Exception is media query strings • Only use for global values • Never use for scoped sections/components
  10. Variables • Font Family: Every font family string • Colours:

    Every colour • Media Queries: both responsive and HiDPI • Z-Index: with z-index mapping • Font size & line-height
  11. A React Component • Everything is a React component •

    A specific React component contains only a uniqueComponentName and related descendants and extenders. • Contains and defines 
 dependancies for that component
  12. CSS in SPA’s • Specificity Wars: Unique Component Names •

    Random Cascade: Encapsulation & TK • Hard to remove code: Trace dependancies • Unknown dependencies for UI Components: Scope them to individual components
  13. Wrap-up 1. CSS in Single Page Applications 2. Components 3.

    Ideology 4. Methodology 5. Implementation Brad Westfall - CSS Methodologies

Other Decks in Technology