Skip to content

Instantly share code, notes, and snippets.

View shawnbot's full-sized avatar

Shawn Allen shawnbot

View GitHub Profile
@shawnbot
shawnbot / tokens.yml
Created April 19, 2017 21:23
Design tokens for Jekyll
colorBlue: '#00f'
colorGreen: '#0f0'
colorRed: '#f00'
@shawnbot
shawnbot / README.md
Last active April 14, 2017 19:22
USWDS + node-sass

U.S. Web Design Standards + node-sass

This is a very simple example of how to set up [node-sass] to build on the [U.S. Web Design Standards][uswds]. To run it:

  1. Install [Node.js].

  2. Install node-sass and the Standards source files with:

npm install

@shawnbot
shawnbot / index.md
Last active March 24, 2017 16:31
A proposal for converting atomic HTML to semantic class names

The pitch

What if you could design components using [atomic CSS], then publish them with more user-friendly semantic classes?

Example

Let's say you're using [Tachyons], but you can't stomach the markup for its starup hero component:

<header class="sans-serif">
  <div class="cover bg-left bg-center-l" style="background-image: url(http://mrmrs.io/photos/u/011.jpg)">
    <div class="bg-black-80 pb5 pb6-m pb7-l">
@shawnbot
shawnbot / pagespeed.json
Created March 3, 2017 00:33
Sample JSON output from the Google PageSpeed Insights API for standards.usa.gov
{
"kind": "pagespeedonline#result",
"id": "https://standards.usa.gov/",
"responseCode": 200,
"title": "U.S. Web Design Standards Documentation | Announcing version 1.0",
"ruleGroups": {
"SPEED": {
"score": 66
},
"USABILITY": {
@shawnbot
shawnbot / 18f-pages.rb
Last active February 7, 2017 00:42
18F Pages Federalist preview URL fix
PAGES_BRANCHES = ['18f-pages']
if PAGES_BRANCHES.include? ENV['BRANCH']
Jekyll::Hooks.register :site, :pre_render do |site|
site.config['baseurl'] = '/{repo}'
end
end
@shawnbot
shawnbot / example.sketch.json
Created January 13, 2017 23:33
sketch-node-parser example output
{
"currentPageIndex": null,
"assets": {
"gradients": [],
"colors": [],
"imageCollection": {
"images": {}
},
"images": []
},
@shawnbot
shawnbot / README.md
Created January 5, 2017 23:14
Fractal live context editor configuration

This is a minimal fractal.js for testing the live context data editor proposed in this PR.

@shawnbot
shawnbot / .babelrc
Last active December 3, 2016 00:50
Browserify vs. Splittable tree-shaking
{"presets": ["es2015", "stage-0"]}
@shawnbot
shawnbot / README.md
Created November 21, 2016 15:37
Jekyll page preview + source

This is a Jekyll-specific way to render HTML source for a given page (in this case, one in a collection) alongside the markup itself without having to duplicate content in includes.

@shawnbot
shawnbot / _mixins.scss
Last active October 28, 2016 00:34
design token ideas
// generate a custom element selector with the correct prefix
@mixin custom-element($name) {
#{$usa-prefix}-#{$name} {
@content;
}
}