Origami Frontend Components & Services

Readme: o-promobox

o-promobox has a support status of "dead". This means that there are no plans to fix any issues with this component, and it may stop working at any point. More information on the status of this component is available in the README. If you still rely on this component or have concerns, please contact the Origami team.

This module has been deprecated


Styling for promoboxes


Markup

Add the o-promobox class to the element you wish to apply the styling. Typically a promobox will contain an image o-promobox__image, some paragraph, <p>, tags and a title o-promobox__title.

<div class="o-promobox">
    <h3 class="o-promobox__title">My Promobox</h3>
    <img class="o-promobox__image" src="//my-image.png" alt="" />
    <p>My paragraph</p>
</div>

Note: it is up to the product developer to decide how to 'flow' other content around the promobox. They might choose to float: left; the promobox or display: inline it - or the product developer may decide to display it full width.

Themes

Standard theme

<div class="o-promobox o-promobox--standard">
    <h3 class="o-promobox__title">My Promobox</h3>
    <img class="o-promobox__image" src="//my-image.png" alt="" />
    <p>My paragraph</p>
</div>

Your own theme

You can create your own modifiers, for example: .o-promobox--my-theme.

<div class="o-promobox o-promobox--my-theme">
    <h3 class="o-promobox__title">My Promobox</h3>
    <img class="o-promobox__image" src="//my-image.png" alt="" />
    <p>My paragraph</p>
</div>
.o-promobox--my-theme {
    font-family: oFontsGetFontFamilyWithFallbacks(MillerDisplay);
    color: #ffffff;
    background-color: oColorsGetPaletteColor(claret);

    .o-promobox__title {
        font-size: 14px;
        line-height: 18px;
        border-bottom: 1px solid currentColor;
    }
    p {
        font-size: 12px;
        line-height: 16px;
    }
}

Responsive

The module comes in two layouts. The default, full-width layout, recommended for smaller screens, and a thinner 'skinny' layout currently fixed to 167 pixels (for legacy reasons).

To enable responsivity, follow the example below:-

On a specific element

<div class="o-promobox o-promobox--custom-responsivity">
    <h3 class="o-promobox__title">My Promobox</h3>
    <img class="o-promobox__image" src="//my-image.png" alt="" />
    <p>My paragraph</p>
</div>
@o-promobox-is-silent: false;
@import 'o-promobox/main';

@media (min-width: 300px) {
    .o-promobox--custom-responsivity {
        @include oPromobox($skinny: true);

        .o-promobox__image {
            @include oPromoboxImage($fullwidth: true);
        }
    }
}

Context-based

<div class="my-sidebar">
    <div class="o-promobox">
        <h3 class="o-promobox__title">My Promobox</h3>
        <img class="o-promobox__image" src="//my-image.png" alt="" />
        <p>My paragraph</p>
    </div>
</div>
@o-promobox-is-silent: false;
@import 'o-promobox/main';

@media (min-width: 300px) {
    .my-sidebar {
        .o-promobox {
            @include oPromobox($skinny: true);
        }
        .o-promobox__image {
            @include oPromoboxImage($fullwidth: true);
        }
    }
}

License

Copyright (c) 2016 Financial Times Ltd. All rights reserved.

This software is published under the MIT licence.

Status
dead Origami v1 (Bower)
Switch component view

GitHub: o-promobox

Install o-promobox

If using the Build Service, add o-promobox@^1.3.9 to your link tag.

If using the npm package manager for a Manual Build, run npm install --save-peer "@financial-times/o-promobox@^1.3.9".

Help & Support

o-promobox is maintained directly by the Origami team. If you have any questions about o-promobox or Origami in general, we are happy to help. 😊

Slack: #ft-origami
Email: origami.support@ft.com

Feedback / Issues

To report a bug or request features please create an issue on Github. For support or general feedback please get in touch 😊

Slack: #ft-origami
Email: origami.support@ft.com