Introduction Modules Flavors Templates Customization Quick Reference  Github

Card

The card module provides you with modern, responsive, general-purpose containers for your page's contents. They are very easy to use and their structure is really simple and versatile. Layouts will respond to smaller screens, realigning the cards in a manner that makes your page mobile-friendly.

All examples showcased refer to the mini-default flavor, some class names and styles might differ based on the flavor you're using.


Quick overview

The main content of a website or web app needs to be easy to access and well organized no matter the nature of the content itself. The card module seeks to help deal with this problem, by utilizing the Flexbox Layout in order to provide general-purpose containers that help you present the information you want in the best possible way. Cards are designed in a very modern way, self-aligning and structuring their content based on your needs, while also being fully responsive to changes and compatible with the versatile grid module to deliver the best experience on any device.


Quick start

To customize the card module, duplicate an existing flavor file (we suggest you use the mini-default.scss flavor file) and use this page's variable tables and mixins as a reference to change only the values you need. Remember to compile your flavor file (not the module's partial file) using a Sass preprocessor (we highly recommend using sass-autocompile if you are working with Atom).


Cards & sections

The card module's card system uses a few custom classes to create cards and sections, along with a variety of variables to customize their look and feel.


Variables
VariableTypeDescriptionSample value
$card-nameString Class name for card components'card'
$card-back-colorColor Background color for card components#fafafa
$card-fore-colorColor Text color for card components$fore-color
$card-border-styleBorder Border style for card components1px solid #9e9e9e
$card-border-radiusBorder radius Border radius for card components2px
$card-marginMargin Margin for card components16px
$card-box-shadowBox shadow Box shadow for card components0 1px 3px rgba(0,0,0, 0.1)
$card-normal-widthWidth Width for card components320px
$card-section-nameString Class name for card components' sections'section'
$card-section-border-styleBorder Border style for card components' sections1px solid #bdbdbd
$card-section-paddingPadding Padding for card components' sections6px
$card-section-media-nameString Class name for card components' media sections'media'
$card-section-media-heightHeight Height for card components' media sections200px

Card mixins

The card module contains a couple of mixins for customizing card styles, along with two more for creating custom section styles.


Card mixin definitions
MixinDescription
make-card-alt-color ($card-alt-name, $card-alt-back-color, $card-alt-fore-color, $card-alt-border-style, $card-alt-border-radius, $card-alt-section-border-style) Creates a new card color variant using the specified values.
make-card-alt-size ($card-alt-size-name, $card-alt-size-width) Creates a new card size variant using the specified values.

make-card-alt-color
ParameterTypeDescriptionSample value
$card-alt-nameString Class name for the card color variant'inverse'
$card-alt-back-colorColor Background color for the card color variant#212121
$card-alt-fore-colorColor Text color for the card color variant#fafafa
$card-alt-border-styleBorder (Optional) Border style for the card color variant1px solid #424242
$card-alt-border-radiusBorder radius (Optional) Border radius for the card color variant2px
$card-alt-section-border-styleBorder (Optional) Border style for the card color variant's section borders1px solid #616161

Sample usage

@include make-card-alt-color ('inverse', #212121, #fafafa, 1px solid #424242, 2px 1px solid #616161);

make-card-alt-size
ParameterTypeDescriptionSample value
$card-alt-size-nameString Class name for the card size variant'large'
$card-alt-size-widthWidth Width for the card size variant480px

Sample usage

@include make-card-alt-size ('large', 480px);

Card section mixin definitions
MixinDescription
make-card-section-alt-color ($card-section-alt-name, $card-section-alt-back-color, $card-section-alt-fore-color, $card-section-alt-border-style) Creates a new card section color variant using the specified values.
make-card-section-alt-style ($card-section-alt-name, $card-section-alt-padding) Creates a new card section style variant using the specified values.

make-card-section-alt-color
ParameterTypeDescriptionSample value
$card-section-alt-nameString Class name for the card section color variant'dark'
$card-section-alt-back-colorColor Background color for the card section color variant#e0e0e0
$card-section-alt-fore-colorColor Text color for the card section color variant#212121
$card-section-alt-border-styleBorder (Optional) Border style for the card section color variant1px solid #bdbdbd

Sample usage

@include make-card-section-alt-color ('dark', #e0e0e0, #212121, 1px solid #bdbdbd);

make-card-section-alt-style
ParameterTypeDescriptionSample value
$card-section-alt-nameString Class name for the card section style variant'double-padded'
$card-section-alt-paddingPadding Padding for the card section style variant10px

Sample usage

@include make-card-section-alt-style ('double-padded', 10px);

If you want to learn more about customizing mini.css, go back to the customization page or choose a module from the top menu to see its documentation.