Skip to content

Commit

Permalink
Merge branch 'stage-v5.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Harvey committed Feb 21, 2017
2 parents df47f00 + 1c5f546 commit 9697ca8
Show file tree
Hide file tree
Showing 32 changed files with 1,157 additions and 164 deletions.
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Some are *fallbacks*, starting with `__fallback`, which are simply mixins that
include properties supported by different browser vendors.
Others are *tools*, starting with `__tool`, which group similar properties
to create one functional styling unit.
(Read `/docs/tools.md` for details and usage.)
The settings file, `__settings.less`, contains all global variables.

If you want to use a particular tool in your stylesheet, you will have to
Expand Down Expand Up @@ -73,8 +74,7 @@ To use the Xmeter global variables, import the `__settings` stylesheet.

Files in the `src/` folder not starting with `__`
provide actual styles for actual elements. Also unlike those partials,
**these stylesheets are *not* meant to be cherrypicked**. They are compiled
separately<sup>&lowast;</sup> and
**these stylesheets are *not* meant to be cherrypicked**. They are
concatenated together in the main file `xmeter.css`. If you’re developing a
stylesheet that you want built off of Xmeter, include
```less
Expand All @@ -91,15 +91,11 @@ in the `<head>` of your document.
Don’t like Xmeter’s default styles but still want to use the tools?
That’s okay! Just don’t import or link the css file.

<i><sup>&lowast;</sup>The reason the stylesheets are compiled separately is to increase
encapsulation: private variables and mixins can be defined within the file without
affecting other files.</i>

In addition to base styles are classes for Objects (`src/_o-*.less`) and Helpers (`src/_h-*.less`),
for aiding in a consistent, easy-to-use, vertical rhythm system.
These classes are meant to be directly injected into elements’ HTML `[class]` attribute on your site.
However you may, if you wish, `@extend` or include (mix-in) them into your
codebase—though this is *not recommended*.
These classes are meant to be directly injected into elements’ HTML `[class]` attribute on your site,
but you may, if you wish, `@extend` or include (mix-in) them into your
codebase.

### Deployment

Expand Down Expand Up @@ -137,14 +133,14 @@ Features of this stylesheet include the following.

- Vertical rhythm &mdash; every line on the page is exactly the same height
(dubbed a “vertical rhythm unit” or “vru”) regardless of font size, and
typographical elements (headings, paragraphs, figures, blockquotes, lists,
typographical block elements (headings, paragraphs, figures, blockquotes, lists,
tables, etc.) are separated by integer multiples of that height.
- The following convention is used to preserve vertical rhythm:
- Bottom margin is added to an element in order to push subsequent elements down the page.
- Top padding is added to an element to push *itself* down the page.
- Negative top margin is added to an element to pull it up the page.
- Font-size of `<html>` is set to `100%` to accommodate for user agent settings.
- Units for font-size on **modules** (not explicitly defined in this project)
- Units for font-size on modules
should be set in `rem`s, so that their vertical typography remains the same
regardless of where that module is placed (style does not depend on location).
(`<html>` is considered a module.)
Expand Down
66 changes: 28 additions & 38 deletions docs/_docs.tpl.jade
Original file line number Diff line number Diff line change
@@ -1,58 +1,48 @@
doctype html
html(lang="en")
mixin doctoc(args)
mixin doctoc(args, inner)
//- NOTE parameter validation
-
var pages = args.pages || []
var classes = args.classes || {}
var depth = +args.depth || 0
ol(class=classes.listclasses)
ol(class=classes.listclasses)&attributes(inner ? {} : { role: 'directory' })
each item in pages
unless item.isHidden()
li(class=classes.itemclasses)
a(class=classes.linkclasses href=item.url())= item.name()
if item.description()
= ': ' + item.description()
if item.findAll().length && depth > 0
+doctoc({pages: item.findAll(), classes: (classes.sub || {}), depth: depth-1})
mixin newSection(hn, page)
-
var text = page.name()
var id = page.url().split('#')[1]
li(class=classes.itemclasses)
a(class=classes.linkclasses href=item.url())= item.name()
if item.description()
= ': ' + item.description()
if item.findAll().length && depth > 0
+doctoc({pages: item.findAll(), classes: (classes.sub || {}), depth: depth-1}, true)
mixin newSection(n, page)
- var id = page.url().split('#')[1]
section(id=id)
if hn === 1
h1 #{text} #[a.docs-_fragid(href='#' + id)]
else if hn === 2
h2 #{text} #[a.docs-_fragid(href='#' + id)]
else if hn === 3
h3 #{text} #[a.docs-_fragid(href='#' + id)]
else
p #{text}
| <h#{n}>#{page.name()} <a class="docs-_fragid" href="##{id}" aria-label="permalink"></a></h#{n}>
block
block vars
head
title= page.title() || (page.name() + ' | ' + Xmeter.DOCS.name())
meta(charset="utf-8")
meta(name="description" content=Xmeter.DOCS.description())
meta(name="viewport" content="width=device-width, initial-scale=1")
link(rel="stylesheet" href="../xmeter.css")
link(rel="stylesheet" href="styles/docs.css")
block styles
link(rel="stylesheet" href="https://cdn.rawgit.com/chharvey/bangs/v0.9.0/bangs.min.css")
link(rel="stylesheet" href="../xmeter.css")
link(rel="stylesheet" href="styles/docs.css")
body.docs-body
main.docs-main
a.h-Hidden(href="#main") skip to main content
header
h1= Xmeter.DOCS.name()
p= Xmeter.DOCS.description()
nav#sitemap
h1.h-Hidden Sitemap
+doctoc({pages: Xmeter.DOCS.findAll()})
main.docs-main#main
block main
header
//- h1= page.title() || (Xmeter.DOCS.name() + ' — ' + page.name())
if page.title()
h1= page.title()
else
h1 #[a(href=Xmeter.DOCS.url())= Xmeter.DOCS.name()] &mdash; #{page.name()}
block mainIntro
p= page.description()
nav
h2 Table of Contents
block toc
h1= page.name()
p= page.description()
block toc
nav#table-contents
h2 Table of Contents
+doctoc({pages: page.findAll(), depth: Infinity})
block footer
footer: nav
h1 Sitemap
+doctoc({pages: Xmeter.DOCS.findAll()})
8 changes: 4 additions & 4 deletions docs/_includes/_base.jade
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ section#forms
label
input(type="checkbox")
| all
input(type="checkbox")
label applicable
input#checkboxid(type="checkbox")
label(for="checkboxid") applicable
figure(class=classname.figure)
fieldset
legend radio buttons
Expand All @@ -285,8 +285,8 @@ section#forms
label
input(type="radio" name="radiogroup1")
| only
input(type="radio" name="radiogroup1")
label one
input#radioid(type="radio" name="radiogroup1")
label(for="radioid") one
figure(class=classname.figure)
fieldset
legend drop-down list (select only one)
Expand Down
7 changes: 7 additions & 0 deletions docs/_includes/_help.hidden.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
p.
The Hidden helper visually hides an element while keeping it accessible to non-visual
media such as screen readers. A #[b skip link] is a common example.
figure.docs-figure
a.h-Hidden(href="#0") skip to main content
pre.docs-pre.
&lt;a class="#[u h-Hidden]" href="#main"&gt;skip to main content&lt;/a&gt;
63 changes: 63 additions & 0 deletions docs/_models/Xmeter.class.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
var Page = require('sitepage').Page

/**
* A set of static members used for the site.
* Similar to a utility class.
* @type {Xmeter}
*/
module.exports = (function () {
// CONSTRUCTOR
function Xmeter() {}

// METHODS

// STATIC MEMBERS
/**
* The style guide site for this project.
* @type {Page}
*/
Xmeter.DOCS = new Page({ name: 'Xmeter Style Guide', url: '/docs/' })
.title('Xmeter Style Guide')
.description('A demo of Xmeter styles.')
.add(new Page({ name: 'Home', url: 'index.html' })
.description('Xmeter Homepage')
)
.add(new Page({ name: 'Base Typography', url: 'base.html' })
.description('Bare, unstyled HTML elements. No classes.')
.add(new Page({ name: 'Grouping Elements', url: 'base.html#grouping-elements' })
.add(new Page({ name: 'Headings & Paragraphs', url: 'base.html#headings-paragraphs' }))
.add(new Page({ name: 'Lists' , url: 'base.html#lists' }))
.add(new Page({ name: 'Tables' , url: 'base.html#tables' }))
)
.add(new Page({ name: 'Text-Level Elements', url: 'base.html#text-level-elements' })
.add(new Page({ name: 'Links' , url: 'base.html#links' }))
.add(new Page({ name: 'Stress' , url: 'base.html#stress' }))
.add(new Page({ name: 'Documentation', url: 'base.html#documentation' }))
.add(new Page({ name: 'Data' , url: 'base.html#data' }))
)
.add(new Page({ name: 'Forms' , url: 'base.html#forms' }))
.add(new Page({ name: 'Embedded Elements' , url: 'base.html#embedded-elements' }))
.add(new Page({ name: 'Interactive Elements', url: 'base.html#interactive-elements' }))
)
.add(new Page({ name: 'Objects', url: 'obj.html' })
.description('Patterns of structure that can be reused many times for many different purposes.')
.add(new Page({ name: 'The List Object' , url: 'obj.html#list-object' }))
.add(new Page({ name: 'The Flex Object' , url: 'obj.html#flex-object' }))
.add(new Page({ name: 'The Grid Object' , url: 'obj.html#grid-object' }))
)
.add(new Page({ name: 'Helpers', url: 'help.html' })
.description('Somewhat explicit classes used for enhancing default styles.')
.add(new Page({ name: 'Block' , url: 'help.html#block' }))
.add(new Page({ name: 'Inline' , url: 'help.html#inline' }))
.add(new Page({ name: 'Clearfix' , url: 'help.html#clearfix' }))
.add(new Page({ name: 'Hidden' , url: 'help.html#hidden' }))
)
.add(new Page({ name: 'Atoms', url: 'atom.html' })
.description('Very specific classes used for creating anomalies or fixing broken styles.')
.add(new Page({ name: 'margin-bottom' , url: 'atom.html#margin-bottom' }))
.add(new Page({ name: 'padding-top' , url: 'atom.html#padding-top' }))
.add(new Page({ name: 'font-size' , url: 'atom.html#font-size' }))
)

return Xmeter
})()
63 changes: 0 additions & 63 deletions docs/_models/classes/Xmeter.class.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/_models/options.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Options and locals for compiling Pug pages.
module.exports = {
Xmeter: require('./classes/Xmeter.class.js')
Xmeter: require('./Xmeter.class.js')
}
6 changes: 3 additions & 3 deletions docs/atom.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html><html lang="en"><head><title>Atoms | Xmeter</title><meta charset="utf-8"><meta name="description" content="A demo of Xmeter styles."><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="../xmeter.css"><link rel="stylesheet" href="styles/docs.css"></head><body class="docs-body"><main class="docs-main"><header><h1><a href="/docs/">Xmeter</a> &mdash; Atoms</h1><p>Very specific classes used for creating anomalies or fixing broken styles.</p><nav><h2>Table of Contents</h2><ol><li><a href="atom.html#margin-bottom">margin-bottom</a></li><li><a href="atom.html#padding-top">padding-top</a></li><li><a href="atom.html#font-size">font-size</a></li></ol></nav></header><section id="margin-bottom"><h2>margin-bottom <a class="docs-_fragid" href="#margin-bottom"></a></h2><p>This atom sets the bottom margin to one <dfn>vertical rhythm unit</dfn> (1vru),
<!DOCTYPE html><html lang="en"><head><title>Atoms | Xmeter Style Guide</title><meta charset="utf-8"><meta name="description" content="A demo of Xmeter styles."><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="https://cdn.rawgit.com/chharvey/bangs/v0.9.0/bangs.min.css"><link rel="stylesheet" href="../xmeter.css"><link rel="stylesheet" href="styles/docs.css"></head><body class="docs-body"><a class="h-Hidden" href="#main">skip to main content</a><header><h1>Xmeter Style Guide</h1><p>A demo of Xmeter styles.</p><nav id="sitemap"><h1 class="h-Hidden">Sitemap</h1><ol role="directory"><li><a href="index.html">Home</a>: Xmeter Homepage</li><li><a href="base.html">Base Typography</a>: Bare, unstyled HTML elements. No classes.</li><li><a href="obj.html">Objects</a>: Patterns of structure that can be reused many times for many different purposes.</li><li><a href="help.html">Helpers</a>: Somewhat explicit classes used for enhancing default styles.</li><li><a href="atom.html">Atoms</a>: Very specific classes used for creating anomalies or fixing broken styles.</li></ol></nav></header><main class="docs-main" id="main"><header><h1>Atoms</h1><p>Very specific classes used for creating anomalies or fixing broken styles.</p><nav id="table-contents"><h2>Table of Contents</h2><ol role="directory"><li><a href="atom.html#margin-bottom">margin-bottom</a></li><li><a href="atom.html#padding-top">padding-top</a></li><li><a href="atom.html#font-size">font-size</a></li></ol></nav></header><section id="margin-bottom"><h2>margin-bottom <a class="docs-_fragid" href="#margin-bottom" aria-label="permalink"></a></h2><p>This atom sets the bottom margin to one <dfn>vertical rhythm unit</dfn> (1vru),
which is equal to the <code class="docs-code">html</code> element&rsquo;s
<code class="docs-code">line-height</code> multiplied by
<code class="docs-code">1rem</code>.</p><pre class="docs-pre">.-mb-1vru { margin-bottom: var(--vru); }</pre><figure class="docs-figure"><div class="-mb-1vru">Most typographical block elements like paragraphs and lists are automatically given this style.</div><pre class="docs-pre">&lt;div class="<u>-mb-1vru</u>"&gt;Most ...&lt;/div&gt;</pre></figure></section><section id="padding-top"><h2>padding-top <a class="docs-_fragid" href="#padding-top"></a></h2><p>This atom sets the top padding to 1<b><abbr title="vertical rhythm unit">vru</abbr></b>.</p><pre class="docs-pre">.-pt-1vru { padding-top: var(--vru); }</pre><figure class="docs-figure"><div class="-pt-1vru">Usually only Heading 1 is given this style, but it is also useful for moving an element down the page.</div><pre class="docs-pre">&lt;div class="<u>-pt-1vru</u>"&gt;Usually only ...&lt;/div&gt;</pre></figure></section><section id="font-size"><h2>font-size <a class="docs-_fragid" href="#font-size"></a></h2><p>These are two groups of atoms. The first group simply sets the font size of an element.
<code class="docs-code">1rem</code>.</p><pre class="docs-pre">.-mb-1vru { margin-bottom: var(--vru); }</pre><figure class="docs-figure"><div class="-mb-1vru">Most typographical block elements like paragraphs and lists are automatically given this style.</div><pre class="docs-pre">&lt;div class="<u>-mb-1vru</u>"&gt;Most ...&lt;/div&gt;</pre></figure></section><section id="padding-top"><h2>padding-top <a class="docs-_fragid" href="#padding-top" aria-label="permalink"></a></h2><p>This atom sets the top padding to 1<b><abbr title="vertical rhythm unit">vru</abbr></b>.</p><pre class="docs-pre">.-pt-1vru { padding-top: var(--vru); }</pre><figure class="docs-figure"><div class="-pt-1vru">Usually only Heading 1 is given this style, but it is also useful for moving an element down the page.</div><pre class="docs-pre">&lt;div class="<u>-pt-1vru</u>"&gt;Usually only ...&lt;/div&gt;</pre></figure></section><section id="font-size"><h2>font-size <a class="docs-_fragid" href="#font-size" aria-label="permalink"></a></h2><p>These are two groups of atoms. The first group simply sets the font size of an element.
The second group uses the <code class="docs-code">.font-size-el()</code> mixin,
for maintaining vertical rhythm.</p><p>See all the font sizes in the source file <code class="docs-code">/src/__settings.less</code>,
and all atoms in <code class="docs-code">/src/_atom.less</code></p><pre class="docs-pre">@g-font_size_peta: 96/16;
Expand Down Expand Up @@ -29,4 +29,4 @@
&lt;li class="<u>-fz-el-kilo</u>"&gt;asteroid (1.50/1.000)&lt;/li&gt;
&lt;li class="<u>-fz-el-norm</u>"&gt;molecule (1.00/1.500)&lt;/li&gt;
&lt;li class="<u>-fz-el-mill</u>"&gt;atom (0.75/2.000)&lt;/li&gt;
&lt;li class="<u>-fz-el-micr</u>"&gt;quark (0.50/3.000)&lt;/li&gt;</pre></figure></section></main><footer><nav><h1>Sitemap</h1><ol><li><a href="index.html">Xmeter</a>: A demo of Xmeter styles.</li><li><a href="base.html">Base Typography</a>: Bare, unstyled HTML elements. No classes.</li><li><a href="obj.html">Objects</a>: Patterns of structure that can be reused many times for many different purposes.</li><li><a href="help.html">Helpers</a>: Somewhat explicit classes used for enhancing default styles.</li><li><a href="atom.html">Atoms</a>: Very specific classes used for creating anomalies or fixing broken styles.</li></ol></nav></footer></body></html>
&lt;li class="<u>-fz-el-micr</u>"&gt;quark (0.50/3.000)&lt;/li&gt;</pre></figure></section></main></body></html>
Loading

0 comments on commit 9697ca8

Please sign in to comment.