Intelligent CSS Components

Evolutionary

eBay's cohesive multi-screen experience starts with a shared and unified design system. As this system evolves, so too does Skin, meaning apps only need to keep their Skin package updated to ensure the latest look and feel.

Adaptive

Screens 7" and below are considered to be small screens; they are our default, baseline experience. Screens over 7" are large screens. Skin provides support for large screens in an adaptive manner.

Accessible

Skin leverages semantic HTML, SVG, ARIA roles, states and properties to apply our styles wherever possible, thus enforcing correct, accessible semantics.

Readable

Skin follows the BEM principles of Block, Element and Modifier to ensure our class name and class structure is human readable and understandable.

Decoupled

Skin is decoupled from the JavaScript layer, meaning that HTML and CSS should not need to be reimplemented every time the JS frontend framework changes.

Open

Skin operates under an open source model. If you wish to contribute, raise an issue, or ask a question, head over to GitHub for more information.

Install

Skin is distributed as a package on the eBay NPM repository.

The package can be installed to the node_modules folder of your working directory using the npm install command:

npm install skin-ebay
    

Or alternatively by adding the package as a dependency in a package.json file:

{
    "dependencies": {
      "skin-ebay": "~2.9"
    }
}
    

WARNING: Unlike standard semantic versioning rules, Skin introduces incompatible API changes in MINOR versions. We recommend you pin your package dependency to the PATCH version, using the tilde range operator, in order to ensure new functionality & bug fixes in a backwards-compatible manner.

Lasso

Skin is optimised for use with Lasso.

Include the skin-ebay package in your browser.json to include the entire set of Skin modules:

{
    "dependencies": [
        "skin-ebay"
    ]
}
    

Or alternatively by specifying modules on a per-need basis:

{
    "dependencies": [
        "skin-ebay/core",
        "skin-ebay/button",
        "skin-ebay/iconfont",
        "skin-ebay/grid",
        "skin-ebay/less"
    ]
}
    

Skin provides the following modules:

  • skin-ebay/alert
  • skin-ebay/button
  • skin-ebay/card
  • skin-ebay/checkbox
  • skin-ebay/combo
  • skin-ebay/core
  • skin-ebay/dialog
  • skin-ebay/field
  • skin-ebay/form
  • skin-ebay/global
  • skin-ebay/grid
  • skin-ebay/iconbutton
  • skin-ebay/iconfont
  • skin-ebay/icon
  • skin-ebay/less*
  • skin-ebay/listbox
  • skin-ebay/marketsans
  • skin-ebay/menu
  • skin-ebay/normalize
  • skin-ebay/pagination
  • skin-ebay/radio
  • skin-ebay/spinner
  • skin-ebay/switch
  • skin-ebay/tab
  • skin-ebay/textbox
  • skin-ebay/tile
  • skin-ebay/utility

* The skin-ebay/less module requires the additional lasso-less plugin in your app package.json dependencies.

Bundles

Bundles are special Lasso modules that bundle together a collection of related components.

Core

The skin-ebay/core module bundles together Skin's core dependencies.

  • skin-ebay/normalize
  • skin-ebay/global
  • skin-ebay/utility

Combo

The skin-ebay/combo module bundles together Skin's most common modules, as identified across key eBay experiences.

  • skin-ebay/core
  • skin-ebay/dialog
  • skin-ebay/form
  • skin-ebay/iconfont
  • skin-ebay/spinner

Note: The combo bundle itself contains two other bundles. Lasso will take care of de-duping modules where necessary.

Form

The skin-ebay/form module bundles together all form controls.

  • skin-ebay/button
  • skin-ebay/checkbox
  • skin-ebay/field
  • skin-ebay/iconbutton
  • skin-ebay/listbox
  • skin-ebay/radio
  • skin-ebay/switch
  • skin-ebay/textbox

CDN Bundle

A single bundle, containing the full collection of modules and adaptors (see next section), is also available via CDN:

http://ir.ebaystatic.com/cr/v/c1/skin/v2.9.0/css/skin.min.css

Adapters

Skin takes advantage of conditional dependencies to provide adaptive css for every module bundled with Lasso.

NOTE: Skin itself does not do any detection of browser size or capabilities, therefore it is the responsibility of the application logic (typically via device detection service) to detect which adapters are needed.

Skin-Large

Skin is built for small screens first (7" and below). Styles for larger screens (i.e. desktop) are not supplied by default.

To meet the conditional dependency for large screen styles, pass the skin-large Lasso flag. Then apply the skin-large class to the body (or any containing element) of your page.

SVG

Skin is in the midst of a transition from a font-based icon system to an SVG-based icon system. The source code for each SVG is listed below.

Use the svg-icon class on your <svg> tag to create an icon sized version of the graphic.

TIP: Marko components of SVG icons are also available via the ebayui-image project.

Arrows

<symbol id="svg-icon-arrow-up" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-arrow-down" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
    

Chevrons

<symbol id="svg-icon-chevron-up" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-chevron-down" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-chevron-left" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-chevron-right" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
    

Light Chevrons

<symbol id="svg-icon-chevron-light-left" viewBox="0 0 24 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-chevron-light-right" viewBox="0 0 24 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
    

Status

<symbol id="svg-icon-confirmation" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-information" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-priority" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
    

User Interface

<symbol id="svg-icon-cart" viewBox="0 0 40 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-close" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-menu" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-notifications" viewBox="0 0 40 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-search" viewBox="0 0 40 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-settings" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-trash" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
<symbol id="svg-icon-window" viewBox="0 0 32 32">
    <path d="M15.94 25.294l-15.473-17.229h30.953l-7.742 8.616z"></path>
</symbol>
    

If you need the SVG source for an icon not shown above, please let us know, or submit a pull request.

Icon Font

Skin provides it's own custom icon font via the skin-ebay/iconfont module.

This module alone only downloads and installs the icon font-face from the eBay CDN. The individual icons within the font must be leveraged via classes provided by the Icon module or via mixins provided by the Less module.

NOTE: Although icon fonts are supported across all modern browsers, they sometimes experience "weird failures". Please refer to CSS tricks, which summarizes failure scenarios and other issues. It is because of such issues that Skin is currently transitioning over to an SVG based icon system.

Market Sans

Market Sans is a new and exclusive typeface developed specifically for eBay. This module downloads and installs the typeface directly from the eBay CDN servers. The typeface can then be referenced via the 'Market Sans' font-family name.

ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
<style>
    p {
        font-family:  'Market Sans', 'Helvetica Neue', Helvetica, Arial, Roboto, sans-serif;
    }
</style>
    

TIP: The Market Sans font-family, and all fallbacks, can also be applied using the Less variable @font-family-market-sans.

Button

A button is typically used to trigger a custom JavaScript action (e.g. fetch new results, open a dialog or expand a menu).

A button may also be used to submit or reset a form (no JavaScript required).

Default Button

Use the btn class on a button element to create the default button.

<button class="btn" type="button">Button</button>
    

Faux Button

Use the btn class on an anchor element to create a link that looks like a button.

The href attribute must contain a valid destination URL. A value of "javascript" (or any such variant) is not a valid URL.

<a class="btn" href="http://www.ebay.com">Link</a>
    

TIP: in some cases, the link might be progressively enhanced (aka 'hijaxed') into a button, using JavaScript. It is in these cases, and only in these cases, that a role attribute with value of button should be applied to the anchor tag.

Primary Button

Use the btn--primary hierarchy modifier to create a primary button.

<button class="btn btn--primary" type="button">Primary</button>
    

Secondary Button

Use the btn--secondary hierarchy modifier to create a secondary button.

<button class="btn btn--secondary" type="button">Button</button>
    

Large Button

Use the btn--large size modifier to create a large button.

<button class="btn btn--large" type="button">Button</button>
    

Extra-Large Button

Use the btn--extra-large size modifier to create an extra large button.

<button class="btn btn--extra-large" type="button">Button</button>
    

Fluid Button

Use the btn--fluid modifier to fill the entire width of the parent element.

<button class="btn btn--fluid" type="button">Button</button>
    

Disabled Button

The disabled attribute is required to fully disable a button tag. Remove the href attribute to fully disable an anchor tag.

Link
<button class="btn" disabled type="button">Button</button>
<a class="btn"><span>Link</span></a>
    

Partially Disabled Button

Partially disabled buttons are visually and aurally identifiable as disabled, but remain keyboard focusable.

Partially disabled buttons can vastly simplify keyboard focus management logic in situations where the button may frequently toggle back and forth between enabled and disabled (e.g. pagination or carousel 'bookend' buttons).

The aria-disabled state is required for partially disabled buttons.

Next
<button aria-disabled="true" class="btn" type="button">Prev</button>
<a aria-disabled="true" class="btn" href="http://www.ebay.com">Next</a>
    

Text + Icon

Use any of the available font icons or SVG icons to display an icon alongside button text.

<button class="btn" type="button">
    <span aria-hidden="true" class="btn__icon icon icon--menu"></span>
    <span>Menu</span>
</button>
<a href="http://www.ebay.com" class="btn">
    <span aria-hidden="true" class="btn__icon icon icon--settings"></span>
    <span>Settings</span>
</a>
    

For SVG, replace the icon icon--* class with btn__icon.

<button class="btn" type="button">
    <span class="btn__cell">
        <svg aria-hidden="true" class="btn__icon" focusable="false">
            <use xlink:href="#svg-icon-menu"></use>
        </svg>
        <span>Menu</span>
    </span>
</button>
<a href="http://www.ebay.com" class="btn">
    <span class="btn__cell">
        <svg aria-hidden="true" class="btn__icon" focusable="false">
            <use xlink:href="#svg-icon-settings"></use>
        </svg>
        <span>Settings</span>
    </span>
</a>
    

TIP: Looking for borderless icon buttons? Head over to the Icon Button module.

Card

A card forms the content layer in the eBay Design System topography of background layer, content layer & content. This system requires that the background layer (typically the HTML body tag) have zero margin and padding. The card content layer is responsible for creating all necessary margin & padding.

There are three types of card: Regular Card, Primary Card & Full Page Card.

All cards use a nested card__cell element to denote the inner content of the card block. Any content placed outside of this cell will be full-bleed (i.e. edge to edge). See Hero Card section below for more information.

NOTE: in all card examples below we use a fixed-height div to simulate Skin's default grey background layer.

Regular Card

Use the card class to create a card with vertical and horizontal margins.

This 'floating' effect helps differentiate data sets and is used to identify secondary, tertiary & extraneous content.

Title

Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.

Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.

<div class="card">
    <div class="card__cell">
        <h2>Title</h2>
        <h3>Heading</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.</p>
        <h3>Heading</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.</p>
    </div>
</div>
    

Primary Card

Use the card--primary modifier to create a primary, full-width card.

Only one primary card should be deployed per page. It is used to identify primary content and spans the entire width of the background layer.

Title

Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.

Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.

<div class="card card--primary">
    <div class="card__cell">
        <h2>Title</h2>
        <h3>Heading</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.</p>
        <h3>Heading</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.</p>
    </div>
</div>
    

Full Page Card

Applying the card class directly to the body tag creates a full page card. Full page cards span the full width and height of the page.

Title

Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.

Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.

<body class="card">
    <div class="card__cell">
        <h1>Title</h1>
        <div>
            <h2>Heading</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.</p>
        </div>
        <div>
            <h2>Heading</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.</p>
        </div>
    </div>
</div>
    

Hero Card

For cards with large hero headers, apply the card--hero modifier. The hero element must immediately precede the card__cell element.

TIP: A CSS background image can also be used as the hero image.

Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.

Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.

<div class="card card--primary card--hero">
    <img alt="" class="responsive-image" src="http://i.ebayimg.com/00/s/OTI0WDE1MzY=/z/H4gAAOSwJQdXBsto/$_57.JPG?set_id=80000000000" />
    <div class="card__cell">
        <h2>Title</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.</p>
    </div>
</div>
<div class="card">
    <div class="card__cell">
        <h2>Title</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis molestie erat, ut adipiscing risus blandit vel. Vivamus luctus elementum lorem, eu sodales velit sagittis id. Donec a est ligula, eget volutpat augue.</p>
    </div>
</div>
    

Dialog Cards

Cards can also be used inside of any dialog.

<div role="dialog" class="dialog" id="dialog-card" aria-labelledby="dialog-card-title" hidden>
    <div class="dialog__window" role="document">
        <header class="dialog__header">
            <h2 class="dialog__title" id="dialog-card-title">Dialog with Cards</h2>
            <button class="dialog__close dialog__close--icon" aria-label="Close dialog" type="button"></button>
        </header>
        <div class="dialog__body">
            <div class="card card--primary">
                <div class="card__cell">
                    <!-- card content -->
                </div>
            </div>
            <div class="card">
                <div class="card__cell">
                    <!-- card content -->
            </div>
        </div>
    </div>
    <div class="dialog__mask"></div>
</div>
    

To create a full content layer inside of a dialog, apply the dialog--card modifier to the dialog block.

Checkbox

Checkboxes allow the user to select multiple options from a group of choices.

In order to create the correct grouping semantics, fieldset and legend tags are required for checkbox groups.

Vertical Checkboxes

Wrap each checkbox and label in a div to stack vertically.

Choose an Option
<div class="checkboxes">
    <fieldset>
        <legend>Choose an Option</legend>
        <div>
            <input id="choice1" type="checkbox" value="1" name="choices" />
            <label for="choice1">Option 1</label>
        </div>
        <div>
            <input id="choice2" type="checkbox" value="2" name="choices" />
            <label for="choice2">Option 2</label>
        </div>
        <div>
            <input id="choice3" type="checkbox" value="3" name="choices"/>
            <label for="choice3">Option 3</label>
        </div>
    </fieldset>
</div>
    

Horizontal Checkboxes

Wrap each checkbox and label inside of a span element to display horizontally.

Choose an Option
<div class="checkboxes">
    <fieldset>
        <legend>Choose an Option</legend>
        <span>
            <input id="choice1" type="checkbox" value="1" name="choices" />
            <label for="choice1">Option 1</label>
        </span>
        <span>
            <input id="choice2" type="checkbox" value="2" name="choices" />
            <label for="choice2">Option 2</label>
        </span>
        <span>
            <input id="choice3" type="checkbox" value="3" name="choices" />
            <label for="choice3">Option 3</label>
        </span>
    </fieldset>
</div>
    

Ungrouped Checkbox

For checkboxes not belonging to any group, use the checkbox base class. Fieldset and legend tags are omitted.

TIP: You may also wish to consider using a switch control for this use-case.

<div class="checkbox">
    <input id="choice" type="checkbox" value="1" name="solo" />
    <label for="choice">Option</label>
</div>
    

Flipped Checkbox

Use the checkboxes--flipped or checkbox--flipped modifier to flip the label and checkbox positions for grouped or ungrouped checkboxes respectively.

NOTE: the additional span element (inside the label) that is required for flipped checkboxes.

<div class="checkbox checkbox--flipped">
    <input id="choice" type="checkbox" value="1" name="flipped" />
    <label for="choice"><span>Option</span></label>
</div>
    

Disabled Checkbox

Use the disabled attribute to disable any checkbox input.

<div class="checkbox">
    <input id="choice" type="checkbox" value="1" name="disabled" disabled />
    <label for="choice">Option</label>
</div>
    

Dialog

A dialog is a child window spawned by the main web page or application.

This window forms a new background layer in our design system topography, and has zero margin and padding by default.

Content may be placed directly onto this background layer, inside of a dialog__cell element. Alternatively, a content layer can be created using the card module and/or grid module.

A dialog must remain in a hidden state for all users and devices until called upon.

All dialogs have support for optional CSS transition effects. See dialog transitions section for more details.

Lightbox Dialog

The default dialog is a lightbox.

The lightbox will be centered vertically and it's height will grow with it's content. To instead align the lightbox to the top of the screen, use the dialog__window--top modifier.

<div aria-labelledby="dialog-title" class="dialog" hidden role="dialog">
    <div class="dialog__window" role="document">
        <header class="dialog__header">
            <h2 class="dialog__title" id="dialog-title">Dialog Title</h2>
            <button aria-label="Close dialog" class="dialog__close" type="button">
                <svg aria-hidden="true" focusable="false">
                    <use xlink:href="#svg-icon-close"></use>
                </svg>
            </button>
        </header>
        <div class="dialog__body">
            <div class="dialog__cell">
                <h2>Heading</h2>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                <p><a href="http://www.ebay.com">www.ebay.com</a></p>
            </div>
        </div>
    </div>
    <div class="dialog__mask"></div>
</div>
    

Panel Dialog

Panel dialogs fill 80% of the available screen width.

Use the dialog__window--left or dialog__window--right modifier to create a panel on the left or right edge of the screen.

<div aria-labelledby="dialog-title" class="dialog" hidden role="dialog">
    <div class="dialog__window dialog__window--left" role="document">
        <header class="dialog__header">
            <button aria-label="Close dialog" class="dialog__close" type="button">
                <svg aria-hidden="true" focusable="false">
                    <use xlink:href="#svg-icon-close"></use>
                </svg>
            </button>
            <h2 class="dialog__title" id="dialog-title">Dialog Title</h2>
        </header>
        <div class="dialog__body">
            <div class="dialog__cell">
                <h2>Heading</h2>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                <p><a href="http://www.ebay.com">www.ebay.com</a></p>
            </div>
        </div>
    </div>
    <div class="dialog__mask"></div>
</div>
    

Fullscreen Dialog

Apply the dialog__window--full modifier to create a fullscreen dialog.

For a close button with text (e.g. "Cancel", "Done") use class dialog__close and apply inner text.

For a close button with default icon ('X'), use modifier class dialog__close--icon and apply aria-label.

<div aria-labelledby="dialog-title" class="dialog" hidden role="dialog">
    <div class="dialog__window dialog__window--full dialog__window--fade" role="document">
        <header class="dialog__header">
            <h2 class="dialog__title" id="dialog-title">Dialog Title</h2>
            <button aria-label="Close dialog" class="dialog__close" type="button">
                <svg aria-hidden="true" focusable="false">
                    <use xlink:href="#svg-icon-close"></use>
                </svg>
            </button>
        </header>
        <div class="dialog__body">
            <div class="dialog__cell">
                <h2>Heading</h2>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                <p><a href="http://www.ebay.com">www.ebay.com</a></p>
            </div>
        </div>
    </div>
</div>
    

Fullscreen Sub-Page

In the header, replace the close button with a back button to create a subpage dialog.

For a back button with text (e.g. "Back") use class dialog__back and apply inner text.

For a back button with default icon ("<") use modifier class dialog__back--icon and apply aria-label.

<header class="dialog__header">
    <button aria-label="Back" class="dialog__back" type="button">
        <svg aria-hidden="true" focusable="false">
            <use xlink:href="#svg-icon-chevron-light-left"></use>
        </svg>
    </button>
    <h2 class="dialog__title" id="subpage-title">Dialog Title</h2>
</header>
    

Fullscreen Multi-Step

In the header, use a back button and a close button to create a multi-step dialog.

<header class="dialog__header">
    <button aria-label="Back" class="dialog__back" type="button">
        <svg aria-hidden="true" focusable="false">
            <use xlink:href="#svg-icon-chevron-light-left"></use>
        </svg>
    </button>
    <h2 class="dialog__title" id="dialog-title">Dialog Title</h2>
    <button class="dialog__close" type="button">Done</button>
</header>
    

In the header, add a search form to create a search dialog.

<header class="dialog__header">
     <form class="dialog__search">
         <button aria-label="Search" type="submit">
             <svg aria-hidden="true" focusable="false">
                 <use xlink:href="#svg-icon-search"></use>
             </svg>
         </button>
         <input name="search" type="text" aria-label="Search" placeholder="search" autofocus />
     </form>
     <button aria-label="Close dialog" class="dialog__close" type="button">
         <svg aria-hidden="true" focusable="false">
             <use xlink:href="#svg-icon-close"></use>
         </svg>
     </button>
</header>
    

Dialog Transitions

Skin currently supports two types of dialog transition: fade and slide.

Because CSS cannot transition an element to and from hidden (i.e. "display:none"), we require two temporary classes - dialog--transition-in and dialog--transition-out - to help prime the CSS transition in and out respectively.

The commented jQuery sample below shows the required sequence of events.

$('#dialog-open').on('click', function() {
    // Add the transition-in state. The CSS transition wont be triggered yet.
    $('.dialog').addClass('dialog--transition-in');

    // Create a small, hardcoded delay for "breathing-room" (Chrome and Firefox seem to need this)
    setTimeout(function() {
        // Remove the "hidden" property. This will immediately trigger the CSS transition.
        $('.dialog').prop('hidden', false);

        // Cleanup the transition-in state.
        $('.dialog').removeClass('dialog--transition-in');
    }, 16);
});

$('#dialog-close').on('click', function(transitionOutDuration) {
    // Add the transition-out state. This will immediately trigger the transition out.
    $dialog.addClass('dialog--transition-out');

    // Listen for transitionend event
    $dialogWindow.one('transitionend', function() {
        // After the transition is done, we can safely add the "hidden" property.
        $('.dialog').prop('hidden', true);

        // Cleanup the transition-out state.
        $dialog.removeClass('dialog--transition-out');
    });
});
    

From the code sample, you should see that a CSS transition can be triggered using a combination of the hidden property, and the transient dialog--transition-in & dialog--transition-out helper modifiers.

Fade Transition

Any dialog window and mask can be faded in and out, using the dialog__window--fade and dialog__mask--fade modifiers.

The default fade duration is 16ms.

<div role="dialog" class="dialog" id="dialog" aria-labelledby="dialog-title" hidden>
    <div class="dialog__window dialog__window--fade" role="document">
        <header class="dialog__header">
            <!-- header -->
        </header>
        <div class="dialog__body">
            <!-- body -->
        </div>
    </div>
    <div class="dialog__mask dialog__mask--fade"></div>
</div>
    

Slide Transition

Any panel or fullscreen dialog can slide in and out, using the dialog__window--slide-left or dialog__window--slide-right modifier.

The slide transition duration is 32ms. An accompanying dialog__mask--fade-slow modifier can be applied to a dialog panel's mask. This slower fade matches the 32ms of the slide transition.

<div role="dialog" class="dialog" id="panel-left-slide" aria-labelledby="dialog-title" hidden>
    <div class="dialog__window dialog__window--left dialog__window--slide-right" role="document">
        <header class="dialog__header">
            <!-- header -->
        </header>
        <div class="dialog__body">
            <!-- body -->
        </div>
    </div>
    <div class="dialog__mask dialog__mask--fade-slow"></div>
</div>
    

Field BETA

The field module facilitates the layout of a form control and it's associated label, plus any other applicable text or sub-controls (e.g. error text or help button).

The field module itself does not make too many assumptions about how the field will be arranged in relation to other fields (as that would be the job of a layout system such as table, flexbox or grid system).

Unstacked Field

The field__label and field__control elements are inline by default, taking up only as much horizontal space as they need.

Multiple fields can be laid out inline on the same row by using a span tag, as per the example below.

<span class="field">
    <label class="field__label" for="field1">Field 1</label>
    <span class="field__control textbox">
        <input class="textbox__control" id="field1" type="text" placeholder="placeholder text" />
    </span>
</span>
<span class="field">
    <label class="field__label" for="field2">Field 2</label>
    <span class="field__control listbox">
        <select class="listbox__control" id="field2">
            <option value="1">Option 1</option>
            <option value="2">Option 2</option>
            <option value="3">Option 3</option>
        </select>
        <svg aria-hidden="true" class="listbox__icon">
            <use xlink:href="#svg-icon-arrow-down"></use>
        </svg>
    </span>
</span>
<span class="field">
    <label class="field__label" for="field3">Field 3</label>
    <span class="field__control switch">
        <input id="field3" type="checkbox" />
        <span></span>
    </span>
</span>
    

Replace the span tag with a div tag to layout fields in blocks, as per the following example.

Stacked Field

For a label stacked above the control, use the field__label--stacked element modifier.

Again, multiple fields can be laid out inline on the same row by using a span tag, as per the example below.

<span class="field">
    <label class="field__label field__label--stacked" for="field1">Field 1</label>
    <span class="textbox">
        <input class="textbox__control" id="field1" type="text" placeholder="placeholder text" />
    </span>
</span>
<span class="field">
    <label class="field__label field__label--stacked" for="field2">Field 2</label>
    <span class="listbox">
        <select class="listbox__control" id="field2">
            <option value="1">Option 1</option>
            <option value="2">Option 2</option>
            <option value="3">Option 3</option>
        </select>
        <svg aria-hidden="true" class="listbox__icon">
            <use xlink:href="#svg-icon-arrow-down"></use>
        </svg>
    </span>
</span>
<span class="field">
    <label class="field__label field__label--stacked">Field 3</label>
    <span class="field__control switch">
        <input id="field3" type="checkbox" />
        <span></span>
    </span>
</span>
    

Replace the span tag with a div tag to layout the stacked fields in blocks, as per the example below.

Fluid Fields

Form control elements (such as select and input) are inline-block by default, and will only use up as much of their parent's horizontal space as they need.

For a stacked field we can simply set the control to 100% width (using the fluid utility class) to fill all available space.

<div style="display: inline-block; float: left; width: 50%; ">
    <div class="field">
        <label class="field__label field__label--stacked" for="field1">Field 1</label>
        <div class="field__control textbox fluid">
            <input class="textbox__control fluid" id="field1" type="text" placeholder="placeholder text" />
        </div>
    </div>
</div>
<div style="box-sizing: border-box; display: inline-block; padding-left: 8px; width: 50%;">
    <div class="field">
        <label class="field__label field__label--stacked" for="field2">Field 2</label>
        <div class="field__control listbox fluid">
            <select class="listbox__control fluid" id="field2">
                <option value="1">Option 1</option>
                <option value="2">Option 2</option>
                <option value="3">Option 3</option>
            </select>
            <svg aria-hidden="true" class="listbox__icon">
                <use xlink:href="#svg-icon-arrow-down"></use>
            </svg>
        </div>
    </div>
</div>
    

REMEMBER: the field module only faciliates the layout of the contents of the field, not layout of the field itself. The above example shows fields in 50% width containers that handle layout.

If we set the form control width to 100% in an unstacked field, the control would flow to a new line below the label (effectively behaving like a stacked label).

This behaviour can be avoided by adding a field--table or field--flex modifier to create table or flex layout respectively. 100% width can then safely be applied to fill all available table-cell or flex-item space.

<div style="display: inline-block; float: left; width: 50%;">
    <span class="field field--table">
        <label class="field__label no-wrap" for="field1">Field 1</label>
        <div class="field__control textbox fluid">
            <input class="textbox__control fluid" id="field1" type="text" placeholder="placeholder text" />
        </div>
    </span>
</div>
<div style="box-sizing: border-box; display: inline-block; padding-left: 8px; width: 50%;">
    <span class="field field--table">
        <label class="field__label no-wrap" for="field2">Field 2</label>
        <div class="field__control listbox fluid">
            <select class="listbox__control fluid" id="field2">
                <option value="1">Option 1</option>
                <option value="2">Option 2</option>
                <option value="3">Option 3</option>
            </select>
            <svg aria-hidden="true" class="listbox__icon">
                <use xlink:href="#svg-icon-arrow-down"></use>
            </svg>
        </div>
    </span>
</div>
    

TIP: You may want to experiment with sizes other than 100% too.

Field Font-Size

The field label will honour any font-size cascade (so be careful if this is not your intention!).

Notice that form controls do not inherit the cascade. This is default browser behaviour.

<span class="field" style="font-size: 18px;">
    <label class="field__label" for="email">Field 1</label>
    <span class="field__control textbox textbox--large">
        <input class="textbox__control" id="field1" type="text" placeholder="placeholder text" />
    </span>
</span>
<span class="field" style="font-size: 18px;">
    <label class="field__label" for="size">Field 2</label>
    <span class="field__control listbox listbox--large">
        <select class="listbox__control" id="field2">
            <option value="1">Option 1</option>
            <option value="2">Option 2</option>
            <option value="3">Option 3</option>
        </select>
        <svg aria-hidden="true" class="listbox__icon">
            <use xlink:href="#svg-icon-arrow-down"></use>
        </svg>
    </span>
</span>
<span class="field" style="font-size: 18px;">
    <label class="field__label" for="field3">Field 3</label>
    <span class="field__control switch">
        <input id="field3" type="checkbox" />
        <span></span>
    </span>
</span>
    

Disabled Field

The disabled control is conveyed using the disabled attribute. The value of a disabled control is not passed to the server.

    <span class="field">
        <label class="field__label" for="email">Field 1</label>
        <span class="field__control textbox">
            <input class="textbox__control" id="field1" type="text" value="placeholder text" disabled />
        </span>
    </span>
    <span class="field">
        <label class="field__label" for="size">Field 2</label>
        <span class="field__control listbox">
            <select class="listbox__control" id="field2" disabled>
                <option value="1">Option 1</option>
                <option value="2">Option 2</option>
                <option value="3">Option 3</option>
            </select>
            <svg aria-hidden="true" class="listbox__icon">
                <use xlink:href="#svg-icon-arrow-down"></use>
            </svg>
        </span>
    </span>
    <span class="field">
        <label class="field__label" for="field3">Field 3</label>
        <span class="field__control switch">
            <input disabled id="field3" type="checkbox" />
            <span></span>
        </span>
    </span>
        

TIP: Disabled controls are exempt from WCAG colour contrast requirements.

Readonly Field

A readonly control is conveyed using the readonly attribute. The value of a readonly control is passed to the server.

<span class="field">
    <label class="field__label" for="email">Field 1</label>
    <span class="field__control textbox">
        <input class="textbox__control" id="field1" type="text" value="placeholder text" readonly />
    </span>
</span>
<span class="field">
    <label class="field__label" for="size">Field 2</label>
    <span class="field__control listbox">
        <select class="listbox__control" id="field2" readonly>
            <option value="1">Option 1</option>
            <option value="2">Option 2</option>
            <option value="3">Option 3</option>
        </select>
        <svg aria-hidden="true" class="listbox__icon">
            <use xlink:href="#svg-icon-arrow-down"></use>
        </svg>
    </span>
</span>
    

Required Field

A required field is conveyed visually with an asterisk, and non-visually using the aria-required property.

<span class="field">
    <label class="field__label" for="email">Field 1 <sup>*</sup></label>
    <span class="field__control textbox">
        <input aria-required="true" class="textbox__control" id="field1" type="text" placeholder="placeholder text">
    </span>
</div>
<span class="field">
    <label class="field__label" for="size">Field 2 <sup>*</sup></label>
    <span class="field__control listbox">
        <select aria-required="true" class="listbox__control" id="field2">
            <option value="0" disabled selected>-select-</option>
            <option value="1">Option 1</option>
            <option value="2">Option 2</option>
            <option value="3">Option 3</option>
        </select>
        <svg aria-hidden="true" class="listbox__icon">
            <use xlink:href="#svg-icon-arrow-down"></use>
        </svg>
    </span>
</span>
    

Invalid Field

An invalid control is conveyed visually via a combination of red outline and some other indicator (usually either text and/or an icon). The invalid state is conveyed non-visually using the aria-invalid state.

IMPORTANT: The example below shows the field with red border only. Do not forget that colour should not be used as the only visual means of conveying information. A description and/or icon is also required. See next section for more details.

<span class="field">
    <label class="field__label" for="email">Field 1</label>
    <span class="field__control textbox">
        <input aria-invalid="true" class="textbox__control" id="field1" type="text" placeholder="placeholder text">
    </span>
</div>
<span class="field">
    <label class="field__label" for="size">Field 2</label>
    <span class="field__control listbox">
        <select aria-invalid="true" class="listbox__control" id="field2">
            <option value="0" disabled selected>-select-</option>
            <option value="1">Option 1</option>
            <option value="2">Option 2</option>
            <option value="3">Option 3</option>
        </select>
        <svg aria-hidden="true" class="listbox__icon">
            <use xlink:href="#svg-icon-arrow-down"></use>
        </svg>
    </span>
</span>
    

Field Description

A field may have nearby text to describe additional instructions, status or validation error of the control.

The field__description element defines some minimal styling, but does not dictate location or layout. This element has modifiers for confirmation, information and priority, depending on the type of descriptive text (or icon).

TIP: The description element can be designated as an ARIA live-region if client-side updates occur.

Text on Side of Field

A description can be placed adjacent to field simply by using an inline-level tag, such as span.

Field description or error
<div class="field">
    <label class="field__label" for="field1">Field Label</label>
    <span class="field__control textbox">
        <input aria-describedby="field1-description" class="textbox__control" id="field1" type="text" />
    </span>
    <span class="field__description" id="field1-description">
        <span>Field description or error</span>
    </span>
</div>
    

If the control is fluid, then the control and description can be wrapped in a field__row or field__group container to create table or flex layout respectively.

Field description or error
Field description or error
<div style="display: inline-block; float: left; width: 50%; ">
    <div class="field">
        <label class="field__label field__label--stacked" for="field-fluid-block-1">Field 1</label>
        <div class="field__group">
            <span class="field__control textbox fluid">
                <input class="textbox__control fluid" id="field-fluid-block-1" type="text" placeholder="placeholder text" />
            </span>
            <span class="field__description">
                <span>Field description or error</span>
            </span>
        </div>
    </div>
</div>
<div style="box-sizing: border-box; display: inline-block; padding-left: 8px; width: 50%;">
    <div class="field">
        <label class="field__label field__label--stacked" for="field-fluid-block-2">Field 2</label>
        <div class="field__group">
            <div class="field__control listbox fluid">
                <select class="listbox__control fluid" id="field-fluid-block-2">
                    <option value="1">Option 1</option>
                    <option value="2">Option 2</option>
                    <option value="3">Option 3</option>
                </select>
                <svg aria-hidden="true" class="listbox__icon">
                    <use xlink:href="#svg-icon-arrow-down"></use>
                </svg>
            </div>
            <span class="field__description">
                <span>Field description or error</span>
            </span>
        </div>
    </div>
</div>
    

Text Below Stacked Field

A description can be placed underneath a stacked field simply by using a block-level tag, such as div.

Field description or error
<div class="field">
    <label class="field__label field__label--stacked" for="field1">Field Label</label>
    <div class="field__control textbox">
        <input aria-describedby="field1-description" class="textbox__control" id="field1" type="text" />
    </div>
    <div class="field__description" id="field1-description">
        <span>Field description or error</span>
    </div>
</div>
    

Text Above or Below Unstacked Field

A description can be added directly above and/or below the control by utlising CSS table-layout via the field--table modifier and field__row elements.

Field description or error
<div class="field field--table">
    <div class="field__row">
        <span><!-- empty cell--></span>
        <span class="field__description" id="field1-description">
            <span>Field description or error</span>
        </span>
    </div>
    <div class="field__row">
        <label class="field__label" for="field1">Field Label</label>
        <span class="textbox">
            <input aria-describedby="field1-description" class="textbox__control" id="field1" type="text" />
        </span>
    </div>
</div>
    

Global

Global creates a unique look for the eBay brand by defining the style of common elements such as headings, paragraphs, images and links.

Global is included with the core bundle.

Grid

The eBay grid is a flexbox first layout system, used to give to structure and form to designs. It will enable building consistent layouts across multiple pages.

For all Screens

By using our grid system pages can be made to adapt to any screen size. It uses media queries in order to change the layout. However, builds will be included for both adaptive and responsive use cases.

Consistent Design

The large and medium grid layouts are based on fractions of sixteen; the small grid is fractions of eight. Each grid cell has a percentage width with fixed "gutters". Having fixed spacing allows for consistent rhythm in our vertical and horizontal spacing.

Customizable

Currently the maximum width of a layout is 1280 pixels, but this system can easily be customized to fit all needs.

Lasso

If you are using lasso, you can include the grid css by adding a flag to your lasso configuration. For this to work you must include the skin-ebay/grid module in your browser.json as a dependency. If no flags are specified the grid-core file will be loaded into your page.

  • grid-core

    Adds the core grid system to your page. This includes just includes the lg, sm, and default grid sizes.

  • grid-large

    In order to accommodate adaptive designs the large and extra-large classes were broken up into their own file. This allows for applications to only pull in the large and extra-large classes

  • grid-small

    In order to accommodate adaptive designs the small classes were broken up into their own file. This allows for applications to only pull in the small classes

  • grid-full

    Adds the entire grid system to your page. This includes the lg, sm and the default grid sizes. As well as the necessary classes to utilize nested grids.

{
  "lasso": {
    "flags": ["grid-core"]
  }
}
    

CDN

The grid system is also available via CDN:

http://ir.ebaystatic.com/cr/v/c1/skin/v2.9.0/css/grid-full.min.css

Basic Grid

  • Create an element and apply the .grid class.
  • The only direct children of the .grid element should be .grid__group elements.
  • Generally, the only direct children of the .grid__group element should be .grid__cell elements. The only current exception is when you use the .grid__group--full modifier.
  • Generally, the .grid__cell element should have one block element child.

In order to simplify the grid system classes, the default classes to layout a page are .grid__cell--*of*, replacing the * with a number up to 16.

Content....

Content....

<div class="grid">
    <div class="grid__group">
        <div class="grid__cell grid__cell--4of16">
            <div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--12of16">
            <div>Content....</div>
        </div>
    </div>
</div>
    

Standard Breakpoints

The standard .grid__cell modifier classes will also have modifier classes to faciliate responsive page changes for different screen sizes. These are the same as the standard .grid__cell modifier class except they have a "-lg" or "-sm" post-fix.

600
960
1280
8 columns 16 columns
Small Medium Large
Class .grid__cell--*of*-sm
.grid__cell--4of8-sm
.grid__cell--*of*
.grid__cell--5of16
.grid__cell--*of*-lg
.grid__cell--8of16-lg
Media query @media(max-width: 600px) @media(min-width: 961px)
Viewport size <= 600px >= 961px
Gutter size 8px 16px 16px

16

4

4

4

4

4

8

4

8

8

<div class="grid">
    <div class="grid__group">
        <div class="grid__cell grid__cell--16of16 grid__cell--16of16-lg grid__cell--8of8-sm">
            <div>Content....</div>
        </div>
    </div>
    <div class="grid__group">
        <div class="grid__cell grid__cell--4of16 grid__cell--4of16-lg grid__cell--2of8-sm">
            <div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--4of16 grid__cell--4of16-lg grid__cell--2of8-sm">
            <div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--4of16 grid__cell--4of16-lg grid__cell--2of8-sm">
            <div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--4of16 grid__cell--4of16-lg grid__cell--2of8-sm">
            <div>Content....</div>
        </div>
    </div>
    <div class="grid__group">
        <div class="grid__cell grid__cell--4of16 grid__cell--4of16-lg grid__cell--2of8-sm">
        	<div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--8of16 grid__cell--8of16-lg grid__cell--4of8-sm">
        	<div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--4of16 grid__cell--4of16-lg grid__cell--2of8-sm">
        	<div>Content....</div>
        </div>
    </div>
    <div class="grid__group">
        <div class="grid__cell grid__cell--8of16 grid__cell--8of16-lg grid__cell--4of8-sm">
        	<div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--8of16 grid__cell--8of16-lg grid__cell--4of8-sm">
        	<div>Content....</div>
        </div>
    </div>
</div>
   

Simple Fraction Grid Cell Classes

In order to make using the grid system easier, a set of commonly used fractions were identified. These classes can be used if the percentage of the column will be staying the same regardless of the screen size. This allows for less code to be written in the markup.

For example, instead of using .grid__cell--4of16 .grid__cell--2of8-sm to represent one-half on both large and small screens, the class .grid__cell--one-half .

.grid__cell--one-half

.grid__cell--one-half

.grid__cell--one-fourth

.grid__cell--three-fourth

.grid__cell--one-third

.grid__cell--two-third

.grid__cell--one-fifth

.grid__cell--four-fifth

.grid__cell--two-fifth

.grid__cell--three-fifth

<div class="grid">
    <div class="grid__group">
        <div class="grid__cell grid__cell--one-half">
            <div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--one-half">
            <div>Content....</div>
        </div>
    </div>
    <div class="grid__group">
        <div class="grid__cell grid__cell--one-fourth">
            <div><p>One Fourth</p></div>
        </div>
        <div class="grid__cell grid__cell--three-fourth">
            <div><p>Three Fourth</p></div>
        </div>
    </div>
    <div class="grid__group">
        <div class="grid__cell grid__cell--one-third">
            <div><p>One Third</p></div>
        </div>
        <div class="grid__cell grid__cell--two-third">
            <div><p>Two Third</p></div>
        </div>
    </div>
    <div class="grid__group">
        <div class="grid__cell grid__cell--one-fifth">
            <div><p>One Fifth</p></div>
        </div>
        <div class="grid__cell grid__cell--four-fifth">
            <div><p>Four Fifth</p></div>
        </div>
    </div>
    <div class="grid__group">
        <div class="grid__cell grid__cell--two-fifth">
            <div><p>Two Fifth</p></div>
        </div>
        <div class="grid__cell grid__cell--three-fifth">
            <div><p>Three Fifth</p></div>
        </div>
    </div>
</div>
    

Nested Grid

The grid__cell element's proportions are relative to their parent container. A few rules exist for the .grid .grid selector and the .grid .grid > .grid__group selector. So, in order for nesting to work properly .grid__group elements should have a direct parent that is a .grid element. In other words, you should not place a .grid__group directly inside a .grid__cell.

  • Content....
  • Content....
  • Content....
  • Content....
Content....
Content....
Content....
Content....
Content....
Content....
<div class="grid">
    <div class="grid__group">
        <div class="grid__cell grid__cell--4of16">
            <div>
                <ul>
                    <li>Content....</li>
                    <li>Content....</li>
                    <li>Content....</li>
                    <li>Content....</li>
                </ul>
            </div>
        </div>
        <div class="grid__cell grid__cell--12of16">
            <div class="grid">
                <div class="grid__group grid__group--no-gutters">
                    <div class="grid__cell grid__cell--one-fourth">
                        <div>Content....</div>
                    </div>
                    <div class="grid__cell grid__cell--one-half">
                        <div>Content....</div>
                    </div>
                    <div class="grid__cell grid__cell--one-fourth">
                        <div>Content....</div>
                    </div>
                </div>
                <div class="grid__group grid__group--no-gutters">
                    <div class="grid__cell grid__cell--one-fourth">
                        <div>Content....</div>
                    </div>
                    <div class="grid__cell grid__cell--one-half">
                        <div>Content....</div>
                    </div>
                    <div class="grid__cell grid__cell--one-fourth">
                        <div>Content....</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
    

Experimental Nested Grid

Only available in grid-full.less. Contains every possible fraction, which is the reason for the significantly larger file size.

I am nested

I am nested

Content....
<div class="grid">
    <div class="grid__group">
        <div class="grid__cell grid__cell--11of16">
            <div class="grid">
                <div class="grid__group">
                    <div class="grid__cell grid__cell--6of11">
                        <div>I am nested</div>
                    </div>
                    <div class="grid__cell grid__cell--5of11">
                        <div>I am nested</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="grid__cell grid__cell--5of16">
            <div>Content....</div>
        </div>
    </div>
</div>
    

Grid Helper Classes

.grid__group--full

Instead of using .grid__cell--16of16, .grid__group--full can be used to achieve a full width row with the cell properties. This requires one less element, which is nice.

Example of using .grid__group--full

Content....

Content....

<div class="grid">
    <div class="grid__group grid__group--full">
        <h3>Example of using .grid__group--full</h3>
    </div>
    <div class="grid__group">
        <div class="grid__cell grid__cell--4of16">
            <div><p>Content....</p></div>
        </div>
        <div class="grid__cell grid__cell--12of16">
            <div><p>Content....</p></div>
        </div>
    </div>
</div>
    

.grid__cell--*-hidden

In cases where you want to hide a segment of layout for a certain screen size use the .grid__cell--sm-hidden, .grid__cell--md-hidden, or .grid__cell--lg-hidden modifier class.

Content....

Content....

Content....

<div class="grid">
    <div class="grid__group">
        <div class="grid__cell grid__cell--one-fourth">
            <div><p>Content....</p></div>
        </div>
        <div class="grid__cell grid__cell--grow">
            <div><p>Content....</p></div>
        </div>
        <div class="grid__cell grid__cell--4of16-lg grid__cell--md-hidden grid__cell--sm-hidden">
            <div><p>Content....</p></div>
        </div>
    </div>
</div>
    

.grid__group--wrap

If there is a case where you need the content within a group to wrap, the .grid__group--wrap modifier class is used.

Without .grid__group--wrap modifier class

Content....

Content....

Content....

Content....

Content....

<div class="grid">
    <div class="grid__group">
        <div class="grid__cell grid__cell--one-fourth">
            <div><p>Content....</p></div>
        </div>
        <div class="grid__cell grid__cell--one-fourth">
            <div><p>Content....</p></div>
        </div>
        <div class="grid__cell grid__cell--one-fourth">
            <div><p>Content....</p></div>
        </div>
        <div class="grid__cell grid__cell--one-fourth">
            <div><p>Content....</p></div>
        </div>
        <div class="grid__cell grid__cell--one-fourth">
            <div><p>Content....</p></div>
        </div>
    </div>
</div>
    
With .grid__group--wrap modifier class

Content....

Content....

Content....

Content....

Content....

<div class="grid">
    <div class="grid__group grid__group--wrap">
        <div class="grid__cell grid__cell--one-fourth">
            <div><p>Content....</p></div>
        </div>
        <div class="grid__cell grid__cell--one-fourth">
            <div><p>Content....</p></div>
        </div>
        <div class="grid__cell grid__cell--one-fourth">
            <div><p>Content....</p></div>
        </div>
        <div class="grid__cell grid__cell--one-fourth">
            <div><p>Content....</p></div>
        </div>
        <div class="grid__cell grid__cell--one-fourth">
            <div><p>Content....</p></div>
        </div>
    </div>
</div>
    
Adapting to Screen Size With .grid__group--wrap

Wrapping can be useful when a piece of a layout needs to adapt to different screen sizes.

Content....

Content....

Content....

Content....

Content....

Content....

Content....

Content....

<div class="grid">
    <div class="grid__group grid__group--wrap">
        <div class="grid__cell grid__cell--one-fourth grid__cell--4of8-sm">
            <div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--one-fourth grid__cell--4of8-sm">
            <div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--one-fourth grid__cell--4of8-sm">
            <div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--one-fourth grid__cell--4of8-sm">
            <div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--one-fourth grid__cell--4of8-sm">
            <div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--one-fourth grid__cell--4of8-sm">
            <div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--one-fourth grid__cell--4of8-sm">
            <div>Content....</div>
        </div>
        <div class="grid__cell grid__cell--one-fourth grid__cell--4of8-sm">
            <div>Content....</div>
        </div>
    </div>
</div>
    

.grid__cell--grow

If there is a desire to have a cell fill the rest of the left-over space, use .grid__cell--grow.

This can be used to make responsive choreography between .grid__cell elements easier.

Has Breakpoints

Growth

One Third

<div class="grid">
    <div class="grid__group">
        <div class="grid__cell grid__cell--one-fourth  grid__cell--3of8-sm">
            <div><p>Has Breakpoints</p></div>
        </div>
        <div class="grid__cell grid__cell--grow">
            <div><p>Growth</p></div>
        </div>
        <div class="grid__cell grid__cell--one-third">
            <div><p>One Third</p></div>
        </div>
    </div>
</div>
    

Grid Chrome Extension

Its goals are to help:

  • Align layouts to a common layout system.
  • Communicate layout requirements.
  • Explain the concept of flexible layouts.

Currently the Design Grid Overlay Chrome extension is available in the extensions section of Chrome Web store. New feature requests and contributions are welcome on the project's Github page.

Icon Button

Use the icon-btn class and any of the available font icons for a borderless icon button.

<button aria-label="Menu" class="icon-btn" type="button">
    <span aria-hidden="true" class="icon icon--menu"></span>
</button>
<a aria-label="Settings" class="icon-btn" href="http://www.ebay.com">
    <span aria-hidden="true" class="icon icon--settings"></span>
</a>
    

The span tag hosting the icon-font can be switched out for inline SVG:

<button aria-label="Menu" class="icon-btn" type="button">
    <svg aria-hidden="true" focusable="false">
        <use xlink:href="#svg-icon-menu"></use>
    </svg>
</button>
<a aria-label="Settings" class="icon-btn" href="http://www.ebay.com">
    <svg aria-hidden="true" focusable="false">
        <use xlink:href="#svg-icon-settings"></use>
    </svg>
</a>
    

Icon

The skin-ebay/icon module allows access to individual icons in the Skin icon font via CSS class names.

NOTE: Skin is in the midst of a transition from a font-based icon system to an SVG-based icon system. All icons listed below are being converted to SVG on a per-need basis.

Core Icons

Null Icons

Editing Icons

Selling Icons

Misc Icons

Less

The skin-ebay/less module enables developers to access our Skin-related Less variables & mixins in their application.

Our Less module is not intended as a general-purpose library of utility mixins and variables (i.e. it is not LessHat!).

{
    "dependencies": {
      "lasso": "^2",
      "lasso-less": "^2",
      "skin-ebay": "~2.9"
    }
}
    

NOTE: This module requires the additional lasso-less plugin dependency in your app package.json:

Core Icons

The skin-ebay/less module allows access to individual icons in the Skin icon font via LESS mixins.

Please refer to the icon module for the full list of icon names. When using the icons as a mixin, simply postfix any of those icon names with -mixin in your LESS file.

Core Colors

@color-core-gray-jet;
@color-core-gray-davys;
@color-core-gray-dim;
@color-core-gray-spanish;
@color-core-gray-silver;
@color-core-gray-gainsboro;
@color-core-gray-light;
@color-core-orange;
@color-core-red;
@color-core-purple;
@color-core-blue-dark;
@color-core-blue;
@color-core-violet;
@color-core-green;
@color-core-beige;
@color-core-beige-light;

Text Colors

@color-text-default;
@color-text-subheader;
@color-text-footnote;
@color-text-disabled;
@color-text-critical;
@color-text-positive;

Interface Colors

@color-interface-hot;
@color-interface-cta-dark;
@color-interface-cta;
@color-interface-cta-light;
@color-interface-positive;
@color-interface-line-separator;
@color-interface-view-background;
@color-interface-base;
@color-interface-base-light;
@color-interface-modal-shadow;
@color-interface-menu-shadow;
@color-interface-card-visited;
@color-interface-card-background;
@color-interface-card-selection;
@color-interface-card-highlight;
@color-interface-inline-text-edit;

Infographic Colors

@color-infographic-red-lightest;
@color-infographic-red-light;
@color-infographic-red;
@color-infographic-red-interaction;
@color-infographic-green-lightest;
@color-infographic-green-light;
@color-infographic-green;
@color-infographic-green-interaction;
@color-infographic-blue-lightest;
@color-infographic-blue-light;
@color-infographic-blue;
@color-infographic-blue-interaction;
@color-infographic-orange-lightest;
@color-infographic-orange-light;
@color-infographic-orange;
@color-infographic-orange-interaction;
@color-infographic-purple-lightest;
@color-infographic-purple-light;
@color-infographic-purple;
@color-infographic-purple-interaction;
@color-infographic-gray-lightest;
@color-infographic-gray-light;
@color-infographic-gray;
@color-infographic-gray-interaction;

Mobile Font Hierarchy

  1. .font-hierarchy-mobile-jumbo;
  2. .font-hierarchy-mobile-headline-1;
  3. .font-hierarchy-mobile-headline-2;
  4. .font-hierarchy-mobile-title-1;
  5. .font-hierarchy-mobile-title-2;
  6. .font-hierarchy-mobile-title-3;
  7. .font-hierarchy-mobile-body-1;
  8. .font-hierarchy-mobile-body-2;
  9. .font-hierarchy-mobile-caption-1;
  10. .font-hierarchy-mobile-caption-2;

Desktop Font Hierarchy

  1. .font-hierarchy-desktop-jumbo;
  2. .font-hierarchy-desktop-headline-1;
  3. .font-hierarchy-desktop-headline-2;
  4. .font-hierarchy-desktop-title-1;
  5. .font-hierarchy-desktop-title-2;
  6. .font-hierarchy-desktop-title-3;
  7. .font-hierarchy-desktop-body-1;
  8. .font-hierarchy-desktop-body-2;
  9. .font-hierarchy-desktop-caption-1;
  10. .font-hierarchy-desktop-caption-2;

Listbox

A listbox (also known as a select) allows the user to select one item from a list of options.

The purpose of a listbox is to collect form data; therefore a listbox should always be used in conjunction with a form, label and submit button. If you are not submitting form data, then a Menu maybe a better choice.

IMPORTANT: The examples below show the listbox in isolation, without any label. Please see the field module for details on labelling controls. Remember: every listbox requires a label!

Default Listbox

The default listbox is prefilled with a selected option.

<span class="listbox">
    <select class="listbox__control">
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
    </select>
    <svg aria-hidden="true" class="listbox__icon" focusable="false">
        <use xlink:href="#svg-icon-arrow-down"></use>
    </svg>
</span>
    

Unselected Listbox

If no suitable default value exists, the first option in the list can be used as a prompt and set to disabled & selected.

<span class="listbox">
    <select class="listbox__control">
        <option value="0" disabled selected>-select-</option>
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
    </select>
    <svg aria-hidden="true" class="listbox__icon" focusable="false">
        <use xlink:href="#svg-icon-arrow-down"></use>
    </svg>
</span>
    

Fluid Listbox

Use the listbox__control--fluid element modifier (or fluid utility class) to fill all horizontal space of the parent element.

<div class="listbox">
    <select class="listbox__control listbox__control--fluid">
        <option value="0" disabled selected>-select-</option>
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
    </select>
    <svg aria-hidden="true" class="listbox__icon" focusable="false">
        <use xlink:href="#svg-icon-arrow-down"></use>
    </svg>
</div>
    

Borderless Listbox

For a borderless listbox, apply the listbox__control--borderless modifier.

<span class="listbox">
    <select class="listbox__control listbox__control--borderless">
        <option value="0" disabled selected>Choose a Size</option>
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
        <option value="3">Option 3</option>
    </select>
    <svg aria-hidden="true" class="listbox__icon" focusable="false">
        <use xlink:href="#svg-icon-arrow-down"></use>
    </svg>
</span>
    

Notice

The purpose of a notice is to convey the next course of action for a task or flow. The notice must be clear and concise, with minimum cognitive load.

A notice may appear at page-level, inline-level or flyout-level, and may have a status of priority, confirmation, or information.

Page Notice

A page-level notice typically appears prominently at the top of the page or directly above a module. To aid discoverabilty of such important content for assistive technology, we make each page notice a landmark region with heading.

Use the page-notice--priority, page-notice--confirmation, or page-notice--information block modifiers depending on the relevant status.

By default, the text will vertically align to the top of the status icon. To vertically align text with the middle of status icon, use the .page-notice__cell--align-middle element modifier. This modifier is appropriate for short, single-line notices.

Something went wrong. Please try again.

Congrats! You are the highest bidder!

We could not find any items that match your search. Try expanding your search to find more items.

Use fewer refinements.

<section aria-labelledby="error-status" class="page-notice page-notice--priority" role="region">
    <h2 aria-label="Error notice" class="page-notice__status" id="error-status">
        <svg aria-hidden="true" focusable="false">
            <use xlink:href="#svg-icon-priority"></use>
        </svg>
    </h2>
    <span class="page-notice__cell page-notice__cell--align-middle">
        <p>Something went wrong. Please try again.</p>
    </span>
</section>
<section aria-labelledby="confirmation-status" class="page-notice page-notice--confirmation" role="region">
    <h2 aria-label="Confirmation notice" class="page-notice__status" id="confirmation-status">
        <svg aria-hidden="true" focusable="false">
            <use xlink:href="#svg-icon-confirmation"></use>
        </svg>
    </h2>
    <span class="page-notice__cell page-notice__cell--align-middle">
        <p>Congrats! You are the <a href="http://www.ebay.com">highest bidder!</a></p>
    </span>
</section>
<section aria-labelledby="information-status" class="page-notice page-notice--information" role="region">
    <h2 aria-label="Information notice" class="page-notice__status" id="information-status">
        <svg aria-hidden="true" focusable="false">
            <use xlink:href="#svg-icon-information"></use>
        </svg>
    </h2>
    <span class="page-notice__cell">
        <p>We could not find any items that match your search. Try expanding your search to find more items.</p>
        <p><a href="http://www.ebay.com">Use fewer refinements</a>.</p>
    </span>
</section>
    

Dismissable Page Notice

Append a page-notice__close button to create a dismissable page notice.

Try refining your search term for more results.

<section aria-labelledby="information-status" class="page-notice page-notice--information" role="region">
    <h2 aria-label="Information notice" class="page-notice__status" id="information-status">
        <svg aria-hidden="true" focusable="false">
            <use xlink:href="#svg-icon-information"></use>
        </svg>
    </h2>
    <span class="page-notice__cell page-notice__cell--align-middle">
        <p>Try refining your search term for more results.</p>
    </span>
    <button aria-label="Dismiss notice" class="page-notice__close" type="button">
        <svg aria-hidden="true" focusable="false">
            <use xlink:href="#svg-icon-close"></use>
        </svg>
    </button>
</section>
    

Call-to-Action Page Notice

Use an anchor or button tag to create a 'call-to-action' page notice tile.

IMPORTANT: A call-to-action can only have one action, i.e. a link or button tag cannot contain any nested links or buttons.

<span aria-labelledby="confirmation-notice" role="region">
    <a href="http://www.ebay.com" class="page-notice page-notice--confirmation page-notice--fluid">
        <h2 aria-label="Confirmation notice" id="confirmation-status">
            <svg aria-hidden="true" class="page-notice__status" focusable="false">
                <use xlink:href="#svg-icon-confirmation"></use>
            </svg>
        </h2>
        <span class="page-notice__cell page-notice__cell--align-middle">
            <p>Congrats! You are the highest bidder!</p>
        </span>
        <svg aria-hidden="true" class="page-notice__cta" focusable="false">
            <use xlink:href="#svg-icon-chevron-light-right"></use>
        </svg>
    </a>
</span>
    

Inline Notice

An inline-level notice is typically located near a form field or user interface control.

Use the inline-notice--priority, inline-notice--confirmation, or inline-notice--information modifier classes depending on the required status level.

Something went wrong.

Congrats! You are the highest bidder!

Try refining your search for more results.

<div class="inline-notice inline-notice--priority">
    <span aria-label="Priority" class="inline-notice__status" role="img">
        <svg aria-hidden="true" focusable="false">
            <use xlink:href="#svg-icon-priority"></use>
        </svg>
    </span>
    <span class="inline-notice__cell">
        <p>Something went wrong.</p>
    </span>
</div>
<div class="inline-notice inline-notice--confirmation">
    <span aria-label="Confirmation" class="inline-notice__status" role="img">
        <svg aria-hidden="true" focusable="false">
            <use xlink:href="#svg-icon-confirmation"></use>
        </svg>
    </span>
    <span class="inline-notice__cell">
        <p>Congrats! You are the <a href="http://www.ebay.com">highest bidder!</a></p>
    </span>
</div>
<div class="inline-notice inline-notice--information">
    <span aria-label="Information" class="inline-notice__status" role="img">
        <svg aria-hidden="true" focusable="false">
            <use xlink:href="#svg-icon-information"></use>
        </svg>
    </span>
    <span class="inline-notice__cell">
        <p>Try refining your search for more results.</p>
    </span>
</div>
    

Flyout Notice

A flyout-level notice points to a specific section or element of the page. We can also says this element hosts the flyout.

The DOM order of the notice and it's host is important! To avoid keyboard and screen reader accessibility issues, the flyout element's DOM position should be adjacent to it's host.

Flyout notices are absolutely positioned by default. The flyout will be positioned relatively to the nearest ancestor with position:relative.

The flyout pointer can be positioned using any one of the following elements: flyout-notice__pointer-top-left, flyout-notice__pointer-top-center, flyout-notice__pointer-top-right, flyout-notice__pointer-bottom-right, flyout-notice__pointer-bottom-center, flyout-notice__pointer-bottom-left, flyout-notice__pointer-left or flyout-notice__pointer-right.

We had trouble connecting to PayPal. Please make your payment later.

Congrats! You are currently the high bidder, but you are close to getting outbid.

We could not find any items that match your search. Try expanding your search to find more items.

Use fewer refinements.

<div class="flyout-notice flyout-notice--priority">
    <span class="flyout-notice__cell">
        <p>We had trouble connecting to PayPal. Please make your payment later.</p>
    </span>
    <button aria-label="Dismiss notice" class="flyout-notice__close" type="button">
        <svg aria-hidden="true" focusable="false">
            <use xlink:href="#svg-icon-close"></use>
        </svg>
    </button>
    <span class="flyout-notice__pointer-top-left"></span>
</div>
<div class="flyout-notice flyout-notice--confirmation">
    <span class="flyout-notice__cell">
        <p>Congrats! You are currently the high bidder, but you are close to getting outbid.</p>
    </span>
    <button aria-label="Dismiss notice" class="flyout-notice__close" type="button">
        <svg aria-hidden="true" focusable="false">
            <use xlink:href="#svg-icon-close"></use>
        </svg>
    </button>
    <span class="flyout-notice__pointer-bottom-left"></span>
</div>
<div class="flyout-notice flyout-notice--information">
    <span class="flyout-notice__cell">
        <p>We could not find any items that match your search. Try expanding your search to find more items.</p>
        <p><a href="http://www.ebay.com">Use fewer refinements.</a></p>
    </span>
    <button aria-label="Dismiss notice" class="flyout-notice__close" type="button">
        <svg aria-hidden="true" focusable="false">
            <use xlink:href="#svg-icon-close"></use>
        </svg>
    </button>
    <span class="flyout-notice__pointer-right"></span>
</div>
    

Tooltip BETA

A flyout-notice can be used as the overlay of a Tooltip pattern.

Apply modifier class tooltip--expanded to the widget to display the overlay.

<span class="tooltip">
    <button aria-label="Settings" accesskey="s" class="tooltip__host icon-btn" aria-describedby="tooltip-0">
        <svg aria-hidden="true" class="svg-icon" focusable="false">
            <use xlink:href="#svg-icon-settings"></use>
        </svg>
    </button>
    <div id="tooltip-0" class="tooltip__overlay flyout-notice flyout-notice--information" role="tooltip">
        <div class="flyout-notice flyout-notice--information">
            <span class="flyout-notice__cell">
                <p>Use Access Key 'S' to display settings.</p>
            </span>
            <span class="flyout-notice__pointer-bottom-left"></span>
        </div>
    </div>
</span>
    

NOTE: This example uses a simple jQuery jquery-tooltip plugin to toggle the tooltip--expanded class on hover and focus.

Bubble-Help BETA

A flyout-notice can be used as the overlay of a Bubble Help pattern.

Apply an aria-expanded state of true to the help button to display the overlay.

Here's a tip to help you be successful at your task:

Use fewer refinements.

<span class="bubblehelp">
    <button aria-label="Help" class="icon-btn bubblehelp__host" type="button" aria-expanded="false">
        <svg aria-hidden="true" class="svg-icon" focusable="false">
            <use xlink:href="#svg-icon-information"></use>
        </svg>
    </button>
    <div class="bubblehelp__overlay">
        <div class="flyout-notice flyout-notice--information">
            <span class="flyout-notice__cell">
                <p>Here's a tip to help you be successful at your task:</p>
                <p><a href="http://www.ebay.com">Use fewer refinements.</a></p>
            </span>
            <span class="flyout-notice__pointer-top-left"></span>
        </div>
    </div>
</span>
    

NOTE: This example uses a simple jquery-click-flyout plugin to toggle the aria-expanded state of the button when clicked.

Normalize

Normalize imports the latest Normalize.css.

"Normalize.css makes browsers render all elements more consistently and in line with modern standards. It precisely targets only the styles that need normalizing."

Normalize is included with the core bundle.

Radio

Radio buttons allow the user to select a single option from a group of choices.

In order to create the correct grouping semantics, fieldset and legend tags are always required for radio buttons.

Vertical Radios

Wrap each radio and label in a div element to stack vertically.

Choose an Option
<div class="radios">
    <fieldset>
        <legend>Choose an Option</legend>
        <div>
            <input id="option1" name="radiogroup" type="radio" value="1" />
            <label for="option1">Option 1</label>
        </div>
        <div>
            <input id="option2" name="radiogroup" type="radio" value="2" />
            <label for="option2">Option 2</label>
        </div>
        <div>
            <input id="option3" name="radiogroup" type="radio" value="3" />
            <label for="option3">Option 3</label>
        </div>
    </fieldset>
</div>
    

Horizontal Radios

Wrap each radio and label in a span element to align horizontally.

Choose an Option
<div class="radios">
    <fieldset>
        <legend>Choose an Option</legend>
        <span>
            <input type="radio" name="radiogroup" id="option1" value="1" />
            <label for="option1">Option 1</label>
        </span>
        <span>
            <input type="radio" name="radiogroup" id="option2" value="2" />
            <label for="option2">Option 2</label>
        </span>
        <span>
            <input type="radio" name="radiogroup" id="option3" value="3"  />
            <label for="option3">Option 3</label>
        </span>
    </fieldset>
</div>
    

Flipped Radios

Use the radios--flipped modifier class to swap over the label and radio button positions.

NOTE: the additional span element (inside of the label) that is required for flipped radios.

Choose an Option
<div class="radios radios--flipped">
    <fieldset>
        <legend>Choose an Option</legend>
        <span>
            <input type="radio" name="radiogroup" id="option1" value="1" />
            <label for="option1"><span>Option 1</span></label>
        </span>
        <span>
            <input type="radio" name="radiogroup" id="option2" value="2" />
            <label for="option2"><span>Option 2</span></label>
        </span>
        <span>
            <input type="radio" name="radiogroup" id="option3" value="3"  />
            <label for="option3"><span>Option 3</span></label>
        </span>
    </fieldset>
</div>
    

Disabled Radios

Use the disabled attribute to disable any radio button input.

Choose an Option
<div class="radios">
    <fieldset>
        <legend>Choose an Option</legend>
        <div>
            <input id="option1" name="radiogroup" type="radio" value="1" disabled />
            <label for="option1">Option 1</label>
        </div>
        <div>
            <input id="option2" name="radiogroup" type="radio" value="2" disabled />
            <label for="option2">Option 2</label>
        </div>
    </fieldset>
</div>
    

Spinner

A spinner animation is used to convey a busy or loading state.

A spinner is considered a critical graphic, therefore an img role and aria-label property are required.

<span class="spinner" aria-label="Busy animation" role="img"></span>
    

Large Spinner

Use the spinner--large modifier class to create a large spinner.

<span class="spinner spinner--large" aria-label="Busy" role="img"></span>
    

Switch

A switch behaves like a checkbox - it can be on or off (i.e checked or unchecked) - and under the hood, that's exactly what it is. Whereas checkboxes are often used to allow multi-selection from a group of choices, switches are more often used in isolation or as a series of unrelated options.

IMPORTANT: The example below shows the switch in isolation, without any label. Please see the field module for details on labelling controls. Remember: every switch requires a label!

<div class="switch">
    <input type="checkbox" />
    <span></span>
</div>
    

Tab

A tabbed interface allows the layered stacking of content panels, with only one panel being visible at any time. A tab is contained within a tablist - each tab controlling the visibility of it's respective panel. By decluttering the user-interface in this way, we say that a tab follows the principals of progressive disclosure.

When adding a tabbed interface to a page, you have two choices: selecting a tab can either update the panel contents dynamically without a full page reload (these are our default tabs), or they can behave statically, reloading the entire page (we call these our 'Faux' Tabs). Be sure to use the correct version for your needs!

NOTE: The examples below use a simple jquery-tabs plugin to toggle the aria state of the tabs when clicked. The plugin also implements arrow-key navigation for keyboard accessibility.

Default Tabs

When a tab is selected, the aria-selected, aria-hidden and tabindex states must be updated in order for the CSS to reflect the change. Only one tab can be selected and in the tab order at any moment in time. Likewise, only one tabpanel can be visible at any time, and it must correspond to the currently selected tab.

Tab 1
Tab 2
Tab 3

Panel 1 Content

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet assumenda culpa est nisi porro quae quidem ratione repellendus, temporibus. Assumenda atque dolor dolorem eligendi eveniet ipsam modi necessitatibus quos ut?

Panel 2 Content

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet assumenda culpa est nisi porro quae quidem ratione repellendus, temporibus. Assumenda atque dolor dolorem eligendi eveniet ipsam modi necessitatibus quos ut?

Panel 3 Content

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet assumenda culpa est nisi porro quae quidem ratione repellendus, temporibus. Assumenda atque dolor dolorem eligendi eveniet ipsam modi necessitatibus quos ut?

<div class="tabs">
    <div role="tablist">
        <div aria-controls="panel1" role="tab" tabindex="0" aria-selected="true" id="tab1">
            <span>Tab 1</span>
        </div>
        <div aria-controls="panel2" role="tab" tabindex="-1" aria-selected="false" id="tab2">
            <span>Tab 2</span>
        </div>
        <div aria-controls="panel3" role="tab" tabindex="-1" aria-selected="false" id="tab3">
            <span>Tab 3</span>
        </div>
    </div>
    <div>
        <div id="panel1" role="tabpanel" aria-hidden="false" aria-labelledby="tab1">
            <!-- panel1 heading & content -->
        </div>
        <div id="panel2" role="tabpanel" aria-hidden="true" aria-labelledby="tab2">
            <!-- panel2 heading & content -->
        </div>
        <div id="panel3" role="tabpanel" aria-hidden="true" aria-labelledby="tab3">
            <!-- panel3 heading & content -->
        </div>
    </div>
</div>
    

TIP: If you'd prefer to create your tabs from a list of anchors (i.e. progressive enhancement) instead of divs, please see the 'Hijax Tabs' at the end of this section.

Faux Tabs

If you only wish to create a set of links that are styled visually like tabs, with no additional behaviour, please use a simple list of links. No ARIA is required.

The tabs--faux modifier class must be applied. The tabs__selected class is used to visually denote the current tab; clipped text is used to denote it aurally.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet assumenda culpa est nisi porro quae quidem ratione repellendus, temporibus. Assumenda atque dolor dolorem eligendi eveniet ipsam modi necessitatibus quos ut?

<div class="tabs tabs--faux">
    <ul>
        <li class="tabs__selected">
            <a href="#">Page 1<span class="clipped"> - Current Page</span></a>
        </li>
        <li>
            <a href="http://www.ebay.com">Page 2</a>
        </li>
        <li>
            <a href="http://www.ebay.com">Page 3</a>
        </li>
    </ul>
    <div>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet assumenda culpa est nisi porro quae quidem ratione repellendus, temporibus. Assumenda atque dolor dolorem eligendi eveniet ipsam modi necessitatibus quos ut?</p>
    </div>
</div>
    

Hijax Tabs

Using JavaScript, Faux Tabs can be progressively enhanced into 'real' tabs by adding the necessary ARIA roles, states & properties. In addition to this, the default link behaviour must be prevented by removing the href attribute and the default link semantics must be removed by specifying role="presentation".

JavaScript must then be used to replace the tabs--faux modifier class with tabs--hijax.

Panel 1 Content

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet assumenda culpa est nisi porro quae quidem ratione repellendus, temporibus. Assumenda atque dolor dolorem eligendi eveniet ipsam modi necessitatibus quos ut?

Panel 2 Content

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet assumenda culpa est nisi porro quae quidem ratione repellendus, temporibus. Assumenda atque dolor dolorem eligendi eveniet ipsam modi necessitatibus quos ut?

Panel 3 Content

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet assumenda culpa est nisi porro quae quidem ratione repellendus, temporibus. Assumenda atque dolor dolorem eligendi eveniet ipsam modi necessitatibus quos ut?

<div class="tabs tabs--hijax">
    <ul role="tablist">
        <li aria-controls="panel1" role="tab" tabindex="0" aria-selected="true" id="tab1">
            <a role="presentation">Tab 1</a>
        </li>
        <li aria-controls="panel2" role="tab" tabindex="-1" aria-selected="false" id="tab2">
            <a role="presentation">Tab 2</a>
        </li>
        <li aria-controls="panel3" role="tab" tabindex="-1" aria-selected="false" id="tab3">
            <a role="presentation">Tab 3</a>
        </li>
    </ul>
    <div>
        <div id="panel1" role="tabpanel" aria-hidden="false" aria-labelledby="tab1">
            <!-- panel3 heading & content -->
        </div>
        <div id="panel2" role="tabpanel" aria-hidden="true" aria-labelledby="tab2">
            <!-- panel3 heading & content -->
        </div>
        <div id="panel3" role="tabpanel" aria-hidden="true" aria-labelledby="tab3">
            <!-- panel3 heading & content -->
        </div>
    </div>
</div>
    

Textbox

A textbox (also known as an input) allows the user to enter data.

The purpose of a textbox is to collect form data; therefore it should always be used in conjunction with a form, label and submit button.

IMPORTANT: The examples below show the textbox in isolation, without any label. Please see the field module for details on labelling controls. Remember: every textbox requires a label!

Single-Line Textbox

Use an input tag for a single-line textbox.

<span class="textbox">
    <input class="textbox__control" type="text" placeholder="placeholder text" />
</span>
    

Multi-line Textbox

Use the textarea tag for a multi-line textbox.

A multi-line textbox allows line breaks and has a minimum height of 200px.

<span class="textbox">
    <textarea class="textbox__control" placeholder="placeholder text"></textarea>
</span>
    

Fluid Textbox

Apply the textbox__control--fluid modifier (or fluid utility class) to fill the width of the parent element.

<div class="textbox">
    <input class="textbox__control textbox__control--fluid" type="text" placeholder="placeholder text" />
</div>
    

Textbox with Icon

Single-line textboxes can be augmented with any font-icon or inline SVG, using a textbox__icon element before the control.

<span class="textbox">
    <svg aria-hidden="true" class="textbox__icon" focusable="false">
        <use xlink:href="#svg-icon-mail"></use>
    </svg>
    <input class="textbox__control" type="text" placeholder="placeholder text" />
</span>
    

NOTE: The icon is presentational, and therefore hidden from assistive technology using aria-hidden. Remember, the purpose of the field must be conveyed using a label.

Tile

Image Tiles

Apply class tile to links or buttons to create an actionable tile effect on hover, focus and active states.

iPhone
<a href="http://www.ebay.com" class="tile">
    <img src="http://i2.ebayimg.com/images/g/e0oAAOSwsN9W~YBY/s-l200.jpg" alt="iPhone" />
</a>
<button type="button" class="tile">
    <img src="http://i2.ebayimg.com/images/g/e0oAAOSwsN9W~YBY/s-l200.jpg" alt="iPhone" />
</button>
    

Utility

Skin provides a small set of utility classes. Typically these classes will not conflict with styles set by BEM, and in some cases are applied directly by our Experience Service backend.

Our utility module is not intended as a general-purpose library of utility classes (i.e. it is not Funcssion!).

Utility is included with the core bundle.

Utility Classes
Class Properties Class Properties
.clearfix Clear floated elements .truncate Truncate single-line text
.clipped Element visible to screen reader only .clipped--stealth Clipped element becomes visible on focus (modifier)
.fluid-image Image will stretch up and down .responsive-image Image will scale up and down
.no-scroll overflow: hidden; .no-wrap white-space: nowrap;
.image-wrapper Vertically and horizontally center an image .fluid width: 100%;
.positive color: #447D14; .negative color: #DD1E31;
.emphasis color: #DD1E31; .faux-link Styles button as a link
.svg-icon Base styles for SVG icon