diff --git a/docs/doc-fragments/grid.js b/docs/doc-fragments/grid.js index b7bfb64..1a3c661 100644 --- a/docs/doc-fragments/grid.js +++ b/docs/doc-fragments/grid.js @@ -42,7 +42,18 @@ module.exports = { <div class="col-sm"></div> <div class="col-sm"></div> </div> </div> - `], + `, + `
You can use the grid system to create a responsive media object in one of many ways. Below is a simple example of a two-column media object with an image and some text: +
<div class="row"> + <div class="col-sm-2"> + <img src="image.png" alt="Image description"/> + </div> + <div class="col-sm"> + <h2>Media object heading</h2> + <p>Media object content...</p> + </div> +</div>` +], notes: [ `mini.css uses a mobile-first approach in its grid system, so you do not have to rewrite the same layout for all three screen sizes. Leaving a column's size, offset or order unspecified for a screen size will use the style applied for the previous largest screen size recursively. This also applies to predefined layouts.`, `The specific breakpoints for small, medium and large screen sizes are as follows: @@ -51,9 +62,10 @@ module.exports = {
768px
wide and less than 1280px
wide1280px
wide or more--universal-padding
variable. This only affects the padding of the container.`
@@ -151,21 +163,83 @@ module.exports = {
</div>`]
}
],
- dos: [],
- donts: []
+ dos: [
+ {
+ description: `A column can contain a container or a row inside it, or even be a row at the same time. In the latter case, it will act as a column for its parent row and as a row for its children.`,
+ sample: `<div class="col-sm-3"> + <div class="container"></div> +</div> +<div class="col-sm-3"> + <div class="row"></div> +</div> +<div class="col-sm-3 row"> + <div class="col-sm-6"></div> <div class="col-sm-6"></div> +</div>` + }, + { + description: `You can mix fluid columns with fixed, if you like. Fluid columns will adapt to the size of the container left for them. You can also use columns whose total width exceeds
12
(100%). The remaining content will flow below the rest, allowing you to specify multiple blocks of content inside the same row if you need to.`,
+ sample: `<div class="row"> + <div class="col-sm-12"></div> + <div class="col-sm"></div> <div class="col-sm-4"></div> +</div>` + }, + { + description: `You can change the layout of your content for different displays, laying out your content vertically on smaller screens or horizontally on larger screens. If your columns exceed a total width of
12
(100%) on some displays, they will wrap accordingly.`,
+ sample: `<div class="row"> + <div class="col-sm-12 col-md-6"></div> + <div class="col-sm-12 col-md-6"></div> +</div>` + }, + { + description: `You do not need to specify a column's width or reapply offset and reordering modifiers if they are the same as the previous screen size.`, + sample: `
<div class="row"> + <div class="col-sm col-lg-3 col-md-last"></div> + <div class="col-sm-6 col-md-offset-2"></div> +</div>` + }, + { + description: `You can add multiple predefined layout classes for different screen sizes, allowing you to build responsive predefined layouts.`, + sample: `
<div class="row cols-sm-12 cols-md-6"> + <div></div> <div></div> +</div>` + }, + { + description: `To remove a previously applied offset from a column (i.e. one applied from the layout from a smaller screen size) or to make sure no offsets are active on a column, you can set its offset to
0
for a specific screen size. Similarly, to remove previously applied reordering modifiers from a column, you can set its order to normal
.`,
+ sample: `<div class="row"> + <div class="col-sm-8 col-sm-offset-1 col-md-offset-0"></div> + <div class="col-sm-last col-md-normal"></div> +</div>` + } + ], + donts: [ + { + description: `Avoid placing a column directly inside another column. Always use a row to wrap columns, instead.`, + sample: `
<div class="col-sm"> + <div class="col-sm"></div> +</div>` + }, + { + description: `Avoid mixing rows and columns with normal content that is not wrapped on the respective level of the grid layout.`, + sample: `
<div class="container"> + <div class="row"> + <div class="col-sm"></div> + <p>Do not do this.</p> + </div> + <p>Do not do this.</p> +</div>` + }, + { + description: `Never omit the class that specifies a column's width for the small screen size. You can omit all other classes and modifiers, except for this. This also applies to predefined layouts.`, + sample: `
<div class="row"> + <div class="col-md"></div> +</div> +<div class="row cols-md"></div>` + }, + { + description: `Avoid combining normal column width modifiers with predefined layouts, as the predefined layout will most likely override the width modifier of the column.`, + sample: `
<div class="row cols-sm-6"> + <div class="row cols-sm-4"></div> +</div>` + } + ] } - -/* - Modifiers: - { - title : '', - description: '', - example: '', - samples: [] - } - Dos/Donts: - { - description: '', - sample: '' - } -*/ diff --git a/docs/v3/docs.html b/docs/v3/docs.html index ee4e178..13bc897 100644 --- a/docs/v3/docs.html +++ b/docs/v3/docs.html @@ -173,7 +173,16 @@ <div class="col-sm"></div> <div class="col-sm"></div> </div> </div> - +
You can use the grid system to create a responsive media object in one of many ways. Below is a simple example of a two-column media object with an image and some text: +
<div class="row"> + <div class="col-sm-2"> + <img src="image.png" alt="Image description"/> + </div> + <div class="col-sm"> + <h2>Media object heading</h2> + <p>Media object content...</p> + </div> +</div>
Each column class is defined by specifying a screen size (small - sm
, medium - md
or large - lg
) and a column width (a value between 1
and 12
or you can omit it for a fluid column), separated by dashes (e.g. .col-sm-6
for a 6-wide column on a small screen). Using these you can apply different layouts for different screen sizes, by altering the width of columns, using multiple classes. Note that column widths are applied recursively, meaning that if you do not specify a width for a specific screen size the column will use the width applied for the previous largest screen size.
<div class="col-sm-3"> + <div class="container"></div> +</div> +<div class="col-sm-3"> + <div class="row"></div> +</div> +<div class="col-sm-3 row"> + <div class="col-sm-6"></div> <div class="col-sm-6"></div> +</div>
Do: A column can contain a container or a row inside it, or even be a row at the same time. In the latter case, it will act as a column for its parent row and as a row for its children.
<div class="row"> + <div class="col-sm-12"></div> + <div class="col-sm"></div> <div class="col-sm-4"></div> +</div>
Do: You can mix fluid columns with fixed, if you like. Fluid columns will adapt to the size of the container left for them. You can also use columns whose total width exceeds 12
(100%). The remaining content will flow below the rest, allowing you to specify multiple blocks of content inside the same row if you need to.
<div class="row"> + <div class="col-sm-12 col-md-6"></div> + <div class="col-sm-12 col-md-6"></div> +</div>
Do: You can change the layout of your content for different displays, laying out your content vertically on smaller screens or horizontally on larger screens. If your columns exceed a total width of 12
(100%) on some displays, they will wrap accordingly.
<div class="row"> + <div class="col-sm col-lg-3 col-md-last"></div> + <div class="col-sm-6 col-md-offset-2"></div> +</div>
Do: You do not need to specify a column's width or reapply offset and reordering modifiers if they are the same as the previous screen size.
<div class="row cols-sm-12 cols-md-6"> + <div></div> <div></div> +</div>
Do: You can add multiple predefined layout classes for different screen sizes, allowing you to build responsive predefined layouts.
<div class="row"> + <div class="col-sm-8 col-sm-offset-1 col-md-offset-0"></div> + <div class="col-sm-last col-md-normal"></div> +</div>
Do: To remove a previously applied offset from a column (i.e. one applied from the layout from a smaller screen size) or to make sure no offsets are active on a column, you can set its offset to 0
for a specific screen size. Similarly, to remove previously applied reordering modifiers from a column, you can set its order to normal
.
<div class="col-sm"> + <div class="col-sm"></div> +</div>
Don't: Avoid placing a column directly inside another column. Always use a row to wrap columns, instead.
<div class="container"> + <div class="row"> + <div class="col-sm"></div> + <p>Do not do this.</p> + </div> + <p>Do not do this.</p> +</div>
Don't: Avoid mixing rows and columns with normal content that is not wrapped on the respective level of the grid layout.
<div class="row"> + <div class="col-md"></div> +</div> +<div class="row cols-md"></div>
Don't: Never omit the class that specifies a column's width for the small screen size. You can omit all other classes and modifiers, except for this. This also applies to predefined layouts.
<div class="row cols-sm-6"> + <div class="row cols-sm-4"></div> +</div>
Don't: Avoid combining normal column width modifiers with predefined layouts, as the predefined layout will most likely override the width modifier of the column.
768px
wide768px
wide and less than 1280px
wide1280px
wide or more--universal-padding
variable. This only affects the padding of the container.