0.3.0 • Published 9 years ago

tree-media v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

Media

The Media object module is implementation of Nicole Sullivan’s media object—the poster child of OOCSS.

To find out where it all started, read Nicole’s blog post.

Dependencies

The media object depends on three other modules:

If you install the media object using Bower or npm, you will get these dependencies at the same time. If not using Bower or npm, please be sure to install and @import these dependencies in the relevant way.

Instalation

You can install the media module via Bower, npm, or copy and paste.

Install using Bower:

$ bower install tree-media --save

Install using npm:

$ npm install tree-media --save

Once installed, @import into your project in its Objects layer:

@import "bower_components/tree-media/object.media";

Install via file download

The least recommended option for installation is to simply download _object.media.scss into your project and @import it into your project in its Objects layer.

Usage

Basic usage of the media object uses the required classes:

<div class="o-media">
    <img class="o-media__img" src="/path/to/image.png" alt="" />
    <div class="o-media__body">
        <p>Text-like content goes here.<p>
    </div>
</div>

The only valid children of the .o-media node are .o-media__img and .o-media__body.

Options

Other, optional classes can supplement the required base classes:

  • .o-media--flush: remove the space between the image- and text-content.
  • .o-media--[tiny|small|large|huge]: alter the spacing between the image- and text-content.
  • o-.media--rev: reverse the horizontal rendered order of the image- and text-content.
  • .o-media--responsive: a very basic responsive implementation of the media object. Pragmatic; far from perfect.

For example:

<div class="o-media  o-media--flush  o-media--rev">
    <img class="o-media__img" src="/path/to/image.png" alt="" />
    <div class="o-media__body">
        <p>Text-like content goes here.</p>
    </div>
</div>

Credits

  • inuitcss Powerful, Sass-based, OOCSS framework designed with scalability and performance in mind.