├── README.md ├── assets ├── icecream-ninja.png ├── style.css └── zied-hosni.jpg ├── css ├── icecream-grid.css └── icecream-grid.min.css ├── index.html └── less ├── elements.less └── icecream-grid.less /README.md: -------------------------------------------------------------------------------- 1 | The Grid 2 | ========= 3 | 4 | Sometimes you just need a grid system, everything else is excess, with the iceCream syntax this can be done easily and faster. 5 | 6 | Demo 7 | --- 8 | http://html5-ninja.com/icecream 9 | 10 | "i" for iceCream 11 | --- 12 | - i-container : a 980px container, for full width page just remove this class 13 | - i-g : "g" for grid , the grid class 14 | - i-* : iceCream grid is 12 columns layout starting from i-0 (for hiding) to i-12 (100% width) 15 | - i-mp-* : "mp" for mobile portrait a 4 columns layout starting from i-mp-0 (for hiding) to i-mp-4 (100% width) 16 | - i-ml-* : "ml" for mobile landscape a 4 columns layout starting from i-ml-0 (for hiding) to i-ml-4 (100% width) 17 | - i-tp-* : "tp" for tablet portrait a 4 columns layout starting from i-tp-0 (for hiding) to i-tp-4 (100% width) 18 | - i-tl-* : "tl" for tablet landscape a 4 columns layout starting from i-tl-0 (for hiding) to i-tl-4 (100% width) 19 | - i-img : wrap image to fit the parent column width 20 | 21 | 22 | Version 23 | ---- 24 | 25 | 0.1.0 26 | 27 | 28 | 29 | How to use 30 | -------------- 31 | 32 | ```sh 33 | 34 | ``` 35 | 36 | 37 | License 38 | ---- 39 | 40 | WTFPL - http://www.wtfpl.net/ 41 | 42 | *Free, Hell Yeah!* 43 | 44 | Author 45 | --- 46 | - Zied Hosni - zied.hosni.mail@gmail.com 47 | - http://html5-ninja.com - @html5_ninja 48 | 49 | -------------------------------------------------------------------------------- /assets/icecream-ninja.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/html5-ninja/icecream/b3daa9a6ab00317a1fc35f7d6382926733b4b0b2/assets/icecream-ninja.png -------------------------------------------------------------------------------- /assets/style.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Molle:400italic); 2 | @import url(http://fonts.googleapis.com/css?family=Open+Sans:300); 3 | body{font-family: 'Open Sans', sans-serif;color: #333; background: #fff;font-weight: 300;font-size: 1em} 4 | h1{font-family: 'Molle', cursive;font-size: 12vw; font-style: italic;font-weight: normal;margin: 0;text-align: center; color: #C3E4DF; 5 | text-shadow: 0px 4px 3px rgba(0,0,0,0.4), 6 | 0px 8px 13px rgba(0,0,0,0.1), 7 | 0px 18px 23px rgba(0,0,0,0.1); 8 | font-weight: 400; 9 | line-height: 1;} 10 | h2,h3,h4{margin: 0;font-weight: 300} 11 | h2{font-size: 2em} 12 | h3{margin-top: 0.5em;font-size: 1.5em} 13 | .wrapper{width:100%;margin: 0 auto;} 14 | .grid-test .i-g div{border:1px solid #ccc;min-height: 20px;font-size: 0.8em;text-align: center;line-height: 18px;text-overflow: ellipsis;white-space: nowrap;overflow: hidden} 15 | .well{text-align: center} 16 | .well p strong{font-size: 2em; font-weight: 300;color: #C3E4DF} 17 | .well p{padding: 0;margin: 0;} 18 | pre.prettyprint{margin-left: 0;border: none !important;padding-top: 10px !important} 19 | .code{background: #eee;overflow: hidden} 20 | li{padding: 0.4em 0} 21 | b{font-weight: bold} 22 | .grid-test.code{background: #eee} 23 | footer{border-top: 3px solid #ccc;clear: both; margin-top: 1em;display: block;float: left;width: 100%;padding-top: 1em} 24 | .author img{ 25 | border-radius: 100%; 26 | -webkit-border-radius: 100%; 27 | -moz-border-radius: 100%; 28 | border:3px solid #fff; 29 | box-shadow: 0 0 8px #ccc; 30 | -moz-box-shadow: 0 0 8px #ccc; 31 | -webkit-box-shadow: 0 0 8px #ccc; 32 | } 33 | .author{text-align: center} 34 | .author .i-img{text-align: center; } 35 | .download{font-size:1em; display: block; background:#C3E4DF; text-decoration: none; text-align: center;color:#333;height: 3em;line-height: 3em; } 36 | .download:hover{background: #3f6fa0;color:#fff} 37 | h2 small {font-size: 0.5em} 38 | .shareBox{padding-top: 2em;padding-bottom: 2em} 39 | .copy{border-top:1px solid #ccc} 40 | .html5ninja a{text-decoration: none;font-size: 0.8em} 41 | .html5ninja img{margin-right: 3px} -------------------------------------------------------------------------------- /assets/zied-hosni.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/html5-ninja/icecream/b3daa9a6ab00317a1fc35f7d6382926733b4b0b2/assets/zied-hosni.jpg -------------------------------------------------------------------------------- /css/icecream-grid.css: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------- 2 | IceCream 0.1.0 3 | Created on : 23 nov. 2013, 20:07:41 4 | Author : HTML5 Ninja - twitter @html5_ninja 5 | zied hosni - zied.hosni.mail@gmail.com 6 | More info : http://html5-ninja.com/icecream 7 | --------------------------------------------------------*/ 8 | /*-------------------------------------------------------- 9 | Grids 10 | --------------------------------------------------------*/ 11 | .i-g { 12 | clear: both; 13 | -ms-box-sizing: border-box; 14 | -moz-box-sizing: border-box; 15 | -webkit-box-sizing: border-box; 16 | box-sizing: border-box; 17 | } 18 | .i-g > div { 19 | margin: 0.5208333333333334% 1.0416666666666667%; 20 | float: left; 21 | -ms-box-sizing: border-box; 22 | -moz-box-sizing: border-box; 23 | -webkit-box-sizing: border-box; 24 | box-sizing: border-box; 25 | } 26 | .i-g .i-0 { 27 | display: none; 28 | } 29 | .i-g .i-1 { 30 | width: 6.25%; 31 | } 32 | .i-g .i-2 { 33 | width: 14.583333333333334%; 34 | } 35 | .i-g .i-3 { 36 | width: 22.916666666666668%; 37 | } 38 | .i-g .i-4 { 39 | width: 31.250000000000004%; 40 | } 41 | .i-g .i-5 { 42 | width: 39.583333333333336%; 43 | } 44 | .i-g .i-6 { 45 | width: 47.91666666666667%; 46 | } 47 | .i-g .i-7 { 48 | width: 56.25000000000001%; 49 | } 50 | .i-g .i-8 { 51 | width: 64.58333333333334%; 52 | } 53 | .i-g .i-9 { 54 | width: 72.91666666666667%; 55 | } 56 | .i-g .i-10 { 57 | width: 81.25%; 58 | } 59 | .i-g .i-11 { 60 | width: 89.58333333333334%; 61 | } 62 | .i-g .i-12 { 63 | width: 97.91666666666667%; 64 | } 65 | .i-container { 66 | width: 980px; 67 | margin: auto; 68 | } 69 | .i-img img { 70 | max-width: 100%; 71 | } 72 | @media only screen { 73 | /* Smartphones (portrait) ----------- */ 74 | /* Smartphones (landscape) ----------- */ 75 | /* tablet (portrait) ----------- */ 76 | /* tablet (landscape) ----------- */ 77 | } 78 | @media only screen and (max-width: 980px) { 79 | .i-container { 80 | width: 100%; 81 | } 82 | } 83 | @media only screen and (max-width: 320px) { 84 | .i-g .i-mp-0 { 85 | display: none; 86 | } 87 | .i-g .i-mp-1 { 88 | width: 22.916666666666668%; 89 | } 90 | .i-g .i-mp-2 { 91 | width: 47.91666666666667%; 92 | } 93 | .i-g .i-mp-3 { 94 | width: 72.91666666666667%; 95 | } 96 | .i-g .i-mp-4 { 97 | width: 97.91666666666667%; 98 | } 99 | } 100 | @media only screen and (min-width: 321px) and (max-width: 480px) { 101 | .i-g .i-ml-0 { 102 | display: none; 103 | } 104 | .i-g .i-ml-1 { 105 | width: 22.916666666666668%; 106 | } 107 | .i-g .i-ml-2 { 108 | width: 47.91666666666667%; 109 | } 110 | .i-g .i-ml-3 { 111 | width: 72.91666666666667%; 112 | } 113 | .i-g .i-ml-4 { 114 | width: 97.91666666666667%; 115 | } 116 | } 117 | @media only screen and (min-width: 481px) and (max-width: 768px) { 118 | .i-g .i-tp-0 { 119 | display: none; 120 | } 121 | .i-g .i-tp-1 { 122 | width: 22.916666666666668%; 123 | } 124 | .i-g .i-tp-2 { 125 | width: 47.91666666666667%; 126 | } 127 | .i-g .i-tp-3 { 128 | width: 72.91666666666667%; 129 | } 130 | .i-g .i-tp-4 { 131 | width: 97.91666666666667%; 132 | } 133 | } 134 | @media only screen and (min-width: 769px) and (max-width: 1024px) { 135 | .i-g .i-tl-0 { 136 | display: none; 137 | } 138 | .i-g .i-tl-1 { 139 | width: 22.916666666666668%; 140 | } 141 | .i-g .i-tl-2 { 142 | width: 47.91666666666667%; 143 | } 144 | .i-g .i-tl-3 { 145 | width: 72.91666666666667%; 146 | } 147 | .i-g .i-tl-4 { 148 | width: 97.91666666666667%; 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /css/icecream-grid.min.css: -------------------------------------------------------------------------------- 1 | .i-g{clear:both;-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.i-g>div{margin:.5208333333333334% 1.0416666666666667%;float:left;-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.i-g .i-0{display:none}.i-g .i-1{width:6.25%}.i-g .i-2{width:14.583333333333334%}.i-g .i-3{width:22.916666666666668%}.i-g .i-4{width:31.250000000000004%}.i-g .i-5{width:39.583333333333336%}.i-g .i-6{width:47.91666666666667%}.i-g .i-7{width:56.25000000000001%}.i-g .i-8{width:64.58333333333334%}.i-g .i-9{width:72.91666666666667%}.i-g .i-10{width:81.25%}.i-g .i-11{width:89.58333333333334%}.i-g .i-12{width:97.91666666666667%}.i-container{width:980px;margin:auto}.i-img img{max-width:100%}@media only screen and (max-width:980px){.i-container{width:100%}}@media only screen and (max-width:320px){.i-g .i-mp-0{display:none}.i-g .i-mp-1{width:22.916666666666668%}.i-g .i-mp-2{width:47.91666666666667%}.i-g .i-mp-3{width:72.91666666666667%}.i-g .i-mp-4{width:97.91666666666667%}}@media only screen and (min-width:321px) and (max-width:480px){.i-g .i-ml-0{display:none}.i-g .i-ml-1{width:22.916666666666668%}.i-g .i-ml-2{width:47.91666666666667%}.i-g .i-ml-3{width:72.91666666666667%}.i-g .i-ml-4{width:97.91666666666667%}}@media only screen and (min-width:481px) and (max-width:768px){.i-g .i-tp-0{display:none}.i-g .i-tp-1{width:22.916666666666668%}.i-g .i-tp-2{width:47.91666666666667%}.i-g .i-tp-3{width:72.91666666666667%}.i-g .i-tp-4{width:97.91666666666667%}}@media only screen and (min-width:769px) and (max-width:1024px){.i-g .i-tl-0{display:none}.i-g .i-tl-1{width:22.916666666666668%}.i-g .i-tl-2{width:47.91666666666667%}.i-g .i-tl-3{width:72.91666666666667%}.i-g .i-tl-4{width:97.91666666666667%}} -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | IceCream - Simple and light responsive grid system 5 | 6 | 7 | 8 | 9 | 10 | 11 | 25 | 26 | 27 |
28 |
29 |
30 |
31 |
32 |
33 | IceCream Ninja 34 |
35 |
36 |
37 |
38 |

IceCream

39 |

Simple and light responsive grid system

40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |

The Grid (uncompressed 2.9kb, minified 1.8kb)

50 |

Sometimes you just need a grid system, everything else is excess, with the iceCream syntax this can be done easily and faster.

51 |
52 |
53 |
54 |
55 |

And it's look like that

56 |
57 |
58 |
59 |
60 |
i-1
61 |
i-1
62 |
i-1
63 |
i-1
64 |
i-1
65 |
i-1
66 |
i-1
67 |
i-1
68 |
i-1
69 |
i-1
70 |
i-1
71 |
i-1
72 |
i-1
73 |
i-11
74 |
i-2
75 |
i-10
76 |
i-3
77 |
i-9
78 |
i-4
79 |
i-8
80 |
i-5
81 |
i-7
82 |
i-6
83 |
i-6
84 |
i-12
85 |
86 |
87 | 88 |
89 |
90 |

i for iceCream

91 |
    92 |
  • i-container : a 980px container, for full width page just remove this class
  • 93 |
  • i-g : "g" for grid , the grid class
  • 94 |
  • i-* : iceCream grid is 12 columns layout starting from i-0 (for hiding) to i-12 (100% width)
  • 95 |
  • i-mp-* : "mp" for mobile portrait a 4 columns layout starting from i-mp-0 (for hiding) to i-mp-4 (100% width)
  • 96 |
  • i-ml-* : "ml" for mobile landscape a 4 columns layout starting from i-ml-0 (for hiding) to i-ml-4 (100% width)
  • 97 |
  • i-tp-* : "tp" for tablet portrait a 4 columns layout starting from i-tp-0 (for hiding) to i-tp-4 (100% width)
  • 98 |
  • i-tl-* : "tl" for tablet landscape a 4 columns layout starting from i-tl-0 (for hiding) to i-tl-4 (100% width)
  • 99 |
  • i-img : wrap image to fit the parent column width
  • 100 |
101 |
102 |
103 | 104 |
105 |
106 |

Sample grid code

107 |
108 |
109 |   <div class="i-container">
110 |      <div class="i-g">
111 |          <div class="i-4">i-4</div>
112 |          <div class="i-8">i-8</div>
113 |      </div>
114 |   </div>
115 |                             
116 |
117 |
118 |
119 |
120 | 121 |
122 |
123 |
i-4
124 |
i-8
125 |
126 |
127 | 128 |
129 |
130 |
131 |
132 |
133 |

Different screen sizes and columns behaviour

134 |
135 |
136 |     <div class="i-g">
137 |         <div class="i-8 i-mp-1 i-tp-2 i-tl-1">i-8 i-mp-1 i-tp-2 i-tl-1</div>
138 |         <div class="i-4 i-mp-3 i-tp-2 i-tl-1">i-4 i-mp-3 i-tp-2 i-tl-1</div>           
139 |         <div class="i-12 i-mp-2 i-ml-2 i-tp-2  i-tl-1">i-12 i-mp-2 i-ml-2 i-tp-2  i-tl-1</div>           
140 |         <div class="i-12 i-mp-2 i-tp-2  i-tl-1">i-12 i-mp-2 i-tp-2  i-tl-1</div>           
141 |     </div>                               
142 |                             
143 |
144 |

Resize your browser to try it

145 |
146 |
147 | 148 |
149 |
150 |
i-8 i-mp-1 i-tp-2 i-tl-1
151 |
i-4 i-mp-3 i-tp-2 i-tl-1
152 |
i-12 i-mp-2 i-ml-2 i-tp-2 i-tl-1
153 |
i-12 i-mp-2 i-tp-2 i-tl-1
154 |
155 |
156 |
157 |
158 | 231 |
232 |
233 |
234 |
235 | 236 |
237 | 248 | 249 | 250 | -------------------------------------------------------------------------------- /less/elements.less: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------- 2 | // LESS Elements 0.9 3 | // --------------------------------------------------- 4 | // A set of useful LESS mixins 5 | // More info at: http://lesselements.com 6 | // --------------------------------------------------- 7 | 8 | .gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) { 9 | background: @color; 10 | background: -webkit-gradient(linear, 11 | left bottom, 12 | left top, 13 | color-stop(0, @start), 14 | color-stop(1, @stop)); 15 | background: -ms-linear-gradient(bottom, 16 | @start, 17 | @stop); 18 | background: -moz-linear-gradient(center bottom, 19 | @start 0%, 20 | @stop 100%); 21 | background: -o-linear-gradient(@stop, 22 | @start); 23 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@stop,@start)); 24 | } 25 | .bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) { 26 | background: @color; 27 | background: -webkit-gradient(linear, 28 | left bottom, 29 | left top, 30 | color-stop(0, rgb(@start,@start,@start)), 31 | color-stop(1, rgb(@stop,@stop,@stop))); 32 | background: -ms-linear-gradient(bottom, 33 | rgb(@start,@start,@start) 0%, 34 | rgb(@stop,@stop,@stop) 100%); 35 | background: -moz-linear-gradient(center bottom, 36 | rgb(@start,@start,@start) 0%, 37 | rgb(@stop,@stop,@stop) 100%); 38 | background: -o-linear-gradient(rgb(@stop,@stop,@stop), 39 | rgb(@start,@start,@start)); 40 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",rgb(@stop,@stop,@stop),rgb(@start,@start,@start))); 41 | } 42 | .bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE) { 43 | border-top: solid 1px @top-color; 44 | border-left: solid 1px @left-color; 45 | border-right: solid 1px @right-color; 46 | border-bottom: solid 1px @bottom-color; 47 | } 48 | .drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1) { 49 | -webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha); 50 | -moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha); 51 | box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha); 52 | } 53 | .rounded(@radius: 2px) { 54 | -webkit-border-radius: @radius; 55 | -moz-border-radius: @radius; 56 | border-radius: @radius; 57 | } 58 | .border-radius(@topright: 0, @bottomright: 0, @bottomleft: 0, @topleft: 0) { 59 | -webkit-border-top-right-radius: @topright; 60 | -webkit-border-bottom-right-radius: @bottomright; 61 | -webkit-border-bottom-left-radius: @bottomleft; 62 | -webkit-border-top-left-radius: @topleft; 63 | -moz-border-radius-topright: @topright; 64 | -moz-border-radius-bottomright: @bottomright; 65 | -moz-border-radius-bottomleft: @bottomleft; 66 | -moz-border-radius-topleft: @topleft; 67 | border-top-right-radius: @topright; 68 | border-bottom-right-radius: @bottomright; 69 | border-bottom-left-radius: @bottomleft; 70 | border-top-left-radius: @topleft; 71 | .background-clip(padding-box); 72 | } 73 | .opacity(@opacity: 0.5) { 74 | -moz-opacity: @opacity; 75 | -khtml-opacity: @opacity; 76 | -webkit-opacity: @opacity; 77 | opacity: @opacity; 78 | @opperc: @opacity * 100; 79 | -ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(opacity=@{opperc})"; 80 | filter: ~"alpha(opacity=@{opperc})"; 81 | } 82 | .transition-duration(@duration: 0.2s) { 83 | -moz-transition-duration: @duration; 84 | -webkit-transition-duration: @duration; 85 | -o-transition-duration: @duration; 86 | transition-duration: @duration; 87 | } 88 | .transform(...) { 89 | -webkit-transform: @arguments; 90 | -moz-transform: @arguments; 91 | -o-transform: @arguments; 92 | -ms-transform: @arguments; 93 | transform: @arguments; 94 | } 95 | .rotation(@deg:5deg){ 96 | .transform(rotate(@deg)); 97 | } 98 | .scale(@ratio:1.5){ 99 | .transform(scale(@ratio)); 100 | } 101 | .transition(@duration:0.2s, @ease:ease-out) { 102 | -webkit-transition: all @duration @ease; 103 | -moz-transition: all @duration @ease; 104 | -o-transition: all @duration @ease; 105 | transition: all @duration @ease; 106 | } 107 | .inner-shadow(@horizontal:0, @vertical:1px, @blur:2px, @alpha: 0.4) { 108 | -webkit-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha); 109 | -moz-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha); 110 | box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha); 111 | } 112 | .box-shadow(@arguments) { 113 | -webkit-box-shadow: @arguments; 114 | -moz-box-shadow: @arguments; 115 | box-shadow: @arguments; 116 | } 117 | .box-sizing(@sizing: border-box) { 118 | -ms-box-sizing: @sizing; 119 | -moz-box-sizing: @sizing; 120 | -webkit-box-sizing: @sizing; 121 | box-sizing: @sizing; 122 | } 123 | .user-select(@argument: none) { 124 | -webkit-user-select: @argument; 125 | -moz-user-select: @argument; 126 | -ms-user-select: @argument; 127 | user-select: @argument; 128 | } 129 | .columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px) { 130 | -moz-column-width: @colwidth; 131 | -moz-column-count: @colcount; 132 | -moz-column-gap: @colgap; 133 | -moz-column-rule-color: @columnRuleColor; 134 | -moz-column-rule-style: @columnRuleStyle; 135 | -moz-column-rule-width: @columnRuleWidth; 136 | -webkit-column-width: @colwidth; 137 | -webkit-column-count: @colcount; 138 | -webkit-column-gap: @colgap; 139 | -webkit-column-rule-color: @columnRuleColor; 140 | -webkit-column-rule-style: @columnRuleStyle; 141 | -webkit-column-rule-width: @columnRuleWidth; 142 | column-width: @colwidth; 143 | column-count: @colcount; 144 | column-gap: @colgap; 145 | column-rule-color: @columnRuleColor; 146 | column-rule-style: @columnRuleStyle; 147 | column-rule-width: @columnRuleWidth; 148 | } 149 | .translate(@x:0, @y:0) { 150 | .transform(translate(@x, @y)); 151 | } 152 | .background-clip(@argument: padding-box) { 153 | -moz-background-clip: @argument; 154 | -webkit-background-clip: @argument; 155 | background-clip: @argument; 156 | } -------------------------------------------------------------------------------- /less/icecream-grid.less: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------- 2 | IceCream 0.1.0 3 | Created on : 23 nov. 2013, 20:07:41 4 | Author : HTML5 Ninja - twitter @html5_ninja 5 | zied hosni - zied.hosni.mail@gmail.com 6 | More info : http://html5-ninja.com/icecream 7 | --------------------------------------------------------*/ 8 | @import 'elements'; 9 | /*-------------------------------------------------------- 10 | Grids 11 | --------------------------------------------------------*/ 12 | // unit mesure 13 | @unit : 100% / 48; 14 | @colMargin : 100% / 48 / 2; 15 | // grid columns width 16 | @width1 : @unit*3 ; 17 | @width2 : @unit*7; 18 | @width3 : @unit*11; 19 | @width4 : @unit*15; 20 | @width5 : @unit*19; 21 | @width6 : @unit*23; 22 | @width7 : @unit*27; 23 | @width8 : @unit*31; 24 | @width9 : @unit*35; 25 | @width10 : @unit*39; 26 | @width11 : @unit*43; 27 | @width12 : @unit*47; 28 | // grid columns mixins 29 | .gridColMargin(){margin : @colMargin/2 @colMargin;} 30 | .col(){.gridColMargin;float:left;.box-sizing();} 31 | // grid & cols 32 | .i-g{ 33 | clear:both; 34 | .box-sizing; 35 | > div{.col;} 36 | .i-0{display:none} 37 | .i-1{width:@width1;} 38 | .i-2{width:@width2;} 39 | .i-3{width:@width3;} 40 | .i-4{width:@width4;} 41 | .i-5{width:@width5;} 42 | .i-6{width:@width6;} 43 | .i-7{width:@width7;} 44 | .i-8{width:@width8;} 45 | .i-9{width:@width9;} 46 | .i-10{width:@width10;} 47 | .i-11{width:@width11;} 48 | .i-12{width:@width12;} 49 | } 50 | .i-container{width:980px;margin:auto} 51 | .i-img img{max-width:100%} 52 | 53 | @media only screen { 54 | 55 | @media (max-width : 980px){ 56 | .i-container{width:100%} 57 | } 58 | 59 | /* Smartphones (portrait) ----------- */ 60 | @media (max-width:320px) { 61 | .i-g{ 62 | .i-mp-0 {display:none} 63 | .i-mp-1 {width:@width3} 64 | .i-mp-2 {width:@width6} 65 | .i-mp-3 {width:@width9} 66 | .i-mp-4 {width:@width12} 67 | } 68 | } 69 | 70 | /* Smartphones (landscape) ----------- */ 71 | @media (min-width : 321px) and (max-width:480px) { 72 | .i-g{ 73 | .i-ml-0 {display:none} 74 | .i-ml-1 {width:@width3} 75 | .i-ml-2 {width:@width6} 76 | .i-ml-3 {width:@width9} 77 | .i-ml-4 {width:@width12} 78 | } 79 | } 80 | 81 | /* tablet (portrait) ----------- */ 82 | @media (min-width : 481px) and (max-width:768px) { 83 | .i-g{ 84 | .i-tp-0 {display:none} 85 | .i-tp-1 {width:@width3} 86 | .i-tp-2 {width:@width6} 87 | .i-tp-3 {width:@width9} 88 | .i-tp-4 {width:@width12} 89 | } 90 | } 91 | 92 | /* tablet (landscape) ----------- */ 93 | @media (min-width : 769px) and (max-width:1024px) { 94 | .i-g{ 95 | .i-tl-0 {display:none} 96 | .i-tl-1 {width:@width3} 97 | .i-tl-2 {width:@width6} 98 | .i-tl-3 {width:@width9} 99 | .i-tl-4 {width:@width12} 100 | } 101 | } 102 | } --------------------------------------------------------------------------------