diff --git a/docs/build-docs.js b/docs/build-docs.js index 28e2062..8d6e4d2 100644 --- a/docs/build-docs.js +++ b/docs/build-docs.js @@ -54,6 +54,9 @@ function buildFragment(fragment){
Do: ${d.description}
Don't: ${d.description}
The grid system of mini.css utilizes the Flexbox layout to provide you with a simple, modern, responsive layout system for your web apps. Like most modern CSS frameworks' grid systems, it is composed of three main components - containers, rows and columns:
+.container
) is the outermost layer of the grid system and serves as a fluid wrapper, which can be used as the basis for your layout..row
), which will in turn house the columns.col-*-*
) are placed inside rows and they can be customized to display differently on different screen sizes, make use of fluid layouts, use offsets or change ordering.<div class="container"> + <div class="row"> + <div class="col-sm-1"></div> <div class="col-sm-11"></div> + </div> + <div class="row"> + <div class="col-sm-2"></div> <div class="col-sm-10"></div> + </div> + <div class="row"> + <div class="col-sm-3"></div> <div class="col-sm-9"></div> + </div> + <div class="row"> + <div class="col-sm-4"></div> <div class="col-sm-8"></div> + </div> + <div class="row"> + <div class="col-sm-5"></div> <div class="col-sm-7"></div> + </div> + <div class="row"> + <div class="col-sm-6"></div> <div class="col-sm-6"></div> + </div> + <div class="row"> + <div class="col-sm-12"></div> + <div class="row"> + <div class="col-sm"></div> <div class="col-sm"></div> + </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: +
768px
wide768px
wide and less than 1280px
wide1280px
wide or more--universal-padding
variable. This only affects the padding of the container.`
+],
+ modifiers: [
+ {
+ title: `Screen sizes and width`,
+ description: `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="container"> + <div class="row"> + <div class="col-sm-12 col-md-3 col-lg-2"></div> + <div class="col-sm-12 col-md-5 col-lg-7"></div> + <div class="col-sm-12 col-md-4 col-lg-3"></div> + </div> + <div class="row"> + <div class="col-sm col-lg-10"></div> + <div class="col-sm-4 col-md"></div> + </div> +</div>`] + }, + { + title: `Predefined layouts`, + description: `
Rows can be modified to apply predefined layouts to the columns inside them, effectively reducing the amount of work required for simple layouts. To create a predefined layout, you can add a class to a row (.cols-*-*
), specifying a screen size and width for the columns inside it (or omitting the width for fluid columns), similarly to the way columns are defined (e.g. .row.cols-sm-6
will cause all elements inside the row to be 6-wide on a small screen). Columns inside a predefined layout do not require any further classes to display and, much like normal column layouts, their widths are applied recursively.
<div class="row cols-sm-6"> + <div> + <p>This paragraph is inside a 6-wide column.</p> + </div> + <div> + <p>This paragraph is inside a 6-wide column.</p> + </div> +</div>`] + }, + { + title: `Column offsets`, + description: `
Columns can be moved to the right, by applying offset classes (.col-*-offset-*
), defining a screen size and an offset (a value between 0
and 11
, e.g. .col-sm-offset-3
will move a column 25% to the right on a small screen). Like all other column modifiers, offsets are applied recursively.
<div class="row"> + <div class="col-sm-8 col-sm-offset-2 col-md-offset-1 col-lg-offset-0"></div></div> +<div class="row"> + <div class="col-sm col-sm-offset-3 col-md-offset-4 col-lg-offset-0"></div> +</div> +<div class="row"> + <div class="col-sm-4 col-md-offset-5"></div> +</div>`] + }, + { + title: `Column reordering`, + description: `
Columns can be reordered on different screen sizes, by applying a reordering class (.col-*-*
), defining a screen size and the order (first, normal or last, e.g. .col-sm-last
will move a column to the end of its row on a small screen). Like all other column modifiers, reordering is applied recursively.
<div class="row"> + <div class="col-sm col-md-last col-lg-normal"></div> + <div class="col-sm col-sm-first col-md-last"></div> + <div class="col-sm col-md-first col-lg-normal"></div> +</div>`] + } + ], + dos: [], + donts: [] +} + +/* + Modifiers: + { + title : '', + description: '', + example: '', + samples: [] + } + Dos/Donts: + { + description: '', + sample: '' + } +*/ diff --git a/docs/v3/DEVLOG.md b/docs/v3/DEVLOG.md index 6d154bd..79de940 100644 --- a/docs/v3/DEVLOG.md +++ b/docs/v3/DEVLOG.md @@ -163,3 +163,11 @@ - Documented lists. - Documented images. - Added `margin` to `figcaption` elements to reset the browser defaults. + +## 20171116 + +- Updated `layout` to make sure everything is bug-free. The `grid` in particular is not very friendly lately. +- Fixed a couple of bugs in `input_control` as well. +- Improved the build script to actually render the `modifiers` section, it should be complete now, I think. +- Documented `grid`. The whole old module has been merged into one long card with all the information readily available. Hopefully it's less complicated now. +- Changed the color of `main` in the documentation to help the cards pop out a little bit more. diff --git a/docs/v3/docs.html b/docs/v3/docs.html index 6fa06f5..ee4e178 100644 --- a/docs/v3/docs.html +++ b/docs/v3/docs.html @@ -43,6 +43,7 @@ +
mini.css utilizes the ruleset of Normalize.css v7.0.0 to reliably deal with inconsistencies between browsers, ensuring that your web apps will look beatiful no matter on what browser or device you're at. On top of these rules, we have applied some tasteful rules, such as using native font stack to figure out the best font for each device, slightly altering the background and foreground colors, as well as setting the size of the text to 16px
and its line height to 1.5
.
/* Do not do this (use Sass instead) */ html { font-size: 14px; @@ -78,6 +80,7 @@
--fore-color
variable. This will affect the color of the headings' main text.--secondary-fore-color
variable. This will affect the color of subheadings.--universal-margin
variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.--heading-ratio
variable. Bear in mind that the value of this variable must be unitless to work properly.alt
attribute to image elements on your web apps.<figcaption>
elements by changing the value of the --secondary-fore-color
variable.--universal-margin
variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.--fore-color
variable.--back-color
variable.--universal-margin
variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.--universal-padding
variable.cite
attribute of <blockquote>
elements is not mandatory and can be omitted. The element's sizing will be automatically adjusted according to the presence of the cite
attribute.--fore-color
variable. This will affect the text color of <code>
and <pre>
elements and background color of <kbd>
elements.--back-color
variable. This will affect the background color of <blockquote>
elements and text color of <kbd>
.<code>
and <pre>
elements by changing the value of the --secondary-back-color
variable.<blockquote>
elements by changing the value of the --secondary-fore-color
variable.<pre>
and <blockquote>
elements by changing the value of the --secondary-border-color
variable.<pre>
elements by changing the value of the --pre-color
variable.<blockquote>
elements by changing the value of the --blockquote-color
variable.--universal-margin
variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.--universal-padding
variable.--universal-border-radius
variable.The grid system of mini.css utilizes the Flexbox layout to provide you with a simple, modern, responsive layout system for your web apps. Like most modern CSS frameworks' grid systems, it is composed of three main components - containers, rows and columns:
+.container
) is the outermost layer of the grid system and serves as a fluid wrapper, which can be used as the basis for your layout..row
), which will in turn house the columns.col-*-*
) are placed inside rows and they can be customized to display differently on different screen sizes, make use of fluid layouts, use offsets or change ordering.<div class="container"> + <div class="row"> + <div class="col-sm-1"></div> <div class="col-sm-11"></div> + </div> + <div class="row"> + <div class="col-sm-2"></div> <div class="col-sm-10"></div> + </div> + <div class="row"> + <div class="col-sm-3"></div> <div class="col-sm-9"></div> + </div> + <div class="row"> + <div class="col-sm-4"></div> <div class="col-sm-8"></div> + </div> + <div class="row"> + <div class="col-sm-5"></div> <div class="col-sm-7"></div> + </div> + <div class="row"> + <div class="col-sm-6"></div> <div class="col-sm-6"></div> + </div> + <div class="row"> + <div class="col-sm-12"></div> + <div class="row"> + <div class="col-sm"></div> <div class="col-sm"></div> + </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="container"> + <div class="row"> + <div class="col-sm-12 col-md-3 col-lg-2"></div> + <div class="col-sm-12 col-md-5 col-lg-7"></div> + <div class="col-sm-12 col-md-4 col-lg-3"></div> + </div> + <div class="row"> + <div class="col-sm col-lg-10"></div> + <div class="col-sm-4 col-md"></div> + </div> +</div>
Rows can be modified to apply predefined layouts to the columns inside them, effectively reducing the amount of work required for simple layouts. To create a predefined layout, you can add a class to a row (.cols-*-*
), specifying a screen size and width for the columns inside it (or omitting the width for fluid columns), similarly to the way columns are defined (e.g. .row.cols-sm-6
will cause all elements inside the row to be 6-wide on a small screen). Columns inside a predefined layout do not require any further classes to display and, much like normal column layouts, their widths are applied recursively.
<div class="row cols-sm-6"> + <div> + <p>This paragraph is inside a 6-wide column.</p> + </div> + <div> + <p>This paragraph is inside a 6-wide column.</p> + </div> +</div>
Columns can be moved to the right, by applying offset classes (.col-*-offset-*
), defining a screen size and an offset (a value between 0
and 11
, e.g. .col-sm-offset-3
will move a column 25% to the right on a small screen). Like all other column modifiers, offsets are applied recursively.
<div class="row"> + <div class="col-sm-8 col-sm-offset-2 col-md-offset-1 col-lg-offset-0"></div></div> +<div class="row"> + <div class="col-sm col-sm-offset-3 col-md-offset-4 col-lg-offset-0"></div> +</div> +<div class="row"> + <div class="col-sm-4 col-md-offset-5"></div> +</div>
Columns can be reordered on different screen sizes, by applying a reordering class (.col-*-*
), defining a screen size and the order (first, normal or last, e.g. .col-sm-last
will move a column to the end of its row on a small screen). Like all other column modifiers, reordering is applied recursively.
<div class="row"> + <div class="col-sm col-md-last col-lg-normal"></div> + <div class="col-sm col-sm-first col-md-last"></div> + <div class="col-sm col-md-first col-lg-normal"></div> +</div>
768px
wide768px
wide and less than 1280px
wide1280px
wide or more--universal-padding
variable. This only affects the padding of the container.