Getting started
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.1/dist/mini-default.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mini.css/3.0.1/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.
Common textual elements
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.
Example
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!
Sample code
<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/>
Best practices
/* 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.
Customization
- Text color can be changed globally by changing the value of the
--fore-color
variable. - Background color can be changed globally by changing the value of the
--back-color
variable. - Border color can be changed globally by changing the value of the
--border-color
variable. This affects the color of<hr>
elements. - Universal margin for elements can be changed globally by changing the value of the
--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 for elements can be changed globally by changing the value of the
--universal-padding
variable. - You can change the color of links by changing the values of the
--a-link-color
and--a-visited-color
variables.
Headings
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.
Example
Heading 1Subheading
Heading 2Subheading
Heading 3Subheading
Heading 4Subheading
Heading 5Subheading
Heading 6Subheading
Sample code
<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>
Customization
- Text color can be changed globally by changing the value of the
--fore-color
variable. This will affect the color of the headings' main text. - Secondary text color can be changed globally by changing the value of the
--secondary-fore-color
variable. This will affect the color of subheadings. - Universal margin for elements can be changed globally by changing the value of the
--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 change the ratio of headings' size by chaning the value of the
--heading-ratio
variable. Bear in mind that the value of this variable must be unitless to work properly.
Lists
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.
Example
- Apple
- Orange
- Strawberry
- Wake up
- Eat breakfast
- Go to work
Sample code
<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>
Customization
- Text color can be changed globally by changing the value of the
--fore-color
variable. - Background color can be changed globally by changing the value of the
--back-color
variable. - Universal margin for elements can be changed globally by changing the value of the
--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 for elements can be changed globally by changing the value of the
--universal-padding
variable.
Code & quotations
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.
Example
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.
Sample code
<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>
Notes
- The
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 thecite
attribute.
Customization
- Text color can be changed globally by changing the value of the
--fore-color
variable. This will affect the text color of<code>
and<pre>
elements and background color of<kbd>
elements. - Background color can be changed globally by changing the value of the
--back-color
variable. This will affect the background color of<blockquote>
elements and text color of<kbd>
. - You can change the background color of
<code>
and<pre>
elements by changing the value of the--secondary-back-color
variable. - You can change the text color of
<blockquote>
elements by changing the value of the--secondary-fore-color
variable. - You can change the border color of
<pre>
and<blockquote>
elements by changing the value of the--secondary-border-color
variable. - You can change the border color of the left border of
<pre>
elements by changing the value of the--pre-color
variable. - You can change the border color of the left border of
<blockquote>
elements by changing the value of the--blockquote-color
variable. - Universal margin for elements can be changed globally by changing the value of the
--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 for elements can be changed globally by changing the value of the
--universal-padding
variable. - Universal border radius for elements can be changed globally by changing the value of the
--universal-border-radius
variable.
Grid system
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:
- The container (
.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. - Inside the container, you can add one or more rows (
.row
), which will in turn house the columns. - 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.
Example
Sample code
<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>
Modifiers
Screen sizes and width
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.
Example
Small screen layout
Medium/Large screen layout
Sample code
<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>
Predefined layouts
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.
Sample code
<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>
Column offsets
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.
Example
Sample code
<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>
Column reordering
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.
Example
Small screen layout
Medium/Large screen layout
Sample code
<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>
Best practices
<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.
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:
- small: less than
768px
wide - medium: more than or equal to
768px
wide and less than1280px
wide - large:
1280px
wide or more
- small: less than
- In many cases, you can omit the container and just use rows and columns. You only need to make sure that all of your rows have the same parent element.
- You can use fluid columns to create columns whose width is not a multiple of 1/12th of the screen's width (e.g. if you have 7 fluid columns in a row, each one of them will be 1/7th of the screen's width).
- Predefined layouts can be combined with most of the features of the grid system, such as offsets and reordering, however they do not combine very well with regular columns.
- You should only apply offset and reordering modifiers to the columns that you need and for the screen sizes that are necessary. Remember to also specify a column width or use a predefined layout before applying these modifiers.
Customization
- Universal padding for elements can be changed globally by changing the value of the
--universal-padding
variable. This only affects the padding of the container.
Cards
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.
Example
Card 1
This is a basic card with some sample content.
Card 2
This is another card with some sample content.
Card 3
This is one more card with some sample content.
Sample code
<div class="row"> <div class="card"></div> <div class="card"></div> </div>
Modifiers
Alternative sizes
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.
Example
Small Card
Small cards are 240px
wide.
Large Card
Large cards are 480px
wide.
Fluid Card
Fluid cards scale their width based on the column that contains them.
Sample code
<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>
Color variants
You can display warning (.warning
) or error (.error
) messages using cards, simply by adding the appropriate color modifiers to a card.
Example
Warning Card
Warning cards are used to display important information to users.
Error Card
Error cards are used to display error messages to users.
Sample code
<div class="row"> <div class="card warning"></div> <div class="card error"></div> </div>
Best practices
<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.
Notes
- Due to the fact that fluid cards stretch to fill their parent container, they might not fully respect their margins sometimes, although this should not cause any noticable problems in your web apps' layouts.
Customization
- Text color for cards can be changed by changing the value of the
--card-fore-color
variable. - Background color for cards can be changed by changing the value of the
--card-back-color
variable. - Border color for cards can be changed by changing the value of the
--card-border-color
variable. - You can customize the colors of different color variants by changing the values of the related variables in their respective definitions.
- Universal margin for elements can be changed globally by changing the value of the
--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 for elements can be changed globally by changing the value of the
--universal-border-radius
variable.
Card sections
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.
Example
Title section
This is a section with some textual content.
Sample code
<div class="card"> <div class="section"></div> <div class="section"></div> </div>
Modifiers
Media sections
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.
Example
Card with image
Card with video
Sample code
<div class="card"> <img src="image.png" class="section media"/> </div>
Color variants
You can create sections with a darker (.dark
) background, by applying the appropriate modifier.
Example
Normal section
Dark section
Sample code
<div class="card"> <div class="section dark"></div> </div>
Additional spacing
You can create sections with additional spacing (.double-padded
), by applying the appropriate modifier.
Example
Normal spacing
Additional spacing
Sample code
<div class="card"> <div class="section double-padded"></div> </div>
Best practices
<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.
Notes
- While not mandatory, it is highly suggested that you wrap all of your cards' contents in one or more sections.
- Remember that a section can be any valid HTML5 element, so you can apply them to headings, paragraphs, input elements etc.
- Media sections have a default height of
200px
. - Due to the media sections using
object-fit
, you might want to use a polyfill for better browser support (recommended: image polyfill, video polyfill). - Depending on the source website, some embedded videos might not display properly as media sections.
Customization
- Text color for cards and card sections can be changed by changing the value of the
--card-fore-color
variable. - Background color for cards and card sections can be changed by changing the value of the
--card-back-color
variable. - Border color for cards and card sections can be changed by changing the value of the
--card-border-color
variable. - You can customize the colors of different color variants by changing the values of the related variables in their respective definitions.
- Universal padding for elements can be changed globally by changing the value of the
--universal-padding
variable.
Forms & input
Forms, labels and common HTML5 input elements have been styled using clean, modern rules, improving the accessibility and usability of your web apps' forms.
Example
Sample code
<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>
Best practices
<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 default, however you can combine forms with the grid system to create aligned forms.
Notes
- Using the
<fieldset>
and<legend>
elements is highly recommended, as it improves semantic markup and accessibility. - Some input elements, such as date & time, color and range types, are not supported and, as a result, do not have a default style defined for them. You can define said styles manually if you need to use them in your web app.
Customization
- Text color for forms and legend elements can be changed by changing the value of the
--form-fore-color
variable. - Background color for forms can be changed by changing the value of the
--form-back-color
variable. - Border color for forms and fieldset elements can be changed by changing the value of the
--form-border-color
variable. - Text color for input elements can be changed by changing the value of the
--input-fore-color
variable. - Background color for input elements can be changed by changing the value of the
--input-back-color
variable. - Border color for input elements can be changed by changing the value of the
--input-border-color
variable. - Border color for focused and invalid input elements can be changed by changing the value of the
--input-focus-color
and--input-invalid-color
variables respectively. - Universal margin for elements can be changed globally by changing the value of the
--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 for elements can be changed globally by changing the value of the
--universal-padding
variable. - Universal border radius for elements can be changed globally by changing the value of the
--universal-border-radius
variable.
Input grouping
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
).
Example
Sample code
<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>
Modifiers
Fluid & vertical grouping
You can make your input groups fluid (.fluid
) or vertical (.vertical
), by applying the appropriate modifiers.
Example
Sample code
<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>
Best practices
<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.
Notes
- It is highly recommended that you do not place checkboxes or radio buttons inside fluid or vertical input groups.
- Button groups will display horizontally on medium and large screens, but collapse into a vertical view on small screens.
Header
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
).
Sample code
<header> <a href="#" class="logo">Logo</a> <a href="#" class="button">Home</a> <button>Download</button> </header>
Modifiers
Sticky header
You can make your web app's header sticky (.sticky
), by applying the appropriate modifier.
Sample code
<header class="sticky"> <a href="#" class="logo">Logo</a> <a href="#" class="button">Home</a> <button>Download</button> </header>
Best practices
<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.
Notes
- The header element is partially responsive on smaller screens, displaying a scrollbar indicating that there is more content off-screen.
- The header element can be a row in a grid system, allowing you to create responsive headers.
Customization
- Text color for the header can be changed by changing the value of the
--header-fore-color
variable. - Background color for the header can be changed by changing the value of the
--header-back-color
variable. - Border color for the header can be changed by changing the value of the
--header-border-color
variable. - Background color for focused buttons inside the header can be changed by changing the value of the
--header-hover-back-color
variable.
Menu drawer
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:
- To create a drawer, simply create a checkbox input, applying the appropriate class to it (
.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. - Create a label anywhere outside your drawer's container for the checkbox controlling your drawer, applying the appropriate class (
.drawer-toggle
). This will serve as the toggle button for your drawer menu. - Finally, inside your drawer's container, add another label for the checkbox controlling your drawer, applying the appropriate class (
.drawer-close
). This will serve as the close button for your drawer menu.
Sample code
<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>
Modifiers
Persistent drawer
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.
Sample code
<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>
Best practices
<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.
Notes
- Drawer menus are responsive by default and will expand into normal containers on screens larger or equal to
768px
wide. - It is highly recommended to place your drawer's toggle button inside your web app's header element.
- You can combine the navigation bar element with the drawer menu for better results.
- Remember to apply the appropriate classes to any and all elements, as indicated in the examples. Failing to do so will result in the drawer menu not rendering or behaving properly.
Customization
- Text color can be changed globally by changing the value of the
--fore-color
variable. This will affect the text color of the toggle button and items inside the drawer container. - Background color for the drawer container can be changed by changing the value of the
--drawer-back-color
variable. - Border color for the drawer container can be changed by changing the value of the
--drawer-border-color
variable. - Text color for the drawer close button can be changed by changing the values of the
--drawer-close-color
. - Background color for the drawer close button when focused or hovered over can be changed by changing the values of the
--drawer-hover-back-color
. - Universal margin for elements can be changed globally by changing the value of the
--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 for elements can be changed globally by changing the value of the
--universal-padding
variable. - Universal border radius for elements can be changed globally by changing the value of the
--universal-border-radius
variable.
Tables
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).
Example
Desktop view
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 |
Mobile view
Name | Surname | Alias |
---|---|---|
Chad | Wilberts | MrOne |
Adam | Smith | TheSmith |
Sophia | Canderson | Candee |
Sample code
<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>
Modifiers
Horizontal tables
You can create horizontal tables (.horizontal
), by applying the appropriate class.
Example
Name | Surname | Alias |
---|---|---|
Chad | Wilberts | MrOne |
Adam | Smith | TheSmith |
Sophia | Canderson | Candee |
Sample code
<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>
Striped tables
You can create striped tables (.striped
), by applying the appropriate class.
Example
Name | Surname | Alias |
---|---|---|
Chad | Wilberts | MrOne |
Adam | Smith | TheSmith |
Sophia | Canderson | Candee |
Sample code
<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>
Hoverable tables
You can create hoverable tables (.hoverable
), by applying the appropriate class.
Example
Name | Surname | Alias |
---|---|---|
Chad | Wilberts | MrOne |
Adam | Smith | TheSmith |
Sophia | Canderson | Candee |
Sample code
<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>
Best practices
<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>
.
Notes
- Remember to always specify a
data-label
attribute for all of your<td>
elements, otherwise they will not display properly on mobile. - Due to the way tables are displayed, the
<tfoot>
element is not supported by default. You can however addtable tfoot { order: 3; }
to your CSS files to partially support table footers. - Tables are vertically scrollable by default, with a
max-height
property of400px
.
Customization
- Text color for
<th>
and<td>
elements can be changed by changing the values of the--table-head-fore-color
and--table-body-fore-color
variables respectively. - Background color for
<th>
and<td>
elements can be changed by changing the values of the--table-head-back-color
and--table-body-back-color
variables respectively. - Border color for tables can be changed by changing the value of the
--table-border-color
variable. - Border color for the separator between a table's heading and a table's body can be changed by changing the value of the
--table-border-separator-color
variable. - Alternative background color for
<td>
elements in striped tables can be changed by changing the value of the--table-body-alt-back-color
variable. - Hover background color for
<tr>
elements in hoverable tables can be changed by changing the value of the--table-body-hover-back-color
variable. - Universal margin for elements can be changed globally by changing the value of the
--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 for elements can be changed globally by changing the value of the
--universal-padding
variable. - Universal border radius for elements can be changed globally by changing the value of the
--universal-border-radius
variable.
Text highlighting
The native HTML5 mark element has been minimally styled to allow for easy text highlighting.
Example
This is a paragraph with some highlighted text.
Sample code
<p>This is some <mark>highlighted text</mark>.</p>
Modifiers
Color variants
You can change the color of highlighted text, based on context by applying the appropriate class (secondary - .secondary
or tertiary - .tertiary
).
Example
This is a secondary highlight and this is a tertiary highlight.
Sample code
<p>This is a <mark class="secondary">secondary highlight</mark> and this is a <mark class="tertiary">tertiary highlight</mark>.</p>
Style variants
You can make highlights look like tags (.tag
) or display as inline blocks (.inline-block
), by applying the appropriate class.
Example
This is a highlight styled as a tag.
This is some highlighted text that is displayed as an inline block.
Sample code
<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>
Best practices
<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.
Notes
- Highlighted text scales according to its parent element, so it can be used inside any kind of element (headings, forms, paragraphs etc.).
Customization
- Text color for highlighted text can be changed by changing the value of the
--mark-fore-color
variable. - Background color for highlighted text can be changed by changing the value of the
--mark-back-color
variable. - Universal padding for elements can be changed globally by changing the value of the
--universal-padding
variable. - Universal border radius for elements can be changed globally by changing the value of the
--universal-border-radius
variable.
Toasts
mini.css provides you with toast messages (.toast
), allowing you to display native-looking notifications on mobile devices.
Example
Sample code
<span class="toast">This is a toast message!</span>
Notes
- Toast elements do not have any pre-defined behavior, but you can use Javascript to add functionality to them.
Customization
- Text color for toast messages can be changed by changing the value of the
--toast-fore-color
variable. - Background color for toast messages can be changed by changing the value of the
--toast-back-color
variable. - Universal margin for elements can be changed globally by changing the value of the
--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 for elements can be changed globally by changing the value of the
--universal-padding
variable. - Universal border radius for elements can be changed globally by changing the value of the
--universal-border-radius
variable.
Tooltips
You can utilize the aria-label
property to create accessible tooltips (.tooltip
), allowing you to display explanatory text for different elements.
Example
Hover over this text to see a tooltip!
Sample code
<span class="tooltip" aria-label="Tooltip text">Hover over text to see tooltip</span>
Modifiers
Position variant
You can make tooltips display below the related text, by adding the appropriate class (.bottom
).
Example
Hover over this text to see a tooltip!
Sample code
<span class="tooltip bottom" aria-label="Tooltip text">Hover over text to see tooltip</span>
Notes
- Tooltips depend on the
aria-label
property, so they are fully accessible on screen readers.
Customization
- Text color for tooltips can be changed by changing the value of the
--tooltip-fore-color
variable. - Background color for tooltips can be changed by changing the value of the
--tooltip-back-color
variable. - Universal margin for elements can be changed globally by changing the value of the
--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 for elements can be changed globally by changing the value of the
--universal-padding
variable. - Universal border radius for elements can be changed globally by changing the value of the
--universal-border-radius
variable.
Modal dialogs
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:
- To create a modal dialog, simply create a checkbox input, applying the appropriate class to it (
.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. - Create a label anywhere outside your modal dialog's container for the checkbox controlling your modal dialog. This will serve as the toggle button for your modal dialog.
- Finally, inside your modal dialog's container, add another label for the checkbox controlling your modal dialog, applying the appropriate class (.modal-close). This will serve as the close button for your modal dialog.
Example
Modal
This is a modal dialog!
Sample code
<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>
Best practices
<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.
Notes
- Modal dialogs should be used in combination with the card component for best results.
- Remember to apply the appropriate classes to any and all elements, as indicated in the examples. Failing to do so will result in the modal dialog not rendering or behaving properly.
- You can omit the toggle for the modal dialog and use Javascript to show/hide it, instead. You can also use any correctly linked label inside the modal dialog to change its state.
Customization
- Background color for the modal dialog overlay can be changed by changing the value of
--modal-overlay-color
. - Text color for the modal dialog close button can be changed by changing the value of the
--modal-close-color
. - Background color for the modal dialog close button when focused or hovered over can be changed by changing the value of the
--modal-close-hover-color
. - Universal margin for elements can be changed globally by changing the value of the
--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 for elements can be changed globally by changing the value of the
--universal-padding
variable. - Universal border radius for elements can be changed globally by changing the value of the
--universal-border-radius
variable.
Spoilers & accordions
mini.css provides you with accessible spoilers and accordions. They are composed of two components - the wrapper, the toggle button and the content container:
- To create a collapsible spoiler, simply create a
<div>
, applying the appropriate class to it (.collapse
). This serves as the wrapper for the collapsible spoiler. - Inside the wrapper, create a checkbox or radio input, immediately followed by a
<label>
for the checkbox. The former serves as your collapsible spoiler's control, while the latter is the toggle button for your collapsible spoiler. - Create a
<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.
Example
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
Sample code
<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>
Best practices
<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.
Notes
- Make sure all the radio buttons in the same accordion have the same
name
. - If you want a collapsible spoiler or an accordion section to be expanded by default, you can add the
checked
attribute to the respective collapsible spooiler's or section's control. - The
max-height
of the content container is400px
. - Using the
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.
Customization
- Background color, text color and background color on hover for the collapsible spoiler's labels can be changed by changing the values of
--collapse-label-back-color
,--collapse-label-fore-color
and--collapse-label-hover-back-color
respectively. - Border color for the collapsible spoiler can be changed by changing the value of the
--collapse-border-color
. - Background color for the collapsible spoiler's content can be changed by changing the value of the
--collapse-content-back-color
. - Background color and border for the spoiler's content selected labels can be changed by changing the values of the
--collapse-selected-label-back-color
and--collapse-selected-label-border-color
respectively. - Universal margin for elements can be changed globally by changing the value of the
--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 for elements can be changed globally by changing the value of the
--universal-padding
variable. - Universal border radius for elements can be changed globally by changing the value of the
--universal-border-radius
variable.
Progress bars
Progress bars are minimally styled to match with the rest of the framework's aesthetics and be consistent across all modern browsers.
Example
Sample code
<progress value="450" max="1000"></progress>
Modifiers
Inline progress bars
You can create inline progress bars (.inline
), by applying the appropriate modifier.
Example
45% completed...
Sample code
<progress value="450" max="1000" class="inline"></progress>
Color variants
You can create primary, secondary or tertiary (.primary
, .secondary
, .tertiary
) progress bars, simply by adding the appropriate color modifier.
Example
Sample code
<progress value="450" max="1000" class="primary"></progress> <progress value="450" max="1000" class="secondary"></progress> <progress value="450" max="1000" class="tertiary"></progress>
Best practices
<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.
Notes
- Progress bars are designed to work with a
max="1000"
attribute, as this covers the most common use-cases.
Customization
- Foreground color for progress bars can be changed by changing the value of the
--progress-fore-color
variable. - Background color for progress bars can be changed by changing the value of the
--progress-back-color
variable. - You can customize the colors of different color variants by changing the values of the related variables in their respective definitions.
- Universal margin for elements can be changed globally by changing the value of the
--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 for elements can be changed globally by changing the value of the
--universal-border-radius
variable.
Donut spinners
mini.css provides you with animated loading indicators (.spinner
), which you can use to indicate that some content is loading.
Example
Sample code
<div class="spinner"></div>
Modifiers
Color variants
You can create primary, secondary or tertiary (.primary
, .secondary
, .tertiary
) donut spinners, simply by adding the appropriate color modifier.
Example
Sample code
<div class="spinner primary"></div> <div class="spinner secondary"></div> <div class="spinner tertiary"></div>
Best practices
<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.
Notes
- You can use either a
<div>
or a<span>
element to create a donut spinner. - You can add the
role="progressbar"
attribute to spinner donut elements to increase accessibility. - You can inline donut spinners inside a paragraph or some other textual content.
Customization
- Foreground color for donut spinners can be changed by changing the value of the
--spinner-fore-color
variable. - Background color for donut spinners can be changed by changing the value of the
--spinner-back-color
variable. - You can customize the colors of different color variants by changing the values of the related variables in their respective definitions.
- Universal margin for elements can be changed globally by changing the value of the
--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.
Icons
Powered by Feathermini.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.
Example
.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
Sample code
<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>
Modifiers
Color variants
You can create secondary or inverse (.secondary
, .inverse
) icons, simply by adding the appropriate color modifier.
Example
This is a secondary icon, which has a lighter color.
This is an inverse icon.
Sample code
<span class="icon-alert secondary"></span> <span class="icon-alert inverse"></span>
Best practices
<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.
Notes
- You can only use a
<span>
element to create an icon. - You can inline icons inside a paragraph or pretty much any other textual content. Icons scale relative to their parent element.
Customization
- Universal margin for elements can be changed globally by changing the value of the
--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.
Visibility helpers
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).
Sample code
<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>
Best practices
<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.
Notes
- Visibility helpers use
!important
declarations to override any other styles, so exercise caution when using them. - The specific breakpoints for small, medium and large screen sizes are as follows:
- small: less than
768px
wide - medium: more than or equal to
768px
wide and less than1280px
wide - large:
1280px
wide or more
- small: less than
- Responsive visibility helper classes are independent, meaning that hiding or visually hiding an element in one screen size will not affect its visibility in any other screen size.
Element decorators
You can apply generic borders, shadows or border radiuses to any element, by using the appropriate class (.bordered
, .shadowed
, .rounded
or .circular
).
Example
Sample code
<span class="bordered">Bordered element.</span> <span class="shadowed">Shadowed element.</span> <span class="rounded">Rounded element.</span> <span class="circular">Circular element.</span>
Best practices
<span class="rounded circular">Do not do this.</span>
Don't: Avoid applying the .rounded
and .circular
decorators on the same element.
Notes
- Element decorators use
!important
declarations to override any other styles, so exercise caution when using them. - Element decorators can be used with pretty much every element or component that is available.
Customization
- Boder color for the generic border decorator can be changed by changing the value of the
--generic-border-color
variable. - Box shadow style for the generic shadow can be changed by changing the value of the
--generic-box-shadow
variable.
Responsive spacing & sizing
You can make elements' spacing or sizing responsive by applying the appropriate class (.responsive-margin
or .responsive-padding
).
Sample code
<span class="responsive-margin">Responsive margin.</span> <span class="responsive-padding">Responsive padding.</span>
Notes
- Responsive spacing and sizing modifiers use
!important
declarations to override any other styles, so exercise caution when using them. - Responsive spacing and sizing modifiers are independent, meaning that hiding or visually hiding an element in one screen size will not affect its visibility in any other screen size.
Customization
- Universal margin for elements can be changed globally by changing the value of the
--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 for elements can be changed globally by changing the value of the
--universal-padding
variable, affecting the responsive sizing modifier.