diff --git a/docs/doc-fragments/cards.js b/docs/doc-fragments/cards.js index 6706044..a375eef 100644 --- a/docs/doc-fragments/cards.js +++ b/docs/doc-fragments/cards.js @@ -1,28 +1,88 @@ module.exports = { id: 'cards', title: 'Cards', - keywords: [], - description: '', - example: '', - samples: [], - notes: [], - customization: [], - modifiers: [], - dos: [], - donts: [] + keywords: [`card`, `row`, `section`, `container`, `col`, `column`], + description: `

mini.css provides you with cards, 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 the 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.

+
`, + samples: [`
<div class="row">
+  <div class="card"></div>
+  <div class="card"></div>
+</div>
`], + 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 caards can be changed by changing the value of the --card-border-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 border radius for elements can be changed globally by changing the value of the --universal-border-radius variable.` + ], + modifiers: [ + { + title : 'Alternative sizes', + description: `

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.

+
`, + samples: [`
<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>
`] + }, + { + title : 'Color variants', + description: `

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.

+
`, + samples: [`
<div class="row">
+  <div class="card warning"></div>
+  <div class="card error"></div>
+</div>
`] + } + ], + dos: [ + { + description: `You can create rows inside a card, which can in turn contain other cards.`, + sample: `
<div class="card">
+  <div class="row">
+    <div class="card"></div>
+  </div>
+</div>
` + } + ], + donts: [ + { + description: `An element cannot be a card and a row or column at the same time.`, + sample: `
<div class="card row"></div>
+<div class="card col-sm"></div>
` + }, + { + description: `Never forget to wrap your cards inside a row and your fluid cards inside a row and a column.`, + sample: `
<div>
+  <div class="card"></div>
+</div>
` + }, + { + description: `Try not to combine fixed-width and fluid cards. Instead, combine fixed-width cards with columns and place fluid cards inside them.`, + sample: `
<div class="row">
+  <div class="card"></div>
+  <div class="card fluid"></div>
+</div>
` + }, + { + description: `Avoid applying two color modifiers on the same card.`, + sample: `
<div class="card warning error"></div>
` + } + ] } - -/* - Modifiers: - { - title : '', - description: '', - example: '', - samples: [] - } - Dos/Donts: - { - description: '', - sample: '' - } -*/ diff --git a/docs/v3/DEVLOG.md b/docs/v3/DEVLOG.md index 79de940..ee65db4 100644 --- a/docs/v3/DEVLOG.md +++ b/docs/v3/DEVLOG.md @@ -171,3 +171,7 @@ - Improved the build script to actually render the `modifiers` section, it should be complete now, I think. - Documented `grid`. The whole old module has been merged into one long card with all the information readily available. Hopefully it's less complicated now. - Changed the color of `main` in the documentation to help the cards pop out a little bit more. + +## 20171117 + +- Documented `card` and `card section` to complete the `layout` module's docs. diff --git a/docs/v3/docs.html b/docs/v3/docs.html index 13bc897..784b880 100644 --- a/docs/v3/docs.html +++ b/docs/v3/docs.html @@ -297,13 +297,48 @@

Customization


Cards

-
- - - - - - +

mini.css provides you with cards, 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 the 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

+

Customization


Card sections