diff --git a/License.md b/License.md new file mode 100644 index 0000000..1330562 --- /dev/null +++ b/License.md @@ -0,0 +1,9 @@ +

Copyright & License

+ +

Copyright (C) 2013 Dallas Bass - Released under the MIT License.

+ +

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

+ +

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

+ +

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/README.md b/README.md index 2ad8443..2a0bffe 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

Simple Grid

Intro

-

Simple Grid is a basic lightweight grid, not a CSS framework. There are no styles for buttons, tables, typography etc. etc. Simple Grid comes with two different types of grids. There is a grid for content, which looks like <div class="col-1-3"></div> and a grid for layouts, which looks like <div class="col-4-12"></div>. Simple Grid is also built for responsive layouts. With fluid columns, the grid will resize to adjust to the browser resolution. To accommodate for mobile and tablet devices, the grid will essentially stack all columns, one above another, when viewed on smaller screens.

+

Simple Grid is a basic lightweight grid, not a CSS framework. There are no styles for buttons, tables, typography etc. etc. Simple Grid comes with two different types of grids. There is a grid for content, which looks like <div class="c-1o3"></div> and a grid for layouts, which looks like <div class="c-4o12"></div>. Simple Grid is also built for responsive layouts. With fluid columns, the grid will resize to adjust to the browser resolution. To accommodate for mobile and tablet devices, the grid will essentially stack all columns, one above another, when viewed on smaller screens.

Instructions

Before starting with anything please make sure to include this snippet of code in your <head> tag so that the grids will be responsive on mobile devices: @@ -10,34 +10,34 @@

In terms of use, Simple Grid is basically just like every other grid. Starting out, you need to wrap your grid in a div class named grid. If you want a 20px padding around your grid, add the class grid-pad to the div wrapper. Next, all you have to do is decide what size you want your grid to be and add the appropiate classes. For example, if you want a grid with a left sidebar and main content area you would do:

 <div class="grid">
-  <div class="col-3-12">
+  <div class="c-3o12">
   </div>
-  <div class="col-9-12">
+  <div class="c-9o12">
   </div>
 </div>
 
If you have a page and would like four columns of content, you would do:
 <div class="grid">
-  <div class="col-1-4">
+  <div class="c-1o4">
   </div>
-  <div class="col-1-4">
+  <div class="c-1o4">
   </div>
-  <div class="col-1-4">
+  <div class="c-1o4">
   </div>
-  <div class="col-1-4">
+  <div class="c-1o4">
   </div>
 </div>
 
The first column of content in your grid will always be floated left. If you would like to float a column to the right, all you have to do is add the class push-right.

Push-Classes

-

To push a column to the right, you can use the push-X-X classes: +

To push a column to the right, you can use the push-XoX classes:

 <div class="grid">
-  <div class="col-1-3 push-1-3">
+  <div class="c-1o3 push-1o3">
   </div>
-  <div class="col-1-3 ">
+  <div class="c-1o3">
   </div>
 </div>
 
@@ -47,15 +47,15 @@ The first column of content in your grid will always be floated left. If you wou

If you don't want to stack all columns on mobile and tablet you can simply add a extra class to each column:

 <div class="grid">
-  <div class="col-1-3 mobile-col-1-2">
+  <div class="c-1o3 m-1o2">
   </div>
-  <div class="col-1-3 mobile-col-1-2">
+  <div class="c-1o3 m-1o2">
   </div>
-  <div class="col-1-3 hide-on-mobile">
+  <div class="c-1o3 hide-mob">
   </div>
 </div>
 
-To hide a element (column, div, a, etc.) on mobile and tablets you can add the class hide-on-mobile to it. +To hide a element (column, div, a, etc.) on mobile and tablets you can add the class hide-mob to it.

Preview

@@ -63,10 +63,4 @@ To hide a element (column, div, a, etc.) on mobile and tablets you can add the c

Copyright & License

-

Copyright (C) 2013 Dallas Bass - Released under the MIT License.

- -

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

- -

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

- -

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+Copyright (C) 2013 Dallas Bass - Released under the MIT License. diff --git a/index.html b/index.html index c968051..b002b31 100644 --- a/index.html +++ b/index.html @@ -1,12 +1,10 @@ - - Simple Grid - - + + -
-
+
-
+
-
+
- -
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
-
+
-
+
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
- diff --git a/simplegrid.css b/simplegrid.css index 66d0b3e..49bb64e 100644 --- a/simplegrid.css +++ b/simplegrid.css @@ -7,21 +7,21 @@ [class*='grid'], -[class*='col-'], -[class*='mobile-'], +[class*='c-'], +[class*='m-'], .grid:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; - box-sizing: border-box; + box-sizing: border-box; } -[class*='col-'] { +[class*='c-'] { float: left; - min-height: 1px; + min-height: 1px; padding-right: 20px; /* column-space */ } -[class*='col-'] [class*='col-']:last-child { +.grid-pad, [class*='c-'] [class*='c-']:last-child { padding-right: 0; } @@ -39,10 +39,13 @@ clear: both; } +.grid [class*=m-]:last-child { + margin-bottom: 0px; +} + .grid-pad { - padding-top: 20px; + padding-top: 15px; padding-left: 20px; /* grid-space to left */ - padding-right: 0; /* grid-space to right: (grid-space-left - column-space) e.g. 20px-20px=0 */ } .push-right { @@ -51,126 +54,126 @@ /* Content Columns */ -.col-1-1 { +.c-1o1 { width: 100%; } -.col-2-3, .col-8-12 { +.c-2o3, .c-8o12 { width: 66.66%; } -.col-1-2, .col-6-12 { +.c-1o2, .c-6o12 { width: 50%; } -.col-1-3, .col-4-12 { +.c-1o3, .c-4o12 { width: 33.33%; } -.col-1-4, .col-3-12 { +.c-1o4, .c-3o12 { width: 25%; } -.col-1-5 { +.c-1o5 { width: 20%; } -.col-1-6, .col-2-12 { +.c-1o6, .c-2o12 { width: 16.667%; } -.col-1-7 { +.c-1o7 { width: 14.28%; } -.col-1-8 { +.c-1o8 { width: 12.5%; } -.col-1-9 { +.c-1o9 { width: 11.1%; } -.col-1-10 { +.c-1o10 { width: 10%; } -.col-1-11 { +.c-1o11 { width: 9.09%; } -.col-1-12 { +.c-1o12 { width: 8.33% } /* Layout Columns */ -.col-11-12 { +.c-11o12 { width: 91.66% } -.col-10-12 { +.c-10o12 { width: 83.333%; } -.col-9-12 { +.c-9o12 { width: 75%; } -.col-5-12 { +.c-5o12 { width: 41.66%; } -.col-7-12 { +.c-7o12 { width: 58.33% } /* Pushing blocks */ -.push-2-3, .push-8-12 { +.push-2o3, .push-8o12 { margin-left: 66.66%; } -.push-1-2, .push-6-12 { +.push-1o2, .push-6o12 { margin-left: 50%; } -.push-1-3, .push-4-12 { +.push-1o3, .push-4o12 { margin-left: 33.33%; } -.push-1-4, .push-3-12 { +.push-1o4, .push-3o12 { margin-left: 25%; } -.push-1-5 { +.push-1o5 { margin-left: 20%; } -.push-1-6, .push-2-12 { +.push-1o6, .push-2o12 { margin-left: 16.667%; } -.push-1-7 { +.push-1o7 { margin-left: 14.28%; } -.push-1-8 { +.push-1o8 { margin-left: 12.5%; } -.push-1-9 { +.push-1o9 { margin-left: 11.1%; } -.push-1-10 { +.push-1o10 { margin-left: 10%; } -.push-1-11 { +.push-1o11 { margin-left: 9.09%; } -.push-1-12 { +.push-1o12 { margin-left: 8.33% } @@ -180,11 +183,15 @@ min-width: 0; margin-left: 0; margin-right: 0; - padding-left: 20px; /* grid-space to left */ - padding-right: 10px; /* grid-space to right: (grid-space-left - column-space) e.g. 20px-10px=10px */ + padding-left: 15px; /* grid-space to left */ + padding-right: 15px; } - [class*='col-'] { + .grid-pad:last-child { + padding-top: 0px; + } + + [class*='c-'] { width: auto; float: none; margin: 10px 0; @@ -192,13 +199,13 @@ padding-right: 10px; /* column-space */ } - [class*='col-'] [class*='col-'] { + [class*='c-'] [class*='c-'] { padding-right: 0; } /* Mobile Layout */ - [class*='mobile-col-'] { + [class*='m-'] { float: left; margin: 0 0 10px; padding-left: 0; @@ -206,83 +213,83 @@ padding-bottom: 0; } - .mobile-col-1-1 { + .m-1o1 { width: 100%; } - .mobile-col-2-3, .mobile-col-8-12 { + .m-2o3, .m-8o12 { width: 66.66%; } - .mobile-col-1-2, .mobile-col-6-12 { + .m-1o2, .m-6o12 { width: 50%; } - .mobile-col-1-3, .mobile-col-4-12 { + .m-1o3, .m-4o12 { width: 33.33%; } - .mobile-col-1-4, .mobile-col-3-12 { + .m-1o4, .m-3o12 { width: 25%; } - .mobile-col-1-5 { + .m-1o5 { width: 20%; } - .mobile-col-1-6, .mobile-col-2-12 { + .m-1o6, .m-2o12 { width: 16.667%; } - .mobile-col-1-7 { + .m-1o7 { width: 14.28%; } - .mobile-col-1-8 { + .m-1o8 { width: 12.5%; } - .mobile-col-1-9 { + .m-1o9 { width: 11.1%; } - .mobile-col-1-10 { + .m-1o10 { width: 10%; } - .mobile-col-1-11 { + .m-1o11 { width: 9.09%; } - .mobile-col-1-12 { + .m-1o12 { width: 8.33% } /* Layout Columns */ - .mobile-col-11-12 { + .m-11o12 { width: 91.66% } - .mobile-col-10-12 { + .m-10o12 { width: 83.333%; } - .mobile-col-9-12 { + .m-9o12 { width: 75%; } - .mobile-col-5-12 { + .m-5o12 { width: 41.66%; } - .mobile-col-7-12 { + .m-7o12 { width: 58.33% } - .hide-on-mobile { + .hide-mob { display: none !important; + visibility: hidden; width: 0; height: 0; } } - diff --git a/simplegrid.min.css b/simplegrid.min.css new file mode 100644 index 0000000..43fe47e --- /dev/null +++ b/simplegrid.min.css @@ -0,0 +1 @@ +[class*='grid'],[class*='c-'],[class*='m-'],.grid:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}[class*='c-']{float:left;min-height:1px;padding-right:20px}.grid-pad,[class*='c-'][class*='c-']:last-child{padding-right:0}.grid{width:100%;max-width:1140px;min-width:748px;margin:0 auto;overflow:hidden}.grid:after{content:"";display:table;clear:both}.grid[class*=m-]:last-child{margin-bottom:0}.grid-pad{padding-top:15px;padding-left:20px}.push-right{float:right}.c-1o1{width:100%}.c-2o3,.c-8o12{width:66.66%}.c-1o2,.c-6o12{width:50%}.c-1o3,.c-4o12{width:33.33%}.c-1o4,.c-3o12{width:25%}.c-1o5{width:20%}.c-1o6,.c-2o12{width:16.667%}.c-1o7{width:14.28%}.c-1o8{width:12.5%}.c-1o9{width:11.1%}.c-1o10{width:10%}.c-1o11{width:9.09%}.c-1o12{width:8.33%}.c-11o12{width:91.66%}.c-10o12{width:83.333%}.c-9o12{width:75%}.c-5o12{width:41.66%}.c-7o12{width:58.33%}.push-2o3,.push-8o12{margin-left:66.66%}.push-1o2,.push-6o12{margin-left:50%}.push-1o3,.push-4o12{margin-left:33.33%}.push-1o4,.push-3o12{margin-left:25%}.push-1o5{margin-left:20%}.push-1o6,.push-2o12{margin-left:16.667%}.push-1o7{margin-left:14.28%}.push-1o8{margin-left:12.5%}.push-1o9{margin-left:11.1%}.push-1o10{margin-left:10%}.push-1o11{margin-left:9.09%}.push-1o12{margin-left:8.33%}@media handheld,only screen and (max-width:767px){.grid{width:100%;min-width:0;margin-left:0;margin-right:0;padding-left:15px;padding-right:15px}.grid-pad:last-child{padding-top:0}[class*='c-']{width:auto;float:none;margin:10px 0;padding-left:0;padding-right:10px}[class*='c-'][class*='c-']{padding-right:0}[class*='m-']{float:left;margin:0 0 10px;padding-left:0;padding-right:10px;padding-bottom:0}.m-1o1{width:100%}.m-2o3,.m-8o12{width:66.66%}.m-1o2,.m-6o12{width:50%}.m-1o3,.m-4o12{width:33.33%}.m-1o4,.m-3o12{width:25%}.m-1o5{width:20%}.m-1o6,.m-2o12{width:16.667%}.m-1o7{width:14.28%}.m-1o8{width:12.5%}.m-1o9{width:11.1%}.m-1o10{width:10%}.m-1o11{width:9.09%}.m-1o12{width:8.33%}.m-11o12{width:91.66%}.m-10o12{width:83.333%}.m-9o12{width:75%}.m-5o12{width:41.66%}.m-7o12{width:58.33%}.hide-mob{display:none !important;visibility:hidden;width:0;height:0}}