Skip to content

Card Module ​

The Card module provides a flexible container with sections, overlays, and decorators. It supports colors, gaps, sizes, and state modifiers such as loading and overlay.

Header
Default Card
lorem...
lorem...

This is an overlay

Signature:

scss
@mixin use-card($colors: (), $gaps: ());

Example:

scss
@include termeh.use-card(("primary", "danger"), ("macro", "small"));

Module:

This module is registered as card in the presented modules.

Dependencies

Card module uses the following Termeh global var():

ComponentTypeUsageDefault
base → colorColorFallback background and overlaywhite
base → foregroundColorFallback foreground and overlay spinner colorblack
base → sectionColorSecondary section backgroundnull
base → separatorColorSeparator backgroundnull
box → backgroundColorCard background and overlay fallback backgroundFALLBACK
box → foregroundColorCard foreground and overlay fallback spinner colorFALLBACK
box → shadowListDefault box shadownull
box → sizesListDefault box sizes()
gap → macroNumberDefault card padding and bottom margin1.6em
radius → normalNumberDefault border-radiusnull
decorator → sizeNumberLoading spinner thickness2px
decorator → spinnerNumberLoading spinner size2em
overlay → backgroundColorOverlay background colorFALLBACK
overlay → fouregroundColorOverlay foregroundFALLBACK
overlay → opacityNumberOverlay background opacity0.85
overlay → filterStringOverlay backdrop filternull

Card module uses the following Termeh color() and variant():

Color / VariantUsageDefault
shadeDefault decorator colorerror
primaryDefault scrollbar accent colorerror

Modifiers Classes ​

  • .is-loading → adds a loading state
  • .is-overlaid → displays an overlay element
  • .is-top-decorated → adds a top border decoration
  • .is-bottom-decorated → adds a bottom border decoration
  • .is-<gap>-gap → applies a predefined spacing value
  • .is-<color> → applies a predefined accent color
  • .is-<size> → applies a predefined box size (default card width)

Child Elements ​

  • .separator → horizontal divider line
  • .section → content block inside a card
  • .overlay → overlay container, shown when the card has .is-overlaid; must be placed as the last child of the card

Section Modifiers ​

  • .is-header → header section, fixed to the top with adjusted margin
  • .is-footer → footer section, fixed to the bottom with adjusted margin
  • .is-secondary → applies section background styling
  • .top-sticky → sticks the section to the top of the card
  • .bottom-sticky → sticks the section to the bottom of the card

Separator Modifiers ​

  • .is-attached → full-width divider with no margin