Media object is responsible for a common design pattern where there is a fixed and a fluid width column next to each other. It's used to build the structure of sidebars, comments, avatar and other similar UI components.
Installation
npm install --save-dev iotacss-objs-media
Dependencies
Settings.Core
Tools.Core
Settings
Media object uses table or flex display options. It provides you alignment modifiers, responsive gutters and the ability to collapse on specific breakpoint. Below you can see all of the available settings that are related to media object with their default values. You can overwrite them or not change them at all. You should also add all these settings inside your object file and not inside global settings folder.
Name
Type
Default
Description
$iota-objs-media-aligned
Boolean
false
Enable / Disable aligment modifiers. .o-media--middle Align columns at middle vertically .o-media--bottom Align columns at bottom vertically.
$iota-objs-media-rev
Boolean
false
Enable / Disable reversed modifier .o-media--rev Reverse columns order
$iota-objs-media-gutter-default
Number / Map
$iota-global-gutter-default
Default gutter size. Use a number for a single size or a map for a responsive size.
$iota-objs-media-gutter-extra
Map / Nested Map
()
Extra gutters map. Each gutter size will be available as a modifier that will be named according to the gutter name. Use a map for a single size or a nested map for a responsive size. E.g. If $iota-objs-media-gutter-extra: ('compact': '10px'); then .o-media--compact will be available for use.
$iota-objs-media-flex
Boolean
$iota-global-flex
Enable / Disable flexbox
$iota-objs-media-res
Boolean
false
Enable / Disable responsive modifier. .o-media--res Collapse fluid section bellow fixed one, at a specific max-width breakpoint.
Media Object that collapses under 767px width breakpoints
It creates a media object that will automatically collapse in two rows when a max-width of 767px presents.
1
2
3
4
$iota-objs-media-collapses-at:767px;// This is not needed since 767px is the default value
$iota-objs-media-res:true;@import'node_modules/iotacss-objs-media/οbjects.media'
<divclass="o-media o-media--rev"><divclass="o-media__fixed">
Fixed width column on the right
</div><divclass="o-media__fluid">
Fluid width column on the left
</div></div>