From 508b0e71f0b594c29008d3d6af7f29620d33fba5 Mon Sep 17 00:00:00 2001 From: Jonathan Hornung Date: Wed, 25 Nov 2015 15:59:13 +0100 Subject: [PATCH] * chore: added grunt jobs * chore: updated .gitignore * added package.json * updated version --- .gitignore | 2 + Gruntfile.js | 46 ++++++++++++++ bower.json | 2 +- dist/bootstrap-block-grid.css | 110 ++++++++++++++++++++++++++++++++-- package.json | 31 ++++++++++ src/bootstrap-block-grid.css | 110 ++++++++++++++++++++++++++++++++-- 6 files changed, 290 insertions(+), 11 deletions(-) create mode 100644 Gruntfile.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore index e6e907d..6aefb7e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/.sass-cache +/node_modules /.idea .DS_Store .codekit-cache diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..e5e4774 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,46 @@ +module.exports = function(grunt) { + + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + sass: { + distMin: { + options: { // Target options + style: 'compressed', + sourcemap: 'none' + }, + files: { + 'dist/bootstrap-block-grid.min.css': 'src/bootstrap-block-grid.scss' + } + }, + dist: { + options: { // Target options + style: 'expanded', + sourcemap: 'none' + }, + files: { + 'src/bootstrap-block-grid.css': 'src/bootstrap-block-grid.scss', + 'dist/bootstrap-block-grid.css': 'src/bootstrap-block-grid.scss' + } + } + + }, + watch: { + minifySCSS: { + files: [ + 'src/*.scss' + ], + tasks: ['sass'], + options: { + spawn: true, + }, + } + }, + }); + + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-contrib-sass'); + + grunt.registerTask('default', ['watch']); + +}; + diff --git a/bower.json b/bower.json index 6fda9d3..b778aec 100644 --- a/bower.json +++ b/bower.json @@ -4,7 +4,7 @@ "authors": [ "Jonathan Hornung " ], - "version": "1.0.0", + "version": "1.0.1", "description": "block grid for bootstrap", "main": "dist/bootstrap-block-grid.min.css", "moduleType": [ diff --git a/dist/bootstrap-block-grid.css b/dist/bootstrap-block-grid.css index 44943c3..de6770a 100644 --- a/dist/bootstrap-block-grid.css +++ b/dist/bootstrap-block-grid.css @@ -4,18 +4,15 @@ margin: -15px; padding: 0; } - [class*="block-grid-"]:before { content: " "; display: table; } - [class*="block-grid-"]:after { content: " "; display: table; clear: both; } - [class*="block-grid-"] > * { display: inline; margin: 0; @@ -173,330 +170,433 @@ .block-grid-sm-1 > * { width: 100%; } + .block-grid-sm-1 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-1 > *:nth-of-type(1n+1) { clear: both; } + .block-grid-sm-2 > * { width: 50%; } + .block-grid-sm-2 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-2 > *:nth-of-type(2n+1) { clear: both; } + .block-grid-sm-3 > * { width: 33.333333333333336%; } + .block-grid-sm-3 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-3 > *:nth-of-type(3n+1) { clear: both; } + .block-grid-sm-4 > * { width: 25%; } + .block-grid-sm-4 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-4 > *:nth-of-type(4n+1) { clear: both; } + .block-grid-sm-5 > * { width: 20%; } + .block-grid-sm-5 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-5 > *:nth-of-type(5n+1) { clear: both; } + .block-grid-sm-6 > * { width: 16.666666666666668%; } + .block-grid-sm-6 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-6 > *:nth-of-type(6n+1) { clear: both; } + .block-grid-sm-7 > * { width: 14.285714285714286%; } + .block-grid-sm-7 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-7 > *:nth-of-type(7n+1) { clear: both; } + .block-grid-sm-8 > * { width: 12.5%; } + .block-grid-sm-8 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-8 > *:nth-of-type(8n+1) { clear: both; } + .block-grid-sm-9 > * { width: 11.11111111111111%; } + .block-grid-sm-9 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-9 > *:nth-of-type(9n+1) { clear: both; } + .block-grid-sm-10 > * { width: 10%; } + .block-grid-sm-10 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-10 > *:nth-of-type(10n+1) { clear: both; } + .block-grid-sm-11 > * { width: 9.090909090909092%; } + .block-grid-sm-11 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-11 > *:nth-of-type(11n+1) { clear: both; } + .block-grid-sm-12 > * { width: 8.333333333333334%; } + .block-grid-sm-12 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-12 > *:nth-of-type(12n+1) { clear: both; } } - @media (min-width: 992px) { .block-grid-md-1 > * { width: 100%; } + .block-grid-md-1 > *:nth-of-type(n) { clear: none; } + .block-grid-md-1 > *:nth-of-type(1n+1) { clear: both; } + .block-grid-md-2 > * { width: 50%; } + .block-grid-md-2 > *:nth-of-type(n) { clear: none; } + .block-grid-md-2 > *:nth-of-type(2n+1) { clear: both; } + .block-grid-md-3 > * { width: 33.333333333333336%; } + .block-grid-md-3 > *:nth-of-type(n) { clear: none; } + .block-grid-md-3 > *:nth-of-type(3n+1) { clear: both; } + .block-grid-md-4 > * { width: 25%; } + .block-grid-md-4 > *:nth-of-type(n) { clear: none; } + .block-grid-md-4 > *:nth-of-type(4n+1) { clear: both; } + .block-grid-md-5 > * { width: 20%; } + .block-grid-md-5 > *:nth-of-type(n) { clear: none; } + .block-grid-md-5 > *:nth-of-type(5n+1) { clear: both; } + .block-grid-md-6 > * { width: 16.666666666666668%; } + .block-grid-md-6 > *:nth-of-type(n) { clear: none; } + .block-grid-md-6 > *:nth-of-type(6n+1) { clear: both; } + .block-grid-md-7 > * { width: 14.285714285714286%; } + .block-grid-md-7 > *:nth-of-type(n) { clear: none; } + .block-grid-md-7 > *:nth-of-type(7n+1) { clear: both; } + .block-grid-md-8 > * { width: 12.5%; } + .block-grid-md-8 > *:nth-of-type(n) { clear: none; } + .block-grid-md-8 > *:nth-of-type(8n+1) { clear: both; } + .block-grid-md-9 > * { width: 11.11111111111111%; } + .block-grid-md-9 > *:nth-of-type(n) { clear: none; } + .block-grid-md-9 > *:nth-of-type(9n+1) { clear: both; } + .block-grid-md-10 > * { width: 10%; } + .block-grid-md-10 > *:nth-of-type(n) { clear: none; } + .block-grid-md-10 > *:nth-of-type(10n+1) { clear: both; } + .block-grid-md-11 > * { width: 9.090909090909092%; } + .block-grid-md-11 > *:nth-of-type(n) { clear: none; } + .block-grid-md-11 > *:nth-of-type(11n+1) { clear: both; } + .block-grid-md-12 > * { width: 8.333333333333334%; } + .block-grid-md-12 > *:nth-of-type(n) { clear: none; } + .block-grid-md-12 > *:nth-of-type(12n+1) { clear: both; } } - @media (min-width: 1200px) { .block-grid-lg-1 > * { width: 100%; } + .block-grid-lg-1 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-1 > *:nth-of-type(1n+1) { clear: both; } + .block-grid-lg-2 > * { width: 50%; } + .block-grid-lg-2 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-2 > *:nth-of-type(2n+1) { clear: both; } + .block-grid-lg-3 > * { width: 33.333333333333336%; } + .block-grid-lg-3 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-3 > *:nth-of-type(3n+1) { clear: both; } + .block-grid-lg-4 > * { width: 25%; } + .block-grid-lg-4 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-4 > *:nth-of-type(4n+1) { clear: both; } + .block-grid-lg-5 > * { width: 20%; } + .block-grid-lg-5 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-5 > *:nth-of-type(5n+1) { clear: both; } + .block-grid-lg-6 > * { width: 16.666666666666668%; } + .block-grid-lg-6 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-6 > *:nth-of-type(6n+1) { clear: both; } + .block-grid-lg-7 > * { width: 14.285714285714286%; } + .block-grid-lg-7 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-7 > *:nth-of-type(7n+1) { clear: both; } + .block-grid-lg-8 > * { width: 12.5%; } + .block-grid-lg-8 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-8 > *:nth-of-type(8n+1) { clear: both; } + .block-grid-lg-9 > * { width: 11.11111111111111%; } + .block-grid-lg-9 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-9 > *:nth-of-type(9n+1) { clear: both; } + .block-grid-lg-10 > * { width: 10%; } + .block-grid-lg-10 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-10 > *:nth-of-type(10n+1) { clear: both; } + .block-grid-lg-11 > * { width: 9.090909090909092%; } + .block-grid-lg-11 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-11 > *:nth-of-type(11n+1) { clear: both; } + .block-grid-lg-12 > * { width: 8.333333333333334%; } + .block-grid-lg-12 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-12 > *:nth-of-type(12n+1) { clear: both; } diff --git a/package.json b/package.json new file mode 100644 index 0000000..28cea8a --- /dev/null +++ b/package.json @@ -0,0 +1,31 @@ +{ + "name": "bootstrap-block-grid", + "version": "1.0.1", + "description": "block grid for bootstrap", + "main": "Gruntfile.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/JohnnyTheTank/bootstrap-block-grid.git" + }, + "keywords": [ + "bootstrap", + "blockgrid", + "gridblock", + "css", + "scss" + ], + "author": "Jonathan Hornung", + "license": "MIT", + "bugs": { + "url": "https://github.com/JohnnyTheTank/bootstrap-block-grid/issues" + }, + "homepage": "https://github.com/JohnnyTheTank/bootstrap-block-grid#readme", + "devDependencies": { + "grunt": "^0.4.5", + "grunt-contrib-sass": "^0.9.2", + "grunt-contrib-watch": "^0.6.1" + } +} diff --git a/src/bootstrap-block-grid.css b/src/bootstrap-block-grid.css index 44943c3..de6770a 100644 --- a/src/bootstrap-block-grid.css +++ b/src/bootstrap-block-grid.css @@ -4,18 +4,15 @@ margin: -15px; padding: 0; } - [class*="block-grid-"]:before { content: " "; display: table; } - [class*="block-grid-"]:after { content: " "; display: table; clear: both; } - [class*="block-grid-"] > * { display: inline; margin: 0; @@ -173,330 +170,433 @@ .block-grid-sm-1 > * { width: 100%; } + .block-grid-sm-1 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-1 > *:nth-of-type(1n+1) { clear: both; } + .block-grid-sm-2 > * { width: 50%; } + .block-grid-sm-2 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-2 > *:nth-of-type(2n+1) { clear: both; } + .block-grid-sm-3 > * { width: 33.333333333333336%; } + .block-grid-sm-3 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-3 > *:nth-of-type(3n+1) { clear: both; } + .block-grid-sm-4 > * { width: 25%; } + .block-grid-sm-4 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-4 > *:nth-of-type(4n+1) { clear: both; } + .block-grid-sm-5 > * { width: 20%; } + .block-grid-sm-5 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-5 > *:nth-of-type(5n+1) { clear: both; } + .block-grid-sm-6 > * { width: 16.666666666666668%; } + .block-grid-sm-6 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-6 > *:nth-of-type(6n+1) { clear: both; } + .block-grid-sm-7 > * { width: 14.285714285714286%; } + .block-grid-sm-7 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-7 > *:nth-of-type(7n+1) { clear: both; } + .block-grid-sm-8 > * { width: 12.5%; } + .block-grid-sm-8 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-8 > *:nth-of-type(8n+1) { clear: both; } + .block-grid-sm-9 > * { width: 11.11111111111111%; } + .block-grid-sm-9 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-9 > *:nth-of-type(9n+1) { clear: both; } + .block-grid-sm-10 > * { width: 10%; } + .block-grid-sm-10 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-10 > *:nth-of-type(10n+1) { clear: both; } + .block-grid-sm-11 > * { width: 9.090909090909092%; } + .block-grid-sm-11 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-11 > *:nth-of-type(11n+1) { clear: both; } + .block-grid-sm-12 > * { width: 8.333333333333334%; } + .block-grid-sm-12 > *:nth-of-type(n) { clear: none; } + .block-grid-sm-12 > *:nth-of-type(12n+1) { clear: both; } } - @media (min-width: 992px) { .block-grid-md-1 > * { width: 100%; } + .block-grid-md-1 > *:nth-of-type(n) { clear: none; } + .block-grid-md-1 > *:nth-of-type(1n+1) { clear: both; } + .block-grid-md-2 > * { width: 50%; } + .block-grid-md-2 > *:nth-of-type(n) { clear: none; } + .block-grid-md-2 > *:nth-of-type(2n+1) { clear: both; } + .block-grid-md-3 > * { width: 33.333333333333336%; } + .block-grid-md-3 > *:nth-of-type(n) { clear: none; } + .block-grid-md-3 > *:nth-of-type(3n+1) { clear: both; } + .block-grid-md-4 > * { width: 25%; } + .block-grid-md-4 > *:nth-of-type(n) { clear: none; } + .block-grid-md-4 > *:nth-of-type(4n+1) { clear: both; } + .block-grid-md-5 > * { width: 20%; } + .block-grid-md-5 > *:nth-of-type(n) { clear: none; } + .block-grid-md-5 > *:nth-of-type(5n+1) { clear: both; } + .block-grid-md-6 > * { width: 16.666666666666668%; } + .block-grid-md-6 > *:nth-of-type(n) { clear: none; } + .block-grid-md-6 > *:nth-of-type(6n+1) { clear: both; } + .block-grid-md-7 > * { width: 14.285714285714286%; } + .block-grid-md-7 > *:nth-of-type(n) { clear: none; } + .block-grid-md-7 > *:nth-of-type(7n+1) { clear: both; } + .block-grid-md-8 > * { width: 12.5%; } + .block-grid-md-8 > *:nth-of-type(n) { clear: none; } + .block-grid-md-8 > *:nth-of-type(8n+1) { clear: both; } + .block-grid-md-9 > * { width: 11.11111111111111%; } + .block-grid-md-9 > *:nth-of-type(n) { clear: none; } + .block-grid-md-9 > *:nth-of-type(9n+1) { clear: both; } + .block-grid-md-10 > * { width: 10%; } + .block-grid-md-10 > *:nth-of-type(n) { clear: none; } + .block-grid-md-10 > *:nth-of-type(10n+1) { clear: both; } + .block-grid-md-11 > * { width: 9.090909090909092%; } + .block-grid-md-11 > *:nth-of-type(n) { clear: none; } + .block-grid-md-11 > *:nth-of-type(11n+1) { clear: both; } + .block-grid-md-12 > * { width: 8.333333333333334%; } + .block-grid-md-12 > *:nth-of-type(n) { clear: none; } + .block-grid-md-12 > *:nth-of-type(12n+1) { clear: both; } } - @media (min-width: 1200px) { .block-grid-lg-1 > * { width: 100%; } + .block-grid-lg-1 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-1 > *:nth-of-type(1n+1) { clear: both; } + .block-grid-lg-2 > * { width: 50%; } + .block-grid-lg-2 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-2 > *:nth-of-type(2n+1) { clear: both; } + .block-grid-lg-3 > * { width: 33.333333333333336%; } + .block-grid-lg-3 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-3 > *:nth-of-type(3n+1) { clear: both; } + .block-grid-lg-4 > * { width: 25%; } + .block-grid-lg-4 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-4 > *:nth-of-type(4n+1) { clear: both; } + .block-grid-lg-5 > * { width: 20%; } + .block-grid-lg-5 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-5 > *:nth-of-type(5n+1) { clear: both; } + .block-grid-lg-6 > * { width: 16.666666666666668%; } + .block-grid-lg-6 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-6 > *:nth-of-type(6n+1) { clear: both; } + .block-grid-lg-7 > * { width: 14.285714285714286%; } + .block-grid-lg-7 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-7 > *:nth-of-type(7n+1) { clear: both; } + .block-grid-lg-8 > * { width: 12.5%; } + .block-grid-lg-8 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-8 > *:nth-of-type(8n+1) { clear: both; } + .block-grid-lg-9 > * { width: 11.11111111111111%; } + .block-grid-lg-9 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-9 > *:nth-of-type(9n+1) { clear: both; } + .block-grid-lg-10 > * { width: 10%; } + .block-grid-lg-10 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-10 > *:nth-of-type(10n+1) { clear: both; } + .block-grid-lg-11 > * { width: 9.090909090909092%; } + .block-grid-lg-11 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-11 > *:nth-of-type(11n+1) { clear: both; } + .block-grid-lg-12 > * { width: 8.333333333333334%; } + .block-grid-lg-12 > *:nth-of-type(n) { clear: none; } + .block-grid-lg-12 > *:nth-of-type(12n+1) { clear: both; }