bonkr logo. stupid looking face thing

BONKR

Boilerplate - Opinionated (kinda), NaKed, & Responsive

Bonkr is a normalized CSS boilerplate with a focus on style-agnostic usability, a simple layout system, and responsive flexibility. It's created as a starter-template with default component proportions & weight and some basic styling that won't conflict with yours, + some nice (and independant) features like dialogs and a loader.

You won't find any colours, embedded fonts, or navigation here — just a beautiful blank-slate for your content.

Getting Started #

1. Get The Code

bonkr/
  ├── index.html
  ├── readme.md
  └── src/
      ├── bonkr.css
      ├── bonkr-dialog.js
      └── bonkr-loader.js

2.   Add files to your project

<html>
  <head>
    <link rel="stylesheet" href="./<your-path>/bonkr.css">
  </head>
  <body>
    // Content
    <script src="./<your-path>/bonkr-dialog.js"></script>
    <script src="./<your-path>/bonkr-loader.js"></script>
  </body>
</html>

3.   Code away — and/or check out the documentation below

Typography #

Font-sizing is rem based, relative to html { font-size: 17px; line-height: 1.6 }. No font-family is chosen, other than sans-serif, for simplicity — just copy the Open Sans, Proxima Nova, & Roboto link tags from your other projects...

<p>
  Font-sizing is <code>rem</code> based...
</p>

Anchor   <a>
Underline   <u>
Emphasis   <em>
Strong   <strong>
Bold   <b>
Small   <small>
SuperscriptTM   <sup>
Citation   <cite>
Strikethrough   <s>

Headings #

Note —  Each section heading on this page is an <h3>

Serenity Now!

I Want To Believe

Ez Mid

You, Shall Not Pass..

Fuck Trump
Your Bootstrap Site Sucks
<h1> 3.4rem
<h2> 2.8rem
<h3> 2.3rem
<h4> 1.7rem
<h5> 1.3rem
<h6> 1.1rem

Hr #


Lists #

  1. pantaloons
  2. numenor
  3. pickleback
    • hopscotch

Blockquote #

I am a blockquote, and adding .quote will display this nifty quote on the right.

<blockquote class='quote'>
  <p>
    I am a <strong>blockquote</strong>, and adding <code>.quote</code> will display this nifty quote on the right.
  </p>
</blockquote>

Tables #

Class Subraces Ability Bonus
Dwarf Hill, Mountain +2 Constitution
Halfling Lightfoot, Stout +2 Dexterity
Elf High, Wood, Drow +2 Dexterity
<table>
  <thead>
    <tr>
      <th>Class</th>
      <th>Subrace</th>
      <th>Ability Bonus</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Dwarf</td>
      <td>Hill, Mountain</td>
      <td>+2 Constitution</td>
    </tr>
    <tr>
      <td>Halfling</td>
      <td>Lightfoot, Stout</td>
      <td>+2 Dexterity</td>
    </tr>
    <tr>
      <td>Elf</td>
      <td>High, Wood, Drow</td>
      <td>+2 Dexterity</td>
    </tr>
  </tbody>
</table>

Code #

I am inline with other text

<code>I am inline</code> with other text

But I am a big block of code,
ooh yea..
<pre>
  <code>
    But I am a big block of code,
    ooh yea...
  </code>
</pre>

Sections #

Structural basics in BONKR are focused on <main> content. Each section on this page lies within a (you guessed it) <section>, which are centered, with padding, & max width.

section {
  margin: 0 auto;
  max-width: 1100px;
  padding: 1.76rem 2.35rem; }

<header>, <nav>, <footer>, & <aside> are left alone to avoid "Bootstrapping" your styles. When adding these, you can use the flex helper classes below for layout; or just write custom styling.

You can obv overwrite the above styling with your preferred max-width, or use the .w-mx-# helper classes below.

Articles #

An <article> is used to make a full-width bar like this. This is helpful when you want a background-colour, background-image, or width: 100% content. Since the <section> is a centered container, you can nest one inside to hold your content.

<article>
  <section>
    <p>
      I am an article
    </p>
  </section>
</article>
Why?

This is done to avoid unecessary classes, using divs like .bar & .inner and such. Yes it's opinionated, and yes it's 3 lines of code you can remove if you so choose.

article {
  margin: 3.52rem 0;
  background: #f2f2f2; }

Buttons #

No, there aren't .filled, .knockout, .ghost, .simple classes in a variety of MaterialTM pallettes — yes, :focus, :hover, :active, :disabled, :focus:hover, & :active:hover are taken care of.

Buttons have no margin or spacing if they're butt-to-butt, but you can add margin classes or group into a flex container for separation.

  <br>

Helper class .btn actually has all of the same styles as <button>, if you'd like to style a link.

a .btn

Similarly, :disabled and .disabled function the same way.

a .btn .disabled

Dialog Modal #

Each button below has dialog-btn-open class and a data-dialog-id attribute that corresponds to a dialog modal's unique #dialog-<<id>>

Basic setup would be:

<button class='dialog-btn-open' data-dialog-id='hello'>Open Dialog!<button>

<div class='dialog' id='dialog-hello>
  <div class='dialog-outer'> // Overlay to cover content & close via click
    <div class='dialog-inner'> // Container for dialog content
      <button class='dialog-btn-close'>Close Dialog</button>
      Why hello there, I am a dialog...
    </div>
  </div>
</div>

Usability Notes

Loader #

The small script bonkr-loader.js looks for an element with #bonkr-loader if it exists. Onload, its show class will be removed and it will be hidden. Class loader will style it as a fullscreen overlay.

<div id='bonkr-loader' class='loader show'>
  Loader content
</div>

Forms #


Layout

to-do

Grid

to-do

Padding

Most semantic elements already have default margins & padding (in rem) for base styling, but anything can be customized further.

.pd-a-3 .pd-t-3 .pd-r-5 .pd-b-2 .pd-l-7

Additionally, you can use .pd-ch-# to give direct children the same padding.

Margin

Flexbox #

Examples

flex, row, wrap, shrink 0, margin -2rem, spacing 2rem

.d-flx .flx-row .flx-wr-w .flx-children-s-0 .flx-spc-2 .flx-children-spc-2

flex, row, nowrap, shrink 1, spacing 1rem

.d-flx .flx-row .flx-wr-n .flx-children-s-1 .flx-children-spc-1

Parent Container Classes

Define parent container as display flex, then add classes to customize or define children


  .d-flx { display: flex; }
  .flx-row { flex-direction: row; }
  .flx-col { flex-direction: column; }

  .flx-wr-n { flex-wrap: nowrap; }
  .flx-wr-w { flex-wrap: wrap; }
  .flx-wr-r > * { flex-wrap: wrap-reverse; }

  .flx-spc-1 { margin-left: -0.3rem; margin-right: -0.3rem; }
  .flx-spc-2 { margin-left: -0.59rem; margin-right: -0.59rem; }
  .flx-spc-3 { margin-left: -0.88rem; margin-right: -0.88rem; }
  .flx-spc-4 { margin-left: -1.18rem; margin-right: -1.18rem; }
  
  .flx-children-0  > * { flex: 0; }
  .flx-children-1 > * { flex: 1; }
  
  .flx-children-g-0 > * { flex-grow: 0; }
  .flx-children-g-1 > * { flex-grow: 1; }
  .flx-children-s-0 > * { flex-shrink: 0; }
  .flx-children-s-1 > * { flex-shrink: 1; }
  
  .flx-children-spc-1 > * { margin: 0 0.3rem 0.6rem; }
  .flx-children-spc-2 > * { margin: 0 0.59rem 1.18rem; }
  .flx-children-spc-3 > * { margin: 0 0.88rem 1.76rem; }
  .flx-children-spc-4 > * { margin: 0 1.18rem 2.36rem; }

Children Classes

Define sizing proportions of flex children


  .flx-child-0 { flex: 0; }
  .flx-child-0-5 { flex: 0.5; }
  .flx-child-1 { flex: 1; }
  .flx-child-1-5 { flex: 1.5; }
  .flx-child-2 { flex: 2; }
  .flx-child-2-5 { flex: 2.5; }
  .flx-child-3 { flex: 3; }
  .flx-child-3-5 { flex: 3.5; }
  .flx-child-4 { flex: 4; }

To-Do

BONKR