Introduction Modules Flavors Templates Customization Quick Reference  Github

Contextual

The contextual module provides you with simple tags, marks and highlights for your pages, allowing you to easily emphasize parts of your text. The contextual alerts aim to replace the commonly used modal dialog design paradigm with a more modern one. HTML5 elements and simple rules are used in order to make important messages and pieces of content stand out easily.

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

Almost every piece of content present on the web has some sort of content that needs highlighting in one way or another. The contextual module provides you with simple semantic text highlighting that utilises the <mark> HTML element. Apart from that, this module contains styles and definitions for a simple .alert container, that you can use to show alerts on your websites and web apps. Alerts replace the traditional design paradigms of modals, messages and alerts by defining a simple, usable container that is also mobile friendly. Finally, a simple accessible .tooltip implementation is included. All components in this module are fully accessible, so that's another thing not to worry about.


Quick start

To customize the contextual 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).


Text highlighting

The contextual module's styling of <mark> elements is highly customizable.


Variables
VariableTypeDescriptionSample value
$mark-back-colorColor Background color for <mark> elements#0277bd
$mark-fore-colorColor Text color for <mark> elements#fafafa
$mark-font-sizeFont size Font size for <mark> elements95%
$mark-line-heightLine height Line height for <mark> elements1
$mark-border-styleBorder Border style for <mark> elements1px solid #0277bd
$mark-border-radiusBorder radius Border radius for <mark> elements2px
$mark-paddingPadding Padding for <mark> elements2px 4px
$mark-marginMargin Margin for <mark> elements2px
$mark-box-shadowBox shadow Box shadow for <mark> elements0 1px 3px rgba(0,0,0, 0.1)
$mark-inline-block-nameString Class name for inline block <mark> elements'inline-block'

Alerts

The contextual module's contains custom classes and styles for defining alerts.


Variables
VariableTypeDescriptionSample value
$alert-nameString Class name for alert components'alert'
$alert-back-colorColor Background color for alert components#eeeeee
$alert-fore-colorColor Text color for alert components$fore-color
$alert-border-styleBorder Border style for alert components1px solid #bdbdbd
$alert-border-radiusBorder radius Border radius for alert components2px
$alert-paddingPadding Padding for alert components12px 16px
$alert-marginMargin Margin for alert components6px
$alert-box-shadowBox shadow Box shadow for alert components0 1px 3px rgba(0,0,0, 0.1)
$alert-include-animatedLogical Enables animated alert components1true
$alert-animated-classString Class name for animated alert components1'animated'

Notes:

  1. The value of $alert-animated-class will only be used if $alert-include-animated is set to true.

Tooltips

The contextual module's contains a flag to enable or disable tooltips, custom classes for creating them and other variables for style customization.


Variables
VariableTypeDescriptionSample value
$include-tooltipLogical Enables tooltip components1true
$tooltip-nameString Class name for tooltip components1'tooltip'
$tooltip-back-colorColor Background color for tooltip components1$fore-color
$tooltip-fore-colorColor Text color for tooltip components1#fafafa
$tooltip-border-radiusBorder radius Border radius for tooltip components12px
$tooltip-paddingPadding Padding for tooltip components112px 16px
$tooltip-tail-sizePosition left Left position for tooltip components's tail (calculated from value)16px
$tooltip-box-shadowBox shadow Box shadow for tooltip components10 1px 3px rgba(0,0,0, 0.1)
$tooltip-bottom-nameString Class name for animated tooltip components1'bottom'

Notes:

  1. The values used in the tooltip components will only be used if $include-tooltip is set to true.

Text highlighting mixins

The contextual module contains a couple of mixins for adding custom styles to <mark> elements (color and style variants).


Mixin definitions
MixinDescription
make-mark-alt-color ($mark-alt-name, $mark-alt-back-color, $mark-alt-fore-color) Creates a new <mark> color variant using the specified values.
make-mark-alt-style ($mark-alt-name, $mark-alt-border-style, $mark-alt-border-radius, $mark-alt-padding, $mark-alt-font-size, $mark-alt-line-height, $mark-alt-box-shadow) Creates a new <mark> style variant using the specified values.

make-mark-alt-color
ParameterTypeDescriptionSample value
$mark-alt-nameString Class name for the <mark> color variant'secondary'
$mark-alt-back-colorColor Background color for the <mark> color variant#e53935
$mark-alt-fore-colorColor (Optional) Text color for the <mark> color variant#fafafa

Sample usage

@include make-mark-alt-color ('secondary', #e53935, #fafafa);

make-mark-alt-style
ParameterTypeDescriptionSample value
$mark-alt-nameString Class name for the <mark> style variant'tag'
$mark-alt-border-styleBorder Border style for the <mark> style variant1px solid #0277bd
$mark-alt-border-radiusBorder radius Border radius for the <mark> style variant200px
$mark-alt-paddingPadding Padding for the <mark> style variant4px 8px
$mark-alt-font-sizeFont size Font size for the <mark> style variant95%
$mark-alt-line-heightLine height Line height for the <mark> style variant1
$mark-alt-box-shadowMargin Box shadow for the <mark> style variant0 1px 3px rgba(0,0,0, 0.1)

Sample usage

@include make-mark-alt-style ('tag', 1px solid #0277bd, 200px, 4px 8px, 95%, 1, 0 1px 3px rgba(0,0,0, 0.1));

Alert mixins

The contextual module contains a couple of mixins for adding custom styles to alerts (color and style variants).


Mixin definitions
MixinDescription
make-alert-alt-color ($alert-alt-name, $alert-alt-back-color, $alert-alt-fore-color) Creates a new alert color variant using the specified values.
make-alert-alt-style ($alert-alt-name, $alert-alt-border-style, $alert-alt-border-radius, $alert-alt-padding, $alert-alt-margin, $alert-alt-box-shadow) Creates a new alert style variant using the specified values.

make-alert-alt-color
ParameterTypeDescriptionSample value
$alert-alt-nameString Class name for the alert color variant'urgent'
$alert-alt-back-colorColor Background color for the alert color variant#ffca28
$alert-alt-fore-colorColor (Optional) Text color for the alert color variant#212121

Sample usage

@include make-alert-alt-color ('urgent', #ffca28, #212121);

make-alert-alt-style
ParameterTypeDescriptionSample value
$alert-alt-nameString Class name for the alert style variant'urgent'
$alert-alt-border-styleBorder Border style for the alert style variant1px solid #ff8f00
$alert-alt-border-radiusBorder radius Border radius for the alert style variant2px
$alert-alt-paddingPadding Padding for the alert style variant12px 16px
$alert-alt-marginMargin Margin for the alert style variant6px
$alert-alt-box-shadowMargin Box shadow for the alert style variant0 1px 3px rgba(0,0,0, 0.1)

Sample usage

@include make-alert-alt-style ('urgent', 1px solid #ff8f00, 2px, 12px 16px, 6px, 6px, 0 1px 3px rgba(0,0,0, 0.1));

Tooltip mixins

The contextual module contains a couple of mixins for adding custom styles to tooltips (color and style variants).


Mixin definitions
MixinDescription
make-tooltip-alt-color ($tooltip-alt-name, $tooltip-alt-back-color, $tooltip-alt-fore-color) Creates a new tooltip color variant using the specified values.
make-tooltip-alt-style ($tooltip-alt-name, $tooltip-alt-tail-size, $tooltip-alt-border-radius, $tooltip-alt-padding, $tooltip-alt-box-shadow) Creates a new tooltip style variant using the specified values.

make-tooltip-alt-color
ParameterTypeDescriptionSample value
$tooltip-alt-nameString Class name for the tooltip color variant'primary'
$tooltip-alt-back-colorColor Background color for the tooltip color variant#0277bd
$tooltip-alt-fore-colorColor (Optional) Text color for the tooltip color variant#fafafa

Sample usage

@include make-tooltip-alt-color ('primary', #0277bd, #fafafa);

make-tooltip-alt-style
ParameterTypeDescriptionSample value
$tooltip-alt-nameString Class name for the tooltip style variant'large'
$tooltip-alt-tail-sizePosition left Left position for tooltip style variant's tail (calculated from value)8px
$tooltip-alt-border-radiusBorder radius Border radius for the tooltip style variant4px
$tooltip-alt-paddingPadding Padding for the tooltip style variant15px 20px
$tooltip-alt-box-shadowMargin Box shadow for the tooltip style variant0 1px 3px rgba(0,0,0, 0.1)

Sample usage

@include make-tooltip-alt-style ('large', 8px, 4px, 15px 20px, 0 1px 3px rgba(0,0,0, 0.1));

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.