diff --git a/docs/build-docs.js b/docs/build-docs.js index 2ed6dc0..26fd33a 100644 --- a/docs/build-docs.js +++ b/docs/build-docs.js @@ -1,92 +1,20 @@ +/* +
+*/ var fs = require('fs'); -var version = require('./vinf'); // Gets version info. -var frameworkUrl = `"https://cdnjs.cloudflare.com/ajax/libs/mini.css/${version.version.slice(1)}/mini-default.css"`; -// INDEX -var indexHtml = ` - - - - -minimal, responsive, style-agnostic
CSS framework
${version.version}
- Get started -Want to build websites that look beautiful on any and all devices, but also load fast on mobile connections? Then mini.css is the right tool for you! Its tiny size (under 10KB gzipped), along with its responsive grid and modern components ensures that all your users are satisfied and can access your website anytime, anywhere. Bridging the gap between fully-featured frameworks (e.g. Bootstrap and Semantic UI) and micro frameworks (e.g. Milligram and Pure.CSS), mini.css packs a lot of features in a small package, while it relies solely on CSS, meaning you do not have to worry about any conflicts with other Javascript libraries you might be using.
-Creating a CSS framework that caters to everyone's needs is no easy task, but mini.css manages to rise to the occasion by providing extensive and coherent documentation in combination with templates, examples and semantic HTML5 markup. Modern UX patterns and accessibility guidelines are well-documented and can be used out of the box, using one of the unique flavors that the framework provides. If you still want more, you can create your own custom flavor or tweak an existing one just by opening its CSS file and changing a few custom properties. It's that simple!
-Head over to the documentation to learn how to get started using mini.css, as well as what flavors and components are availble and how to use them to create the website or web app you've always wanted. If you like the framework and want to support it, remember to to star it on Github. It means a lot to us and it only takes a couple of seconds!
- - mini.css on Github -Do: ${d.description}
Don't: ${d.description}
You can get started using mini.css in one of many ways. It is published on npm and yarn, so you can easily download it, using your preferred package manager:
-npm install mini.css
yarn add mini.css
Alternatively, you can use either rawgit or cdnjs to import mini.css into your HTML page's <head>
tag:
<link rel="stylesheet" href="https://cdn.rawgit.com/Chalarangelo/mini.css/v3.0.0-alpha.3/dist/mini-default.min.css">-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mini.css/v3.0.0-alpha.3/mini-default.min.css">-
After adding mini.css to your project, remember to also add the following line inside your HTML page's <head>
tag to utilize the viewport meta tag:
<meta name="viewport" content="width=device-width, initial-scale=1">-
mini.css is crafted with long-term support in mind, so expect it to be compatible with all modern browsers, as well as their future versions. However, most legacy and proxy browsers, such as Internet Explorer, Opera Mini, IE Mobile and UC Browser are not officially supported, meaning certain features may not be displayed properly or behave exactly as expected.
mini.css utilizes the ruleset of Normalize.css v7.0.0 to reliably deal with inconsistencies between browsers, while applying some tasteful defaults on top, such as using native font stack to figure out the best font for each device, setting the background and foreground colors, as well as the size of the text to 16px
and its line height to 1.5
.
All of the most common HTML5 elements, such as paragraphs, links, bold, small and slanted text, have been styled by default using clean, modern typography to make your pages look cool and stand out from the rest of the internet.
This is a paragraph with some sample text. Did you know that the latest version of mini.css is codenamed Gluon? Well, now you do!
Remember that mini.css is totally free, no fine print involved!
<p>This is a paragraph. with some <strong>bold text</strong> and some <em>italics text</em>.</p> -<a href="#">This is a link.</a> -<small>This is some small text.</small> -<sub>Subscript</sub> -<sup>Superscript</sup> -<hr/>
/* Do not do this (use Sass instead) */ -html { - font-size: 14px; -}
Don't: Avoid altering the base font size of 16px
directly in your CSS code, as it can cause problems with the display of certain elements.
--fore-color
variable.--back-color
variable.--border-color
variable. This affects the color of <hr>
elements.--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.--a-link-color
and --a-visited-color
variables.All of the HTML5 heading elements are styled, using a customizable ratio and simple rules, providing a clean base for your web app's titles. Apart from the headings themselves, customized rules are provided for displaying subheadings or explanatory text below your web app's headings.
<h1>Heading 1 <small>Subheading</small></h1> -<h2>Heading 2 <small>Subheading</small></h2> -<h3>Heading 3 <small>Subheading</small></h3> -<h4>Heading 4 <small>Subheading</small></h4> -<h5>Heading 5 <small>Subheading</small></h5> -<h6>Heading 6 <small>Subheading</small></h6>-
--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.Image elements are responsive by default, automatically scaling down as necessary to display properly on smaller devices. Images retain their original aspect ratio and they will never scale above their original size.
-If you want to add captions to images, you can use HTML5 figure elements, along with their related captions.
<img src="image.png" alt="Image description"/>
<figure> - <img src="image.png" alt="Image description"/> - <figcaption>Image caption</figcaption> -</figure>
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.List elements, both unordered and ordered, are minimally styled to match with the rest of the framework's aesthetics. Their margins and padding are reset to properly align with the rest of the common HTML5 elements, providing a stable foundation for all of your web app's lists.
<ul> - <li>Apple</li> - <li>Orange</li> - <li>Strawberry</li> -</ul> -<ol> - <li>Wake up</li> - <li>Eat breakfast</li> - <li>Go to work</li> -</ol>
--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.Code blocks and quotation elements are styled using custom rules that help make them stand out from the rest of the text, while inline code and keyboard input tags are minimally styled, aiming not to break the flow of regular text.
This is some text with some inline source code
and some keyboard input.
function sum(num1, num2){ - return num1 + num2; -}-
This is some text quoted from elsewhere.
<p>This is some text with some inline <code>source code</code> and some keyboard <kbd>input</kbd>.</p> -<pre>function sum(num1, num2){ - return num1 + num2; -}</pre> -<blockquote cite="www.quotation.source">This is some text quoted from elsewhere.</blockquote>
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>-
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="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>
<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.mini.css provides you with cards (.card
), general-purpose containers that help you organize the content of your web apps. Cards should be used in combination with the grid system, meaning that they need to be placed inside a grid's rows to work properly. Layouts created with cards are responsive, realigning according to the available size on the screen.
This is a basic card with some sample content.
This is another card with some sample content.
This is one more card with some sample content.
<div class="row"> - <div class="card"></div> - <div class="card"></div> -</div>
You can create small (.small
, 240px
wide) or large (.large
, 480px
wide) cards by applying the appropriate modifiers to a card. Apart from that, you can also create fluid (.fluid
) cards, that take up as much space as is available, however you will have to place these cards inside a grid layout's columns, effectively adding one extra step for them to display properly.
Small cards are 240px
wide.
Large cards are 480px
wide.
Fluid cards scale their width based on the column that contains them.
<div class="row"> - <div class="card small"></div> - <div class="card large"></div> - <div class="col-sm-12"> - <div class="card fluid"></div> - </div> -</div>
You can display warning (.warning
) or error (.error
) messages using cards, simply by adding the appropriate color modifiers to a card.
Warning cards are used to display important information to users.
Error cards are used to display error messages to users.
<div class="row"> - <div class="card warning"></div> - <div class="card error"></div> -</div>
<div class="card"> - <div class="row"> - <div class="card"></div> - </div> -</div>
Do: You can create rows inside a card, which can in turn contain other cards.
<div class="card row"></div> -<div class="card col-sm"></div>
Don't: An element cannot be a card and a row or column at the same time.
<div> - <div class="card"></div> -</div>
Don't: Never forget to wrap your cards inside a row and your fluid cards inside a row and a column.
<div class="row"> - <div class="card"></div> - <div class="card fluid"></div> -</div>
Don't: Try not to combine fixed-width and fluid cards. Instead, combine fixed-width cards with columns and place fluid cards inside them.
<div class="card warning error"></div>
Don't: Avoid applying two color modifiers on the same card.
--card-fore-color
variable.--card-back-color
variable.--card-border-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-border-radius
variable.Card content is usually organized in smaller sections (.section
) to be more easily digestible. A card section can be any valid HTML5 element with the appropriate class applied to it.
This is a section with some textual content.
<div class="card"> - <div class="section"></div> - <div class="section"></div> -</div>
You can create sections for media (.media
), such as images or videos (using an <img>
or a <iframe>
element respectively). These sections are styled appropriately for presentation of media content, meaning that the content will scale appropriately to fill up the available space.
<div class="card"> - <img src="image.png" class="section media"/> -</div>
You can create sections with a darker (.dark
) background, by applying the appropriate modifier.
<div class="card"> - <div class="section dark"></div> -</div>
You can create sections with additional spacing (.double-padded
), by applying the appropriate modifier.
<div class="card"> - <div class="section double-padded"></div> -</div>
<div class="card"> - <div class="section"></div> - <p>This should have been a section!</p> -</div>
Don't: Avoid mixing regular content with content in sections. Instead, wrap all of your card's contents in sections.
200px
.object-fit
, you might want to use a polyfill for better browser support (recommended: image polyfill, video polyfill).--card-fore-color
variable.--card-back-color
variable.--card-border-color
variable.--universal-padding
variable.Forms, labels and common HTML5 input elements have been styled using clean, modern rules, improving the accessibility and usability of your web apps' forms.
<form> - <fieldset> - <legend>Simple form</legend> - <label for="username">Username</label> - <input type="text" id="Username" placeholder="Username"/> - <label for="password">Password</label> - <input type="password" id="password" placeholder="Password"/> - </fieldset> -</form>
<form> - <fieldset> - <legend>Simple form</legend> - <div> class="row"> - <div> class="col-sm-12 col-md-6"> - <label for="username">Username</label> - <input type="text" id="Username" placeholder="Username"/> - </div> - <div> class="col-sm-12 col-md-6"> - <label for="password">Password</label> - <input type="password" id="password" placeholder="Password"/> - </div> - </div> - </fieldset> -</form>
Do: Form inputs are inline by defaut, however you can combine forms with the grid system to create aligned forms.
<fieldset>
and <legend>
elements is highly recommended, as it improves semantic markup and accessibility.--form-fore-color
variable.--form-back-color
variable.--form-border-color
variable.--input-fore-color
variable.--input-back-color
variable.--input-border-color
variable.--input-focus-color
and --input-invalid-color
variables respectively.--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.You can ensure that input elements and labels display together on the same line, by grouping them together (.input-group
). You can also group buttons together, using a different grouping class (.button-group
).
<div class="input-group"> - <label for="username">Username</label> - <input type="text" id="Username" placeholder="Username"/> -</div>
<div class="button-group"> - <button>Button</button> - <button>Button</button> - <button>Button</button> -</div>
You can make your input groups fluid (.fluid
) or vertical (.vertical
), by applying the appropriate modifiers.
<div class="input-group fluid"> - <label for="username">Username</label> - <input type="text" id="Username" placeholder="Username"/> -</div> -<div class="input-group vertical"> - <label for="username">Username</label> - <input type="text" id="Username" placeholder="Username"/> -</div>
<div class="input-group row"> - <div class="col-sm"> - <label for="username">Username</label> - <input type="text" id="Username" placeholder="Username"/> - </div> -</div>
Don't: Avoid combining input groups with the grid system, as there might be overlapping styles.
The header element has been minimally styled, allowing you to create modern headers for your web apps. A header can include a logo element (.logo
), as well as buttons, links and labels, styled as buttons (.button
).
<header> - <a href="#" class="logo">Logo</a> - <a href="#" class="button">Home</a> - <button>Download</button> -</header>
You can make your web app's header sticky (.sticky
), by applying the appropriate modifier.
<header class="sticky"> - <a href="#" class="logo">Logo</a> - <a href="#" class="button">Home</a> - <button>Download</button> -</header>
<header> - <a href="#" class="button logo">Logo</a> - <a href="#">Home</a> -</header>
Don't: You should not apply a .button
class to the logo of your header, but you must make sure that all other elements inside the header are styled as buttons.
--header-fore-color
variable.--header-back-color
variable.--header-border-color
variable.--header-hover-back-color
variable.The drawer component of mini.css is used to create responsive navigation menus for your web apps. It is composed of three components - the drawer, the toggle button and the close button:
-.drawer
), immediately followed by a container of your liking (e.g. a <div>
or <nav>
). The former serves as your drawer's control, while the latter is the actual drawer container..drawer-toggle
). This will serve as the toggle button for your drawer menu..drawer-close
). This will serve as the close button for your drawer menu.<label for="drawer-control" class="drawer-toggle"></label> - -<input type="checkbox" id="drawer-control" class="drawer"> -<div> - <label for="drawer-control" class="drawer-close"></label> - <a href="#">Home</a> -</div>
If you want your drawer menus to not expand into normal containers on larger screens, simply add the appropriate modifier (.persistent
) on the checkbox controlling the drawer and its toggle button.
<label for="drawer-control" class="drawer-toggle persistent"></label> - -<input type="checkbox" id="drawer-control" class="drawer persistent"> -<div> - <label for="drawer-control" class="drawer-close"></label> - <a href="#">Home</a> -</div>
<div class="row"> - <input type="checkbox" id="drawer-control" class="drawer"> - <div class="col-md-4"> - <label for="drawer-control" class="drawer-close"></label> - <a href="#">Home</a> - </div> - <div class="col-sm-12 col-md-8"> - <p>Page content</p> - </div> -</div>
Do: You can combine the drawer menu with the grid system to create responsive menus that are part of the layout of your web app.
<input type="checkbox" id="drawer-control" class="drawer"> -<!-- Do not place other stuff between these --> -<div> - <label for="drawer-control" class="drawer-close"></label> - <a href="#">Home</a> -</div>
Don't: You should not place anything between the checkbox controlling the drawer and the container.
768px
wide.--fore-color
variable. This will affect the text color of the toggle button and items inside the drawer container.--drawer-back-color
variable.--drawer-border-color
variable.--drawer-close-color
.--drawer-hover-back-color
.--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.Tables are styled in a minimal, modern and responsive manner, allowing users on all devices to easily browse tabular data, taking advantage of the Flexbox layout's capabilities. To make tabular data properly display on mobile devices, remember to specify a data-label
attribute for each <>
element (usually same as the heading of the column).
Name | Surname | Alias |
---|---|---|
Chad | Wilberts | MrOne |
Adam | Smith | TheSmith |
Sophia | Canderson | Candee |
Nick | Thomson | NickThom |
Mark | Gerkis | Markie |
John | Fergusson | Fergujohn |
Sylvia | Pouleau | Sylver |
Norman | Jones | NormalJones |
Trevor | Heidel | Heidi |
Name | Surname | Alias |
---|---|---|
Chad | Wilberts | MrOne |
Adam | Smith | TheSmith |
Sophia | Canderson | Candee |
<table> - <caption>People</caption> - <thead> - <tr> - <th>Name</th> - <th>Surname</th> - <th>Alias</th> - </tr> - </thead> - <tbody> - <tr> - <td data-label="Name">Chad</td> - <td data-label="Surname">Wilberts</td> - <td data-label="Alias">MrOne</td> - </tr> - <tr> - <td data-label="Name">Adam</td> - <td data-label="Surname">Smith</td> - <td data-label="Alias">TheSmith</td> - </tr> - <tr> - <td data-label="Name">Sophia</td> - <td data-label="Surname">Canderson</td> - <td data-label="Alias">Candee</td> - </tr> - </tbody> -</table>
You can create horizontal tables (.horizontal
), by applying the appropriate class.
Name | Surname | Alias |
---|---|---|
Chad | Wilberts | MrOne |
Adam | Smith | TheSmith |
Sophia | Canderson | Candee |
<table class="horizontal"> - <caption>People</caption> - <thead> - <tr> - <th>Name</th> - <th>Surname</th> - <th>Alias</th> - </tr> - </thead> - <tbody> - <tr> - <td data-label="Name">Chad</td> - <td data-label="Surname">Wilberts</td> - <td data-label="Alias">MrOne</td> - </tr> - <tr> - <td data-label="Name">Adam</td> - <td data-label="Surname">Smith</td> - <td data-label="Alias">TheSmith</td> - </tr> - <tr> - <td data-label="Name">Sophia</td> - <td data-label="Surname">Canderson</td> - <td data-label="Alias">Candee</td> - </tr> - </tbody> -</table>
You can create striped tables (.striped
), by applying the appropriate class.
Name | Surname | Alias |
---|---|---|
Chad | Wilberts | MrOne |
Adam | Smith | TheSmith |
Sophia | Canderson | Candee |
<table class="striped"> - <caption>People</caption> - <thead> - <tr> - <th>Name</th> - <th>Surname</th> - <th>Alias</th> - </tr> - </thead> - <tbody> - <tr> - <td data-label="Name">Chad</td> - <td data-label="Surname">Wilberts</td> - <td data-label="Alias">MrOne</td> - </tr> - <tr> - <td data-label="Name">Adam</td> - <td data-label="Surname">Smith</td> - <td data-label="Alias">TheSmith</td> - </tr> - <tr> - <td data-label="Name">Sophia</td> - <td data-label="Surname">Canderson</td> - <td data-label="Alias">Candee</td> - </tr> - </tbody> -</table>
You can create hoverable tables (.hoverable
), by applying the appropriate class.
Name | Surname | Alias |
---|---|---|
Chad | Wilberts | MrOne |
Adam | Smith | TheSmith |
Sophia | Canderson | Candee |
<table class="hoverable"> - <caption>People</caption> - <thead> - <tr> - <th>Name</th> - <th>Surname</th> - <th>Alias</th> - </tr> - </thead> - <tbody> - <tr> - <td data-label="Name">Chad</td> - <td data-label="Surname">Wilberts</td> - <td data-label="Alias">MrOne</td> - </tr> - <tr> - <td data-label="Name">Adam</td> - <td data-label="Surname">Smith</td> - <td data-label="Alias">TheSmith</td> - </tr> - <tr> - <td data-label="Name">Sophia</td> - <td data-label="Surname">Canderson</td> - <td data-label="Alias">Candee</td> - </tr> - </tbody> -</table>
<table> - <caption>People</caption> - <thead> - <tr> - <td>Bad idea</td> - </tr> - </thead> - <tbody> - <tr> - <th data-label="Bad">Also bad idea</th> - </tr> - </tbody> -</table>
Don't: Avoid placing <td>
elements in the <thead>
of your tables, as well as placing <th>
elements in the <tbody>
.
data-label
attribute for all of your <td>
elements, otherwise they will not display properly on mobile.<tfoot>
element is not supported.max-height
property of 400px
.<th>
and <td>
elements can be changed by changing the values of the --table-head-fore-color
and --table-body-fore-color
variables respectively.<th>
and <td>
elements can be changed by changing the values of the --table-head-back-color
and --table-body-back-color
variables respectively.--table-border-color
variable.--table-border-separator-color
variable.<td>
elements in striped tables can be changed by changing the value of the --table-body-alt-back-color
variable.<tr>
elements in hoverable tables can be changed by changing the value of the --table-body-hover-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.--universal-border-radius
variable.The native HTML5 mark element has been minimally styled to allow for easy text highlighting.
This is a paragraph with some highlighted text.
<p>This is some <mark>highlighted text</mark>.</p>
You can change the color of highlighted text, based on context by applying the appropriate class (secondary - .secondary
or tertiary - .tertiary
).
This is a secondary highlight and this is a tertiary highlight.
<p>This is a <mark class="secondary">secondary highlight</mark> and this is a <mark class="tertiary">tertiary highlight</mark>.</p>
You can make highlights look like tags (.tag
) or display as inline blocks (.inline-block
), by applying the appropriate class.
This is a highlight styled as a tag.
This is some highlighted text that is displayed as an inline block.
<p>This is a highlight styled as a <mark class="tag">tag</mark>.</p> -<p><mark class="inline-block">This is some highlighted text that is displayed as an inline block.</mark></p>
<mark class="inline-block"><mark class="secondary">Secondary highlight</mark> inside a inline block.</mark>
Do: You can nest a highlight inside another one, if the outer one is displayed as an inline-block.
<mark class="primary inverse">Highlight</mark>
-
Don't: Avoid applying multiple color modifiers on the same highlight.
--mark-fore-color
variable.--mark-back-color
variable.--universal-padding
variable.--universal-border-radius
variable.mini.css provides you with toast messages (.toast
), allowing you to display native-looking notifications on mobile devices.
<span class="toast">This is a toast message!</span>
--toast-fore-color
variable.--toast-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.--universal-border-radius
variable.You can utilize the aria-label
property to create accessible tooltips (.tooltip
), allowing you to display explanatory text for different elements.
Hover over this text to see a tooltip!
<span class="tooltip" aria-label="Tooltip text">Hover over text to see tooltip</span>
You can make tooltips display below the related text, by adding the appropriate class (.bottom
).
Hover over this text to see a tooltip!
<span class="tooltip bottom" aria-label="Tooltip text">Hover over text to see tooltip</span>
aria-label
property, so they are fully accessible on screen readers.--tooltip-fore-color
variable.--tooltip-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.--universal-border-radius
variable.mini.css provides you with a modal dialog component to display messages to users. It is composed of three components - the modal dialog, the toggle button and the close button:
-.modal
), immediately followed by a <div>
container. The former serves as your modal dialog's control, while the latter is the actual modal dialog container.This is a modal dialog!
<label for="modal-control">Show modal</label> - -<input type="checkbox" id="modal-control" class="modal"> -<div> - <div class="card"> - <label for="modal-control" class="modal-close" ></label> - <h3 class="section">Modal</h3> - <p class="section">This is a modal dialog!</p> - </div> -</div>
<input type="checkbox" id="modal-control" class="modal"> -<div role="dialog" aria-labelledby="dialog-title"> - <div class="card"> - <label for="modal-control" class="modal-close" ></label> - <h3 class="section" id="dialog-title">Modal</h3> - <p class="section">This is a modal dialog!</p> - </div> -</div>
Do: You can use the role="dialog"
to add accessibility to your modal dialogs. Remember to properly label it and manage keyboard focus, as required.
<input type="checkbox" id="modal-control" class="modal"> -<!-- Do not place other stuff between these --> -<div> - <div class="card"> - <label for="modal-control" class="modal-close" ></label> - <h3 class="section">Modal</h3> - <p class="section">This is a modal dialog!</p> - </div> -</div>
Don't: You should not place anything between the checkbox controlling the modal dialog and the container.
--modal-overlay-color
.--modal-close-color
.--modal-close-hover-color
.--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.mini.css provides you with accessible spoilers and accordions. They are composed of two components - the wrapper, the toggle button and the content container:
-<div>
, applying the appropriate class to it (.collapse
). This serves as the wrapper for the collapsible spoiler.<label>
for the checkbox. The former serves as your collapsible spoiler's control, while the latter is the toggle button for your collapsible spoiler.<div>
right after the <label>
. This will serve as the container for the collapsible content.If you want to create an accordion, simply repeat the last two steps above for each section of the accordion. In order to make collapsible spoilers and accordions fully accessible, it is highly recommended to add the aria-hidden="true"
attribute to all labels and inputs that control the behavior of these components.
This is the first section of the collapse
This is the second section of the collapse
This is the first section of the accordion
This is the second section of the accordion
<div class="collapse"> - <input type="checkbox" id="collapse-section1" checked aria-hidden="true"> - <label for="collapse-section1" aria-hidden="true">Collapse section 1</label> - <div> - <p>This is the first section of the collapse</p> - </div> - <input type="checkbox" id="collapse-section2" aria-hidden="true"> - <label for="collapse-section2" aria-hidden="true">Collapse section 2</label> - <div> - <p>This is the second section of the collapse</p> - </div> -</div>
<div class="collapse"> - <input type="radio" id="accordion-section1" checked aria-hidden="true" name="accordion"> - <label for="accordion-section1" aria-hidden="true">Accordion section 1</label> - <div> - <p>This is the first section of the accordion</p> - </div> - <input type="radio" id="accordion-section2" aria-hidden="true" name="accordion"> - <label for="accordion-section2" aria-hidden="true">Accordion section 2</label> - <div> - <p>This is the second section of the accordion</p> - </div> -</div>
<div class="collapse"> - <input type="checkbox" id="collapse-section1" checked aria-hidden="true"> - <!-- Do not place other stuff between these --> - <label for="collapse-section1" aria-hidden="true">Collapse section 1</label> - <!-- Do not place other stuff between these --> - <div> - <p>This is the first section of the collapse</p> - </div> -</div>
Don't: You should not place anything between the checkbox controlling the collapsible spoiler and its label or between the label and the content container.
name
.checked
attribute to the respective collapsible spooiler's or section's control.max-height
of the content container is 400px
.aria-hidden="true"
attribute is highly recommended, as screen readers will ignore the controls of the collapsible spoiler or accordion and read all the contained content normally.--collapse-label-back-color
, --collapse-label-fore-color
and --collapse-label-hover-back-color
respectively.--collapse-border-color
.--collapse-content-back-color
.--collapse-selected-label-back-color
and --collapse-selected-label-border-color
respectively.--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.Progress bars are minimally styled to match with the rest of the framework's aesthetics and be consistent across all modern browsers.
<progress value="450" max="1000"></progress>
You can create inline progress bars (.inline
), by applying the appropriate modifier.
45% completed...
<progress value="450" max="1000" class="inline"></progress>
You can create primary, secondary or tertiary (.primary
, .secondary
, .tertiary
) progress bars, simply by adding the appropriate color modifier.
<progress value="450" max="1000" class="primary"></progress> -<progress value="450" max="1000" class="secondary"></progress> -<progress value="450" max="1000" class="tertiary"></progress>
<progress value="45" max="100"></progress> -<progress value="450.0" max="1000.0"></progress>
Don't: Avoid using different values than 1000
for progress bars' max
attribute, as well as floating point values for either max
or value
.
<progress value="450" max="1000" class="primary secondary"></progress>
Don't: Avoid applying two color modifiers on the same progress bar.
max="1000"
attribute, as this covers the most common use-cases.--progress-fore-color
variable.--progress-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-border-radius
variable.mini.css provides you with animated loading indicators (.spinner
), which you can use to indicate that some content is loading.
<div class="spinner"></div>
You can create primary, secondary or tertiary (.primary
, .secondary
, .tertiary
) donut spinners, simply by adding the appropriate color modifier.
<div class="spinner primary"></div> -<div class="spinner secondary"></div> -<div class="spinner tertiary"></div>
<div class="spinner">Don't place text here.</div>
Don't: Avoid inserting text inside donut spinners.
<div class="spinner primary secondary"></div>
Don't: Avoid applying two color modifiers on the same donut spinner.
<div>
or a <span>
element to create a donut spinner.role="progressbar"
attribute to spinner donut elements to increase accessibility.--spinner-fore-color
variable.--spinner-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.mini.css comes with a set of 20 commonly-used icons (courtesy of Feather) that you can use anywhere in your web apps, utilizing the appropriate class for each icon.
.icon-alert
.icon-bookmark
.icon-calendar
.icon-cart
.icon-credit
.icon-edit
.icon-help
.icon-home
.icon-info
.icon-link
.icon-location
.icon-lock
.icon-mail
.icon-phone
.icon-rss
.icon-search
.icon-settings
.icon-share
.icon-upload
.icon-user
<span class="icon-alert"></span> -<span class="icon-bookmark"></span> -<span class="icon-calendar"></span> -<span class="icon-cart"></span> -<span class="icon-credit"></span> -<span class="icon-edit"></span> -<span class="icon-help"></span> -<span class="icon-home"></span> -<span class="icon-info"></span> -<span class="icon-link"></span> -<span class="icon-location"></span> -<span class="icon-lock"></span> -<span class="icon-mail"></span> -<span class="icon-phone"></span> -<span class="icon-rss"></span> -<span class="icon-search"></span> -<span class="icon-settings"></span> -<span class="icon-share"></span> -<span class="icon-upload"></span> -<span class="icon-user"></span>
You can create secondary or inverse (.secondary
, .inverse
) icons, simply by adding the appropriate color modifier.
This is a secondary icon, which has a lighter color.
This is an inverse icon.
<span class="icon-alert secondary"></span> -<span class="icon-alert inverse"></span>
<span class="icon-alert">Don't place text here.</span>
Don't: Avoid inserting text inside icon elements.
<span class="icon-alert inverse secondary"></span>
Don't: Avoid applying two color modifiers on the same icon.
<span>
element to create an icon.--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.You can use visibility helper classes to hide elements for all users (.hidden
) or for users not on screen readers (.visually-hidden
). There are also responsive visibility helpers provided, for hiding or visually hiding content only for specific screen sizes (.hidden-sm
, .hidden-md
, .hidden-lg
and .visually-hidden-sm
, .visually-hidden-md
and .visually-hidden-lg
respectively).
<p class="hidden">Not visible for any users.</p> -<p class="visually-hidden">Visible only for screen readers.</p> -<p class="hidden-sm">Not visible for users on screens under 768px wide.</p> -<p class="hidden-md">Not visible for users on screens 768px-1280px wide.</p> -<p class="hidden-lg">Not visible for users on screens wider than 1280px.</p> -<p class="visually-hidden-sm">Visible only for screen readers under 768px wide.</p> -<p class="visually-hidden-md">Visible only for screen readers 768px-1280px wide.</p> -<p class="visually-hidden-lg">Visible only for screen readers wider than 1280px.</p>
<p class="hidden-sm hidden-md">Not visible for users on screens under 1280px wide.</p>
Do: You can apply multiple responsive visibility helpers on the same element.
<p class="hidden visually-hidden">Do not do this.</p>
Don't: Avoid combining .hidden
and .visually-hidden
or responsive helpers for the same screen size.
!important
declarations to override any other styles, so exercise caution when using them.768px
wide768px
wide and less than 1280px
wide1280px
wide or moreYou can apply generic borders, shadows or border radiuses to any element, by using the appropriate class (.bordered
, .shadowed
, .rounded
or .circular
).
<span class="bordered">Bordered element.</span> -<span class="shadowed">Shadowed element.</span> -<span class="rounded">Rounded element.</span> -<span class="circular">Circular element.</span>
<span class="rounded circular">Do not do this.</span>
Don't: Avoid applying the .rounded
and .circular
decorators on the same element.
!important
declarations to override any other styles, so exercise caution when using them.--generic-border-color
variable.--generic-box-shadow
variable.You can make elements' spacing or sizing responsive by applying the appropriate class (.responsive-margin
or .responsive-padding
).
<span class="responsive-margin">Responsive margin.</span> -<span class="responsive-padding">Responsive padding.</span>
!important
declarations to override any other styles, so exercise caution when using them.--universal-margin
variable, affecting the responsive spacing modifier. 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, affecting the responsive sizing modifier.