You might not need a framework

@ladybenko

belen@mozilla.com

UX frameworks

Why people use them?

Some of the problems…

In summary

Hard to maintain code

Is this what you'd like for your theme users?

Layouts

Grid frameworks

If you just need a grid

You don't need a whole UX framework

Today: meet flexbox!

Holy Grail with flexbox

<header class="main-header">Header</header>
<div class="row">
  <aside class="primary-sidebar">Sidebar (left)</aside>
  <main class="content">Main content goes here</main>
  <aside class="secondary-sidebar">Sidebar (right)</aside>
</div>
<footer class="main-footer">Footer</footer>
body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.row { flex: 1 1 auto; }

.main-header, .main-footer {
  flex: 0 0 auto;
}
.row { display: flex; }

.primary-sidebar, .secondary-sidebar {
  flex: 0 0 auto;
  width: 250px;
}

.content {
  flex: 1 1 auto;
  min-width: 400px;
}

Can I use it?

Caveats

But still a great alternative!

How to use it?

Tomorrow: grid!

Holy Grail with grid

<header class="main-header">Header</header>
<main class="content">Main content goes here</main>
<aside class="primary-sidebar">Sidebar (left)</aside>
<aside class="secondary-sidebar">Sidebar (right)</aside>
<footer class="main-footer">Footer</footer>
body {
  height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr 250px;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "h h h"
    "l c r"
    "f f f";
}
.main-header { grid-area: h; }
.main-footer { grid-area: f; }
.primary-sidebar { grid-area: l; }
.secondary-sidebar { grid-area: r; }
.content { grid-area: c; }

How to use it?

Components

Let's re-think this

If you have a custom design…

Wouldn't it be better to implement it from scratch?

If you just need a few UI components…

If you have a big, complex project

If you feel you need a framework…

Thanks!

Questions?