SlideShare ist ein Scribd-Unternehmen logo
1 von 108
Downloaden Sie, um offline zu lesen
is everything
  we used to do

wrong
This presentation is going to
  look at some of our best
   practices from the past,
 and what are considered
   best practices today.
First of all, an admission…
I’m not a fan of the term
“best practice” any more.
Best practices:
right vs w rong
If we define one method
  as the “right way” it often
implies that other methods
         are wrong.
While there are definitely
“bad practices”, there are
  many situations where
 there are no clear right
   or wrong solutions.
“Today, anything that’s fixed and
  unresponsive isn’t web design, it’s
 something else. If you don’t embrace
the inherent fluidity of the web, you’re
not a web designer, you’re something
                 else.”

http://stuffandnonsense.co.uk/blog/about/i_dont_care_about_responsive_web_
                                    design/
Best practices:
things change
If history has taught us
anything it’s that everything
    changes over time.
Tables vs CSS
“My rule of thumb is Consistency,
 Consistency, Consistency... If CSS
works for a project, then I use it. If it
doesn’t look like it will, I use tables.”

 http://www.raizlabs.com/blog/148/ten-reasons-why-css-sucks
Microformats
“The blog is neglected, there've been no
 new formats promoted … none of us
work actively on it, … the mailing lists
     are deserted. It is an entirely
 legitimate impression that the effort
      has folded into irrelevance.”

       http://microformats.org/wiki/events/2011-03-sxsw
The <i> element
The i element now represents a span of
   text in an alternate voice or mood, or
otherwise offset from the normal prose in
a manner indicating a different quality of
 text, such as a taxonomic designation, a
technical term, an idiomatic phrase from
  another language, a thought, or a ship
           name in Western texts.

            http://www.w3.org/TR/html5-diff/
Um.. then there is my
Remix07 presentation…
“Why separate your CSS? It’s easier to
find rules. More than one developer at
a time. Files can be turned on or off as
                needed.”

     http://www.slideshare.net/maxdesign/modular-css
Best practices:
   pend on skills
de
Best practices may be quite
different depending on the
          skill area.
For example, best practices
in front end development
 may be different from best
 practices in UX, SEO and
      Social media…
Best practices:
    e pend on te ams
d
Best practices may be quite
different depending on the
    team you work with.
As an individual, you may
have specific best practices.
However, these may have to
change when working in a
   team environment.
outcomes
 not techniques
Instead of talking about best
practices as techniques, we
 should probably focus on
        outcomes.
Let’s take front end
development (HTML, CSS,
JavaScript) as an example:
What are some of our
desired outcomes?
Outcome 1:
u sers come first
We should not do anything
  that makes the user
   experience harder.
We should make sure our
 sites are accessible to
        all users.
We should make sure our
 sites are accessible to
       all devices.
We should make sure our
   sites are accessible
regardless of bandwidth.
Outcome 2:
   elop efficiently
dev
We should aim to develop
 using efficient methods,
    to reduce overall
   development time.
We should aim to develop
using methods that avoid
       repetition.
Outcome 3:
m ain taina  ble,
          s cal able
We should aim to develop
using practices that allow
   easy maintenance.
We should aim to develop
using practices that allow
 our sites to scale well
       over time.
Outcome 4:
fast page load
We should aim to develop
sites so that pages load as
quickly and efficiently as
          possible.
Outcome 5:
backawar d and
        comp atible
forward
Does anyone else hate the
  term “future proof”?
XHTML 1.0 was supposed
  to be a future-proof
       language
We have to be careful not
to leave our users behind
     in the rush towards
          the future.
For example, JavaScript
based solutions should be
  built so that they fail
        gracefully.
We should be careful about
 abandoning users with
older devices because we
don’t want to support them.
Some techniques
that aid our
   outcomes
So, here are some
 strategies and techniques
that are currently considered
       “best practices”.
Be warned, these
  may not be considered
“best practices” in the future!
More importantly, these best
  practice techniques are
designed to help us achieve
   some key outcomes.
Reducing
repetition
1:
CSS resets
CSS resets aim to remove
browser-specific styles, and
then build up from scratch -
  so that each element will
   appear the same in all
          browsers
html,body,div,span,applet,object,iframe,h1,h2,
h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,
address,big,cite,code,del,dfn,em,img,ins,kbd,q,
s,samp,small,strike,strong,sub,sup,tt,var,b,u,
i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,
legend,table,caption,tbody,tfoot,thead,tr,th,
td,article,aside,canvas,details,embed,figure,
figcaption,footer,header,hgroup,menu,nav,
output,ruby,section,summary,time,mark,audio,
video
{
      margin:0;
      padding:0;
      border:0;
      font-size:100%;
      font: inherit;
      vertical-align: baseline;
}
Strengths:
Efficient development
Consistency for teams

Weaknesses:
lots of additional rewriting
2:
CSS frameworks
CSS frameworks are
 pre-prepared libraries that
allow for easier, standards-
 compliant styling of web
     page components.
Many frameworks focus on
   layout grids, allowing
developers to pull in library
classes to build complex
         layouts.
.column, .span-1, .span-2,
.span-3, .span-4, .span-5,
.span-6, .span-7, .span-8,
.span-9, .span-10, .span-11,
.span-12, .span-13, .span-14,
.span-15, .span-16, .span-17,
.span-18, .span-19, .span-20,
.span-21, .span-22, .span-23,
.span-24 {float:left;margin-
right:10px;}
Keep in mind you can
always roll your own
    framework.
Strength
Efficient development
Lean, abstracted CSS

Weaknesses
Designs that don’t fit
Bloated frameworks
Presentational class names
Maintainable
and scalable
3:
Object-oriented CSS
How many times
does your CSS file
  mention H2 or
   “float: left”?
Do you ever find
yourself styling
using Firebug?
Object-oriented CSS styles
    HTML “objects” or
 “modules” with cleaner,
  more efficient CSS.
For all the hardcore
developers… yes, it’s not
 really object-oriented.
   It’s just a name!
There is a strong chance
 that you may be “doing it
wrong”, or could at least be
    “doing it better”.
How do we use
Object Oriented CSS
Before starting your CSS,
 look at your layouts and
   try to find patterns.
Are there aspects of the
  layout that could be
abstracted into library
        items?
Strengths
lean, robust CSS
easier site maintenance
avoid repetitive CSS
avoid specificity wars

Weaknesses
additional HTML classes
new mindset
Efficiency
4:
Pre-processors
Pre-processors allow us to
use variables in CSS files
 and then parse them to
  regular stylesheets.
There are many different
 frameworks available:

          • LESS
           • SASS
         • Turbine
       • Switch CSS
          • DtCSS
       • CSS Crush
Variables
@color1:   red;
@color2:   green;
@color3:   blue;
@color4:   orange;
@color5:   brown;

#a { background: @color1; }
Minification
div{width:200px;height:200px;
-webkit-border-radius:10px;-
moz-border-
radius:10px;border-
radius:10px;}
#one{background:red;-webkit-
border-radius:20px;-moz-
border-radius:20px;border-
radius:20px;}#one
a{color:green;}
#two{background:green;-
Mixins
.border-radius(@radius: 5px)
{
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}

div { .border-radius(); }
Packing
Gzipping
Compiling
Strength
faster development
variables!

Weaknesses
deep nesting
inefficient CSS
entirely new syntax
Device
independence
5:
Responsive design
Until recently, people built
sites for desktop and/or
       mobile only.
Responsive design is
about creating sites that
 adapt to any device.
Problem 1:
solving screen size
Ideally, we want to start with
  a single linear layout that
   can be viewed by any
            device.
Then we gradually build a
   series of advanced fluid
layouts on top, controlled by
      media queries or
         JavaScript.
@media only screen and
(min-width: 800px) and
(max-width: 999px)
{
}

@media only screen and
(min-width: 1000px)
{
}
This means we can deliver
 entirely different layouts
 based on the viewport.
Problem 2:
Solving bandwidth
      issues
But what about
images and other rich
      media?
Ideally, we should deliver
low end images and media
        as the default.
Then we deliver larger,
richer media for those
devices with suitable
      bandwidth.
Problem 3:
content and context
Another problem we face is
 determining what types of
content should be delivered
  to devices, and in what
  context are people are
      using the site.
It is not as simple as
  delivering stripped back
           content for
     mobile devices and
rich content for desktops.
The reality is that these last
two problems are not solved
    yet. But a change is
           coming.
I think we are at a tipping
  point. Very soon, a major
 site is going to crack these
three problems and change
   the way we build sites.
Final words?
A solution that seems
 ideal today may be
outdated tomorrow.
Focus on outcomes rather
   than using the latest
        technique.
But most of all
we should have fun!
So, what are your
best practices?

Weitere ähnliche Inhalte

Was ist angesagt?

Meta layout: a closer look at media queries
Meta layout: a closer look at media queriesMeta layout: a closer look at media queries
Meta layout: a closer look at media queries
Stephen Hay
 

Was ist angesagt? (9)

Responsive Web Design for Universal Access 2016
Responsive Web Design for Universal Access 2016Responsive Web Design for Universal Access 2016
Responsive Web Design for Universal Access 2016
 
Css3
Css3Css3
Css3
 
What Would Core Do?
What Would Core Do?What Would Core Do?
What Would Core Do?
 
Enterprise Class WordPress
Enterprise Class WordPressEnterprise Class WordPress
Enterprise Class WordPress
 
Responsive Web Design: Tips and Tricks
Responsive Web Design: Tips and TricksResponsive Web Design: Tips and Tricks
Responsive Web Design: Tips and Tricks
 
Style Guides, Pattern Libraries, Design Systems and other amenities.
 Style Guides, Pattern Libraries, Design Systems and other amenities. Style Guides, Pattern Libraries, Design Systems and other amenities.
Style Guides, Pattern Libraries, Design Systems and other amenities.
 
ClassicPress / WordPress
ClassicPress / WordPressClassicPress / WordPress
ClassicPress / WordPress
 
Meta layout: a closer look at media queries
Meta layout: a closer look at media queriesMeta layout: a closer look at media queries
Meta layout: a closer look at media queries
 
Speed
SpeedSpeed
Speed
 

Andere mochten auch

Andere mochten auch (13)

Accessible modal windows
Accessible modal windowsAccessible modal windows
Accessible modal windows
 
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)
 
Three quick accessibility tips for HTML5
Three quick accessibility tips for HTML5Three quick accessibility tips for HTML5
Three quick accessibility tips for HTML5
 
CSS: a rapidly changing world
CSS: a rapidly changing worldCSS: a rapidly changing world
CSS: a rapidly changing world
 
Specialise or cross-skill
Specialise or cross-skillSpecialise or cross-skill
Specialise or cross-skill
 
CSS Best practice
CSS Best practiceCSS Best practice
CSS Best practice
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and more
 
Responsive Web Design - more than just a buzzword
Responsive Web Design - more than just a buzzwordResponsive Web Design - more than just a buzzword
Responsive Web Design - more than just a buzzword
 
Creating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off SwitchCreating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off Switch
 
CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong? CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong?
 
Snigdha
Snigdha Snigdha
Snigdha
 
CSS pattern libraries
CSS pattern librariesCSS pattern libraries
CSS pattern libraries
 
Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
 

Ähnlich wie Is everything we used to do wrong?

Ähnlich wie Is everything we used to do wrong? (20)

What’s Up, EDoc?!
What’s Up,EDoc?!What’s Up,EDoc?!
What’s Up, EDoc?!
 
Knowing it all
Knowing it allKnowing it all
Knowing it all
 
Mobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignMobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web Design
 
Css tools and methodologies
Css tools and methodologiesCss tools and methodologies
Css tools and methodologies
 
Stc 2015 preparing legacy projects for responsive design - technical issues
Stc 2015   preparing legacy projects for responsive design - technical issuesStc 2015   preparing legacy projects for responsive design - technical issues
Stc 2015 preparing legacy projects for responsive design - technical issues
 
Single sourcing to the max
Single sourcing to the maxSingle sourcing to the max
Single sourcing to the max
 
Web Summer Camp Keynote
Web Summer Camp KeynoteWeb Summer Camp Keynote
Web Summer Camp Keynote
 
Agile mobile first
Agile mobile firstAgile mobile first
Agile mobile first
 
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
 
Bootstrap for Beginners
Bootstrap for BeginnersBootstrap for Beginners
Bootstrap for Beginners
 
Developing for the unknown lavacon
Developing for the unknown   lavaconDeveloping for the unknown   lavacon
Developing for the unknown lavacon
 
Developing for the unknown lavacon
Developing for the unknown   lavaconDeveloping for the unknown   lavacon
Developing for the unknown lavacon
 
January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...
January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...
January 2017 - WPCampus Online - Learning from Drupal: Implementing WordPress...
 
syllabas-mohamedelzanty
syllabas-mohamedelzantysyllabas-mohamedelzanty
syllabas-mohamedelzanty
 
Startup Institute NYC: Styling
Startup Institute NYC: StylingStartup Institute NYC: Styling
Startup Institute NYC: Styling
 
Going Mobile First With Drupal
Going Mobile First With DrupalGoing Mobile First With Drupal
Going Mobile First With Drupal
 
Css masterclass book
Css masterclass bookCss masterclass book
Css masterclass book
 
CMS Refresher: Content is King
CMS Refresher: Content is KingCMS Refresher: Content is King
CMS Refresher: Content is King
 
Bridging the gap between designers and developers at theguardian.com
Bridging the gap between designers and developers at theguardian.comBridging the gap between designers and developers at theguardian.com
Bridging the gap between designers and developers at theguardian.com
 
The Guide to becoming a full stack developer in 2018
The Guide to becoming a full stack developer in 2018The Guide to becoming a full stack developer in 2018
The Guide to becoming a full stack developer in 2018
 

Mehr von Russ Weakley

Mehr von Russ Weakley (20)

Accessible chat windows
Accessible chat windowsAccessible chat windows
Accessible chat windows
 
Accessible names & descriptions
Accessible names & descriptionsAccessible names & descriptions
Accessible names & descriptions
 
A deep dive into accessible names
A deep dive into accessible namesA deep dive into accessible names
A deep dive into accessible names
 
What are accessible names and why should you care?
What are accessible names and why should you care?What are accessible names and why should you care?
What are accessible names and why should you care?
 
How to build accessible UI components
How to build accessible UI componentsHow to build accessible UI components
How to build accessible UI components
 
What is WCAG 2 and why should we care?
What is WCAG 2 and why should we care?What is WCAG 2 and why should we care?
What is WCAG 2 and why should we care?
 
Accessible states in Design Systems
Accessible states in Design SystemsAccessible states in Design Systems
Accessible states in Design Systems
 
Creating accessible modals and autocompletes
Creating accessible modals and autocompletesCreating accessible modals and autocompletes
Creating accessible modals and autocompletes
 
Building an accessible progressive loader
Building an accessible progressive loaderBuilding an accessible progressive loader
Building an accessible progressive loader
 
Accessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and gloryAccessibility in Design systems - the pain and glory
Accessibility in Design systems - the pain and glory
 
Accessible Inline errors messages
Accessible Inline errors messagesAccessible Inline errors messages
Accessible Inline errors messages
 
Accessible Form Hints and Errors
Accessible Form Hints and ErrorsAccessible Form Hints and Errors
Accessible Form Hints and Errors
 
What is accessibility?
What is accessibility?What is accessibility?
What is accessibility?
 
Accessibility in Pattern Libraries
Accessibility in Pattern LibrariesAccessibility in Pattern Libraries
Accessibility in Pattern Libraries
 
Accessibility in pattern libraries
Accessibility in pattern librariesAccessibility in pattern libraries
Accessibility in pattern libraries
 
Building an accessible auto-complete - #ID24
Building an accessible auto-complete - #ID24Building an accessible auto-complete - #ID24
Building an accessible auto-complete - #ID24
 
Building an accessible auto-complete
Building an accessible auto-completeBuilding an accessible auto-complete
Building an accessible auto-complete
 
Creating Acessible floating labels
Creating Acessible floating labelsCreating Acessible floating labels
Creating Acessible floating labels
 
Creating an Accessible button dropdown
Creating an Accessible button dropdownCreating an Accessible button dropdown
Creating an Accessible button dropdown
 
Accessible custom radio buttons and checkboxes
Accessible custom radio buttons and checkboxesAccessible custom radio buttons and checkboxes
Accessible custom radio buttons and checkboxes
 

Kürzlich hochgeladen

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Kürzlich hochgeladen (20)

Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 

Is everything we used to do wrong?