Less Code

Simplifying front-end

Belén Albeza
@ladybenko

Let me tell you a story…

On dogmatism

Learn to identify dogmas

Develop your own criteria

Image credit: danc86 @ flickr

On keeping up

Front-end is ever-changing

Change is good

But…

Are you overwhelmed?

I am

You don't have to keep up

You have to find balance

On dealing with clutter

Features == possessions

Image credit: mlspooky @ flickr

Only keep what's useful or make users happy

The hidden cost of things

Less features makes you agile

On simplicity

Have decent HTML and CSS

Be aware of UX frameworks

Avoid insane HTML

How can this… ?

…become this?

<div class="row">
  <div class="col s12 m6">
    <div class="card blue-grey darken-1">
      <div class="card-content white-text">
        <span class="card-title">Card Title</span>
        <p>I am a very simple card. I am good at containing small bits of information.
        I am convenient because I require little markup to use effectively.</p>
      </div>
      <div class="card-action">
        <a href="#">This is a link</a>
      </div>
    </div>
  </div>
</div>

…and not this?

<article class="card light">
    <h1 class="card-title">Card Title</h1>
    <p>I am a very simple card. I am good at containing small bits of information.
    I am convenient because I require little markup to use effectively.</p>
    <nav class="card-action">
        <a href="#">This is a link</a>
    </nav>
</article>

Make your CSS flexible to design changes

When using a CSS transpiler

Don't abuse nesting

.post {
    & > header {
        .meta {
            a {
                color: red;
            }
        }
    }
}

Read more about abusing nesting

JavaScript

Favor modularity

Image credit: queenieandthedew @ flickr

Know when & how to concede

Thanks!

Questions?

belen@mozilla.com
#devrel at irc.mozilla.org