Do your stylesheets feel like this? Incomprehensible wall of tangled styles is incomprehensible http://wikibon.org/blog/wp-content/uploads/2011/10/5.„eg Wednesday, May 16, 12
Caring.com Four Designers in Four Years. Wednesday, May 16, 12 Like most startups we were moving fast. We knew we hadn’t found the right tone, design, resonance with our user base.
Sass: A double edged sword 3.5 MB of CSS across 100+ files Wednesday, May 16, 12 This would be insanity if it was hand authored CSS, but sass let us keep it manageable while we were learning, evolving, looking for product/market fit.
We found it! Our users loved the new design. http://newplateaus.areavoices.com/2012/05/01/are-older-people-happier/ Wednesday, May 16, 12 Finally we’re getting thank you letters and people get upset if our site goes down.
You need better tools. Wednesday, May 16, 12 Better tools that provide insulation between what you write and what you serve. So that you are free to organize without constraints.
Property Soup Le average sass stylesheet. Wednesday, May 16, 12 This is decent sass, could be a lot worse, would be a lot worse in css. but it can be so much better.
Constructing an Object Unstyled Background Container Typography Foreground Margin/Padding Wednesday, May 16, 12 From each category you can usually only pick 1 class to apply to the same element.
Constructing an Object .calming .shadow-box .reading-text .green-bg-type .vertically-padded Wednesday, May 16, 12 From each category you can usually only pick 1 class to apply to the same element.
Property Soup Le average sass stylesheet. Wednesday, May 16, 12 How should we organize our style properties? Alphabetize them! We can do better than this. We will organize our properties by style concern.
Property Soup Le average sass stylesheet. Alphabetized Wednesday, May 16, 12 How should we organize our style properties? Alphabetize them! We can do better than this. We will organize our properties by style concern.
Property Soup Le average sass stylesheet. Alphabetized Wednesday, May 16, 12 How should we organize our style properties? Alphabetize them! We can do better than this. We will organize our properties by style concern.
Foreground border-color, color, shadow-color Wednesday, May 16, 12 you can’t declare text shadow color explicitly, so we have to put all text shadows in the foreground, otherwise the shadow details would be in the typography.
An Object Description In Sass, we describe objects using words and high-level concepts, not style primitives. Wednesday, May 16, 12 Isn’t this simpler to understand if you’re reading the code? We read code more often than we write it. Be nice to your future self.
An Object Description In Sass, we describe objects using words and high-level concepts, not style primitives. Wednesday, May 16, 12 Isn’t this simpler to understand if you’re reading the code? We read code more often than we write it. Be nice to your future self.
A Sad Reality If you use @extend like this, your stylesheets will be huge. Wednesday, May 16, 12 So unless you need the flexibility that semantic markup brings for shared content, etc
More Concepts More Organization But everything has a place. http://www.ultracraft.com/system/accessories/0000/0425/Drawer-Organizer-Metal_full.„g Wednesday, May 16, 12
Progression of a Design Prototype Variations Multiple Uses Domain Concepts Presentational Concepts Concept App Styles Foundation Classes Mixin Library Wednesday, May 16, 12 This is a generalization, not a rule. Sometimes you skip a step, some concepts never appear in the foundation.
Progression of a Design Prototype Variations Multiple Uses Domain Concepts Presentational Concepts Concept App Styles Foundation Classes Mixin Library Wednesday, May 16, 12 This is a generalization, not a rule. Sometimes you skip a step, some concepts never appear in the foundation.
Style Concern: Structure • Floated Grid - Provides the structure of a page. CSS3 will bring alternate layout methods. • Page layouts - Defines how primary elements adhere to the grid and respond. Blog Post Wednesday, May 16, 12
Style Concern: Typography • Defines how a collection of typographic elements are styled. • Vertical Rhythm • There is no default typography. Wednesday, May 16, 12 opt-in typography is not the industry standard approach. The industry is mostly wrong about this. Typographic inheritance can be annoying.
Style Concern: Typography • Defines how a collection of typographic elements are styled. • Vertical Rhythm • There is no default typography. Opt-in To Typography Wednesday, May 16, 12 opt-in typography is not the industry standard approach. The industry is mostly wrong about this. Typographic inheritance can be annoying.
Style Concern: Typography • Defines how a collection of typographic elements are styled. • Vertical Rhythm • There is no default typography. Wednesday, May 16, 12 opt-in typography is not the industry standard approach. The industry is mostly wrong about this. Typographic inheritance can be annoying.
Style Concern: Typography • Defines how a collection of typographic elements are styled. • Vertical Rhythm • There is no default typography. Wednesday, May 16, 12 opt-in typography is not the industry standard approach. The industry is mostly wrong about this. Typographic inheritance can be annoying.
Style Concern: Foreground • Gives color to type and borders • Often linked to a background Wednesday, May 16, 12 It would be nice if the relationship was .foreground {@extend .background;} but it’s not (1 foreground has many backgrounds). This @extend approach introduces a fair bit of bloat, but it forces consistency. It’s a trade-off you can decide to make or not.
Style Concern: Foreground • Gives color to type and borders • Often linked to a background Wednesday, May 16, 12 It would be nice if the relationship was .foreground {@extend .background;} but it’s not (1 foreground has many backgrounds). This @extend approach introduces a fair bit of bloat, but it forces consistency. It’s a trade-off you can decide to make or not.
Style Concern: Foreground • Gives color to type and borders • Often linked to a background Wednesday, May 16, 12 It would be nice if the relationship was .foreground {@extend .background;} but it’s not (1 foreground has many backgrounds). This @extend approach introduces a fair bit of bloat, but it forces consistency. It’s a trade-off you can decide to make or not.
Style Concern: Foreground • Gives color to type and borders • Often linked to a background Wednesday, May 16, 12 It would be nice if the relationship was .foreground {@extend .background;} but it’s not (1 foreground has many backgrounds). This @extend approach introduces a fair bit of bloat, but it forces consistency. It’s a trade-off you can decide to make or not.
Style Concern: Foreground • Gives color to type and borders • Often linked to a background Wednesday, May 16, 12 It would be nice if the relationship was .foreground {@extend .background;} but it’s not (1 foreground has many backgrounds). This @extend approach introduces a fair bit of bloat, but it forces consistency. It’s a trade-off you can decide to make or not.
Style Concern: Foreground • Gives color to type and borders • Often linked to a background Wednesday, May 16, 12 It would be nice if the relationship was .foreground {@extend .background;} but it’s not (1 foreground has many backgrounds). This @extend approach introduces a fair bit of bloat, but it forces consistency. It’s a trade-off you can decide to make or not.
Style Concern: Foreground • Gives color to type and borders • Often linked to a background Wednesday, May 16, 12 It would be nice if the relationship was .foreground {@extend .background;} but it’s not (1 foreground has many backgrounds). This @extend approach introduces a fair bit of bloat, but it forces consistency. It’s a trade-off you can decide to make or not.
Style Concern: Foreground • Gives color to type and borders • Often linked to a background Wednesday, May 16, 12 It would be nice if the relationship was .foreground {@extend .background;} but it’s not (1 foreground has many backgrounds). This @extend approach introduces a fair bit of bloat, but it forces consistency. It’s a trade-off you can decide to make or not.
Style Concern: Lists/Tables/Forms • These are unique beasts • Might be part of a typography • Use them semantically • Class on the main element Wednesday, May 16, 12
Style Concern: Theming • Color Palette • Semantic Color Relationships • Default Variables • Compile Stylesheet with a different configuration Wednesday, May 16, 12
Style Concern: Theming • Color Palette • Semantic Color Relationships • Default Variables • Compile Stylesheet with a different configuration Wednesday, May 16, 12
Style Concern: Theming • Color Palette • Semantic Color Relationships • Default Variables • Compile Stylesheet with a different configuration Wednesday, May 16, 12
Style Concern: Theming • Color Palette • Semantic Color Relationships • Default Variables • Compile Stylesheet with a different configuration Wednesday, May 16, 12
Style Concern: Theming • Color Palette • Semantic Color Relationships • Default Variables • Compile Stylesheet with a different configuration Wednesday, May 16, 12
Naming is a Collaboration Designers must pick or approve the name. Unfortunately, designers are not often good at naming things. Wednesday, May 16, 12 Coders have to name everything they make, but designers don’t. Naming is a skill that must be developed. You have to learn to explain your intuition and instinct.
Naming Docent Developers, your job is to help them develop a shared design vocabulary. Wednesday, May 16, 12 If you are a developer and a designer, you now have an excuse for talking to yourself.
Losing the Name Game Give up: Pick two names Wednesday, May 16, 12 Sometimes you cannot find a good name, or you find some use of a design that doesn’t match the current name.
Losing the Name Game Give up: Pick two names Consistency: Change the design Wednesday, May 16, 12 Sometimes you cannot find a good name, or you find some use of a design that doesn’t match the current name.
Losing the Name Game Give up: Pick two names Consistency: Change the design Wait: Don’t name it Wednesday, May 16, 12 Sometimes you cannot find a good name, or you find some use of a design that doesn’t match the current name.
The Designer Wins http://blog.hubspot.com/Portals/53/images/charlie-sheen-winning.png Wednesday, May 16, 12 Don’t force a design change just because a name doesn’t match. Intuition is a tricky thing, if you trust your designer, trust their gut feeling. If you don’t trust your designer... :(
Classes or IDs? Use IDs for unique page elements. Specificity is good when styling something specific. Wednesday, May 16, 12 not always possible to find a document order. specificity is BETTER than !important. !important is a nuclear option.
Specificity Wars Time to Refactor! Wednesday, May 16, 12 Fight the specificity wars, by refactoring; not by rejecting specificity. Document order is not enough. Keep the same order of specificity at the same level of abstraction.
Structure of a Library Module 1.Dependency Imports 2.Variables, almost always defaulted. 3.Functions 4.Mixins 5.Placeholder selectors 6.Style Selectors Wednesday, May 16, 12 Placeholders: only import once or use the mixin hack if your module has these Selectors: Usually don't mix with Functions/mixins/placeholders
Breaking the Rules ‣Experiment with new designs ‣Accommodate non-conforming design. ‣Build what you need today ‣Meet your deadlines ‣Diligently factor out what is common Wednesday, May 16, 12
Documentation ‣It's better to show than to tell. ‣Make a living styleguide for documentation and prototyping. ‣This is your design catalog. ‣Teach the design, don't just exemplify it. Wednesday, May 16, 12
Downsides ‣Learning curve ‣Harder to debug ‣Classitis ‣A lot of work Wednesday, May 16, 12 1-2 days of training to become capable. 3-4 weeks to be competent. It will take > 1 month for an experienced team to build a comprehensive styleguide.
Benefits Efficient communication Wednesday, May 16, 12 More efficient team thru better communication thanks to new vocabulary. completely Describing a page design can be done in ~15 minutes.
Benefits Built to last http://www.flickr.com/photos/wilhelmja/4233621517/ Wednesday, May 16, 12 Ok. Pyramids are probably a bit of an exagguration. These styles will be used and evolved for several years -- an eternity on the internet. These styles will be used by a team. For the love of god, don't do
Thank you! Compass is Charityware. Please donate on our behalf to the United Mitochondrial Disease Foundation http://umdf.org/compass Wednesday, May 16, 12