Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

Mobile-first version of Pure's Website #183

Merged
merged 58 commits into from
Jan 21, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
468b6c6
initial pass at changing main.css to be mobile-first
tilomitra Dec 23, 2013
76e5704
Initial commit of Gruntfile.js and grid_units grunt task
tilomitra Dec 27, 2013
422679d
remove pure-g-r and add responsive-grid.css to layout
tilomitra Dec 27, 2013
0055b4f
update home.handlebars to use mobile-first grid
tilomitra Dec 27, 2013
7bc2f56
update partials/base/* to use mobile-first grid
tilomitra Dec 27, 2013
b7c5d7d
update forms/multi.handlebars to use mobile-first grid
tilomitra Dec 27, 2013
bf132c8
update legal.handlebars to use mobile-first grid
tilomitra Dec 27, 2013
ca5cfe1
remove .pure-g-r rule from main.css
tilomitra Dec 27, 2013
85e68ee
Update Gruntfile.js
tilomitra Dec 27, 2013
990b51d
Update grid docs with mobile-first grid info
tilomitra Dec 27, 2013
0eed6e1
Merge branch 'master' into mobile-first
tilomitra Dec 30, 2013
8b2e15d
Revert "Update grid docs with mobile-first grid info"
tilomitra Jan 3, 2014
a92223a
Update Gruntfile, main.handlebars, and package.json for oldIE mobile-…
tilomitra Jan 9, 2014
33fd219
update rework-pure-grids, remove units from Gruntfile.js so we only g…
tilomitra Jan 9, 2014
746a511
Use grunt-stripmq from my branch
tilomitra Jan 9, 2014
a0b12a9
Serve built assets from build/ dir
ericf Jan 9, 2014
6f216b9
Move rework and rework-pure-grids to "dependencies" form devDependencies
ericf Jan 9, 2014
8630fff
Add `grunt` to npm post-install script to build the things
ericf Jan 9, 2014
b70ebf5
Merge branch 'mobile-first' of github.com:tilomitra/pure-site into mo…
ericf Jan 9, 2014
9ae2c75
Merge pull request #16 from ericf/mobile-first
tilomitra Jan 9, 2014
6f5ca1a
Add .npmignore to override excluding build/
ericf Jan 9, 2014
a5e5e81
update grunt-stripmq to 0.0.3
tilomitra Jan 10, 2014
7692135
add pure-img-responsive class to main.css
tilomitra Jan 10, 2014
a834769
Convert blog layout to be mobile-first
tilomitra Jan 10, 2014
cf0e558
Merge branch 'mobile-first' of github.com:tilomitra/pure-site into mo…
ericf Jan 10, 2014
1517c36
Fix custom `med` grid media query to be: 48em === 768px
ericf Jan 10, 2014
4725c63
Move all public/ assets into build/public/ and serve from there
ericf Jan 10, 2014
9ec42e9
Move rainbow.js to a Bower dependency
ericf Jan 10, 2014
b3cf3d1
Add support for generating multiple custom grid unit stylesheets
ericf Jan 10, 2014
a53b097
Revert "Add .npmignore to override excluding build/"
ericf Jan 10, 2014
c8c6ad2
Merge pull request #17 from ericf/mobile-first
tilomitra Jan 10, 2014
05fbbee
Add html5shiv to pages via CloudFlare CDN
ericf Jan 10, 2014
275575e
Add Grunt watch task
ericf Jan 10, 2014
952500b
Merge pull request #18 from ericf/mobile-first
tilomitra Jan 10, 2014
e3a0a54
update media query to be 48em
tilomitra Jan 13, 2014
cc7a790
update pricing layout to be mobile-first
tilomitra Jan 13, 2014
263a6f3
update side-menu layout to be mobile-first
tilomitra Jan 13, 2014
4a28a19
update marketing page to be mobile-first, update design
tilomitra Jan 13, 2014
b8c37cb
update gallery layout to be mobile-first, use new images
tilomitra Jan 13, 2014
a41f524
update email layout to be mobile-first
tilomitra Jan 13, 2014
eb0fa95
update Gruntfile with layout tasks
tilomitra Jan 13, 2014
7cb3584
remove `pure-` prefix from classes that are not part of Pure core
tilomitra Jan 13, 2014
f2c51ab
px -> em, add `.pure-img-responsive` class for now
tilomitra Jan 13, 2014
e75be88
write `id` attribute before `class` :)
tilomitra Jan 13, 2014
3213b2d
add "forms" to marketing meta
tilomitra Jan 13, 2014
6b3f352
update blog layout colors & image
tilomitra Jan 14, 2014
e567a0d
fix `.header h2` being too light
tilomitra Jan 14, 2014
fb34712
Tweak main layout and footer/legal styles
ericf Jan 14, 2014
c2e38eb
Update copyright year to 2014
ericf Jan 16, 2014
1592446
Improve Handlebars helpers: {{code}}, {{fileSize}}, and {{filePercent}}
ericf Jan 17, 2014
9958219
Update Grids breakpoints to: 35.5, 48, 58, and 75em
ericf Jan 17, 2014
7daf8b5
Completely refactor CSS to truly be mobile/content-first
ericf Jan 17, 2014
ab6d477
Update header heading styles
ericf Jan 17, 2014
6147ec0
Use `-webkit-overflow-scrolling: touch;` for smooth scrolling
ericf Jan 17, 2014
3f6bf22
Make Pure Paginator Buttons `box-sizing: content-box;`
ericf Jan 17, 2014
8d2a0f2
Add more spacing for labels on Grids unit sizes chart
ericf Jan 17, 2014
e0a3168
Merge pull request #19 from ericf/mobile-first
tilomitra Jan 17, 2014
c4036d2
bump version to 1.9.0
tilomitra Jan 21, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
bower_components/
node_modules/
build/
npm-debug.log
deploy.json
grasshopper.json
112 changes: 112 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
'use strict';

module.exports = function (grunt) {
grunt.initConfig({
clean: {
build: ['build/']
},

copy : {
pub: {
src : 'public/**',
dest : 'build/',
expand : true
},

bower: {
cwd : 'bower_components/',
expand: true,
dest : 'build/public/vendor/',
src : ['rainbow/js/**']
}
},

grid_units: {
main: {
dest : 'build/public/css/main-grid.css',
options: {
mediaQueries: {
sm : 'screen and (min-width: 35.5em)', // 568px
med: 'screen and (min-width: 48em)', // 768px
lrg: 'screen and (min-width: 58em)', // 928px
xl : 'screen and (min-width: 75em)' // 1200px
}
}
},

gallery: {
dest : 'build/public/css/layouts/gallery-grid.css',
options: {
units: 6,
mediaQueries: {
med : 'screen and (min-width: 30em)',
lrg : 'screen and (min-width: 48em)'
}
}
}
},

stripmq: {
all: {
files: {
'build/public/css/main-grid-old-ie.css':
['build/public/css/main-grid.css'],

'build/public/css/main-old-ie.css':
['build/public/css/main.css'],


// Layout Grids
'build/public/css/layouts/gallery-grid-old-ie.css':
['build/public/css/layouts/gallery-grid.css'],

//Layout CSS
'build/public/css/layouts/blog-old-ie.css':
['build/public/css/layouts/blog.css'],

'build/public/css/layouts/marketing-old-ie.css':
['build/public/css/layouts/marketing.css'],

'build/public/css/layouts/pricing-old-ie.css':
['build/public/css/layouts/pricing.css'],

'build/public/css/layouts/side-menu-old-ie.css':
['build/public/css/layouts/side-menu.css'],

'build/public/css/layouts/gallery-old-ie.css':
['build/public/css/layouts/gallery.css'],

'build/public/css/layouts/email-old-ie.css':
['build/public/css/layouts/email.css']
}
}
},

observe: {
bower: {
files: ['bower_components/**', '!bower_components/pure/**'],
tasks: ['copy:bower']
},

pub: {
files: 'public/**',
tasks: ['default']
}
}
});

// npm tasks.
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-stripmq');

// Local tasks.
grunt.loadTasks('lib/tasks/');

grunt.registerTask('default', ['clean', 'copy', 'grid_units', 'stripmq']);

// Makes the `watch` task run a build first.
grunt.renameTask('watch', 'observe');
grunt.registerTask('watch', ['default', 'observe']);
};
7 changes: 4 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ app.set('views', config.dirs.views);

app.locals({
site : 'Pure',
copyright_year: '2013',
copyright_year: '2014',

version : config.version,
yui_version: config.yui.version,
Expand All @@ -41,8 +41,9 @@ app.locals({

min: config.isProduction ? '-min' : '',

ga : config.isProduction && config.ga,
typekit: config.typekit
ga : config.isProduction && config.ga,
typekit : config.typekit,
html5shiv: config.html5shiv
});

app.expose(config.yui.config, 'YUI_config');
Expand Down
14 changes: 7 additions & 7 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name" : "pure-site",
"version": "1.8.0",
"private": true,

"dependencies": {
"pure": "latest"
}
"name": "pure-site",
"version": "1.8.0",
"private": true,
"dependencies": {
"pure": "latest",
"rainbow": "~1.1.9"
}
}
11 changes: 6 additions & 5 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ module.exports = Object.freeze({
port: env.PORT || 5000,

dirs: Object.freeze({
pub : path.resolve('public/'),
pub : path.resolve('build/public/'),
views : path.resolve('views/pages/'),
layouts : path.resolve('views/layouts/'),
partials: path.resolve('views/partials/')
}),

version: require('../package').version,

pure : require('./pure'),
yui : require('./yui'),
ga : 'UA-41480445-1',
typekit: 'gis6vng'
pure : require('./pure'),
yui : require('./yui'),
ga : 'UA-41480445-1',
typekit : 'gis6vng',
html5shiv: '3.7'
});
4 changes: 1 addition & 3 deletions config/pure.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
var fs = require('fs'),
path = require('path');

var bowerrc = path.join(process.cwd(), '.bowerrc'),
bower = JSON.parse(fs.readFileSync(bowerrc, 'utf8')),
bowerPureDir = path.join(process.cwd(), bower.directory, 'pure');
var bowerPureDir = path.resolve('bower_components', 'pure');

exports.version = require(path.join(bowerPureDir, 'bower.json')).version;
exports.modules = ['base', 'grids', 'forms', 'buttons', 'tables', 'menus'];
Expand Down
24 changes: 17 additions & 7 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,15 @@ function code(content, options) {
content = null;
}

var type, open, close;
var type, classes, open, close;

// Determine if this helper is being used as an inline or block helper. When
// `options.fn` is defined this helper was invoked as a block helper.
if (options.fn) {
type = content || 'html';
classes = options.hash.wrap ? 'code code-wrap' : 'code';
content = options.fn(this);
open = '<pre class="snippet" data-language="' + type + '"><code>';
open = '<pre class="' + classes + '" data-language="' + type + '"><code>';
close = '</code></pre>';
} else {
open = '<code>';
Expand Down Expand Up @@ -285,17 +286,26 @@ function setSubTitle(subTitle) {
this.subTitle = subTitle;
}

function fileSize(module, decimals) {
function fileSize(module, decimals, options) {
if (typeof decimals === 'object') {
options = decimals;
decimals = null;
}

typeof decimals === 'number' || (decimals = 1);
var filesize = (this.pure.filesizes[module] / 1024);

var pure = (options && options.hash.pure) || this.pure,
filesize = (pure.filesizes[module] / 1024);

return filesize.toFixed(decimals) + 'KB';
}

function filePercent(module) {
var filesizes = this.pure.filesizes,
function filePercent(module, options) {
var pure = (options && options.hash.pure) || this.pure,
filesizes = pure.filesizes,
total = 0;

total = this.pure.modules.reduce(function (size, module) {
total = pure.modules.reduce(function (size, module) {
return size + filesizes[module];
}, total);

Expand Down
19 changes: 19 additions & 0 deletions lib/tasks/grid-units.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

var rework = require('rework'),
pureGrids = require('rework-pure-grids');

module.exports = function (grunt) {
grunt.registerMultiTask('grid_units', 'Generates grid units.', function () {
var options = this.options({
indent: ' '
});

this.files.forEach(function (fileGroup) {
var css = rework('').use(pureGrids.units(options.units, options));

grunt.file.write(fileGroup.dest, css.toString(options));
grunt.log.writeln('File "' + fileGroup.dest + '" created.');
});
});
};
107 changes: 58 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,61 @@
{
"name": "pure-site",
"description": "The Pure CSS website.",
"homepage": "http://purecss.io/",
"version": "1.8.2",
"private": true,
"repository": "git://github.com/yui/pure-site.git",
"contributors": [
"Eric Ferraiuolo <eferraiuolo@gmail.com> (http://ericf.me/)",
"Tilo Mitra <tilomitra@gmail.com> (http://www.tilomitra.com/)"
],
"directories": {
"lib": "./lib",
"public": "./public",
"views": "./views"
"name": "pure-site",
"description": "The Pure CSS website.",
"homepage": "http://purecss.io/",
"version": "1.9.0",
"private": true,
"repository": "git://github.com/yui/pure-site.git",
"contributors": [
"Eric Ferraiuolo <eferraiuolo@gmail.com> (http://ericf.me/)",
"Tilo Mitra <tilomitra@gmail.com> (http://www.tilomitra.com/)"
],
"directories": {
"lib": "./lib",
"public": "./public",
"views": "./views"
},
"main": "server.js",
"engines": {
"node": ">=0.8.x",
"npm": ">=1.1.2"
},
"dependencies": {
"combohandler": "~0.2.0",
"express": "3.x",
"express-annotations": "~0.1.0",
"express-params": "~0.0.3",
"express-map": "~0.1.0",
"express-slash": "~0.2.0",
"express-state": "~1.0.1",
"express3-handlebars": "~0.5.0",
"handlebars": "~1.1.2",
"glob": "~3.2.6",
"async": "~0.2.9",
"archiver": "~0.4.10",
"bower": "~1.2.7",
"css-parse": "~1.6.0",
"es6-promise": "~0.1.0",
"rework": "~0.18.3",
"rework-pure-grids": "~0.3.2"
},
"scripts": {
"install": "bower install && grunt"
},
"yahoo": {
"bugzilla": {
"product": "yui utilities",
"component": "Pure"
},
"main": "server.js",
"engines": {
"node": ">=0.8.x",
"npm": ">=1.1.2"
},
"dependencies": {
"combohandler": "~0.2.0",
"express": "3.x",
"express-annotations": "~0.1.0",
"express-params": "~0.0.3",
"express-map": "~0.1.0",
"express-slash": "~0.2.0",
"express-state": "~1.0.1",
"express3-handlebars": "~0.5.0",
"handlebars": "~1.1.2",
"glob": "~3.2.6",
"async": "~0.2.9",
"archiver": "~0.4.10",
"bower": "~1.2.7",
"css-parse": "~1.6.0",
"es6-promise": "~0.1.0"
},
"scripts": {
"install": "bower install"
},
"yahoo": {
"bugzilla": {
"product": "yui utilities",
"component": "Pure"
},
"custodian": {
"email": "tilo@yahoo-inc.com",
"url": "http://purecss.io/"
}
"custodian": {
"email": "tilo@yahoo-inc.com",
"url": "http://purecss.io/"
}
}
},
"devDependencies": {
"grunt": "~0.4.2",
"grunt-stripmq": "0.0.3",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-watch": "~0.5.3"
}
}
3 changes: 3 additions & 0 deletions public/css/customize.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
table {
width: 100%;
}
Loading