NuSkin Global Styles

  • Getting Started
  • Atoms
    • absolute-placeholder
    • actions
    • borders
    • brand
    • buttons
    • checkbox
    • disabled
    • icons
    • inputs
    • modal
    • radios
    • tables
  • Molecules
  • Organisms
  • Views

Getting Started

Global Styles is a centralized framework and guide that defines the common styles and conventions shared across NuSkin's web products. This page provides a brief overview of what is available, but you should review the actual stylesheets to see everything.

Here is some code you can copy to start a new page/app:

<html>
<head>
	<link href='https://test.nuskin.com/styles/dist/sites/nuskin/global.css' rel='stylesheet' type='text/css'>
</head>
<body class='ns-atomic'>
	<header class='banner default'>
		<div class='content'><i class='brand-icon'></i>
			<h1>New Web App</h1>
		</div>
	</header>
	<div class='main-container width-full banner-offset'>
		<div class='content default'>Content goes here</div>
	</div>
</body>
</html>

If you have a page already, you can just use this snippet referencing the global styles:

<link href='https://test.nuskin.com/styles/dist/sites/nuskin/global.css' rel='stylesheet' type='text/css'>

In order for Global Styles to function correctly on a page, you must ensure that the ns-atomic class appears as an ancestor to your elements. Usually setting ns-atomic on the body is the best solution.

See also:Brand Guide (Draft)

Absolute Placeholder

Injects an invisible placeholder so you can position an element relative to its container without losing the sapce the element should be taking up.

Example

Normally, this text would be at risk of being overlapped by the absolutely positioned button, but because of the placeholder, it all lays out correctly

<div>
	<p>Normally, this text would be at risk of being overlapped by the absolutely positioned button, but because of the placeholder, it all lays out correctly</p>
	<button class='btn btn-secondary absolute-placeholder'>Absolutely Positioned</button>
	<button class='btn btn-secondary anchor-to-bottom-right'>Absolutely Positioned</button>
</div>

Usage

Generally speaking, you'll essentially want two copies of the element you are creating a placeholder for, then apply the placeholder class to the copy only. Make sure you remove any classes or rules that would potentially affect the copy's ability to affect layout (e.g. position: absolute). The copy will end up being unseen, but will reserve the space the element would take up to help correct potential overlap issues. While the absolute placeholder is a not the most elegant solution for the problem absolute positioning presents, it does resolve these issues without having to put much thought into specifics.

There are other solutions to resolving layout issues with absolutely positioned elements as well; such as providing sufficient margins or padding to ensure content won't be at risk of overlap. As you encounter these issues, pick whichever solution is best for that situation.

Class Name Target Details
.absolute-placeholder * Required. Apply to a clone or identical element to reserve space in the document flow for an absolutely positioned element
View Source

Actions

Applies a few basic rules that make an item appear "actionable". In particular, on hover. This is a quick and easy solution for communicating to your users that an item can be interacted with.

Example

Normal Paragraph

Actionable Paragraph

<i class='ns-icon-star action'></i>

Usage

Usage is pretty straightforward, and fairly broadly utilized. Just add the class to virtually any element that doesn't have a default actionable-type state (e.g. buttons are already "actionable").

Class Name Target Details
.action div Required. Makes the element appear actionable/interactive
View Source

Borders

A set of shortcut classes for quickly applying standarized borders to elements without having to worry about thickness, color, etc.

Example

Complete borders

Partial Borders

Border rounding

Partial rounding

<div class='border-default'>border-default</div>

Usage

As with many other Global CSS atoms, this class can be applied to virtually any other element or class. So if you need a simple standardized border, this is definitely the way to go. This is a weak selector though, so it may not be able to override other classes.

Keep in mind that these classes are meant only for simple sorts of situations where you want to have a uniform look. If you are trying to create a unique border, it would be better to use styles specified to that case instead of trying to bend these borders significantly to fit the needs of a scenario.

Class Name Target Details
.border-default * Applies the default border to the entire element
.border-heavy * Applies the heavy border to the entire element
.border-secondary * Applies the secondary border to the entire element
.border-dashed * Applies the dashed border to the entire element
.border-dotted * Applies the dotted border to the entire element
.border-radius-default * Applies the default border radius to the entire element
.border-radius-button * Applies the button border radius to the entire element
.border-radius-circle * Applies the circle border radius to the entire element
.border-radius-rounded * Applies the rounded border radius to the entire element
-left, -right, -top, -bottom * Add these to the end of any border style class to apply it only to that side
-top-left, -top-right, -bottom-left, -bottom-right * Add these to the end of any border radius class to apply it only to that corner
View Source

Brand

Quick access to branding assets and styling options without having to know paths or filenames. This also enables customized branding for sub-projects without much or any rewrite.

Example

<i class='brand-icon'></i>

Usage

Apply the brand-icon class to any element, ideally an 'i' tag, and it will show the NuSkin Logo.

Because of the build process and customizability of Global Styles, you could choose a different logo for your specific project, but be able to re-use code from other projects which references, "brand-icon", and not have to change much or any other code.

Class Name Target Details
.brand-icon i Required. Shows an SVG of the NuSkin or site logo
.color-brand .brand-icon Makes the logo the brand color (this is the default behavior, if unspecified)
.color-white .brand-icon Makes the logo white
.size-large .brand-icon Makes the logo a larger size
View Source

Buttons

Buttons can take on many forms and styles, and the styling for a button can be applied to several element types. Many of the button conventions such as btn-primary can also be applied to inputs.

Example

Basic Buttons

A

Button sizes

Additional Button Styles

Buttons colors-map

See all colors
<button class='btn btn-primary'> Button </button>

Usage

Button styling can be applied to several element types. Each element has its own default behavior when the btn class is applied.

Class Name Target Details
.btn button, a, i Required. Makes the element behave like a button
.btn-primary .btn Used to indicate a primary action. Generally should only be one primary button active at once. Applies the primary color and filled button style.
.btn-secondary .btn Used to indicate a secondary action. There can be multiple secondary actions. Applies the primary color and outline button style.
View Source

Checkbox

Apply custom styling to any checkbox, and even set your own icons.

Example

<fieldset>
	<input type='checkbox' id='new-checkbox-1' class='ns-checkbox btn-outline'>
	<label for='new-checkbox-1'>Checkbox Label</label>
</fieldset>

Usage

Getting the checkbox to work properly requires two structural provisions:

  1. .ns-checkbox class must be applied to a checkbox input
  2. Checkbox must have an ID
  3. Next sibling must be a label
  4. Label must have a 'for' attribute referencing checkbox ID

Class Name Target Details
.ns-checkbox input[type='checkbox'] Required. Makes the checkbox acquire custom checkbox styling.
.btn-primary .ns-checkbox Used to indicate a primary action. Generally should only be one primary button active at once. Applies the primary color and filled button style.
View Source

Disabled modifier

You can apply the "disabled" class or attribute to a handful of elements in order to make them behave as if they are disabled

Example

Disabled link Disabled Action
<button class='btn' disabled>Disabled Button</button>

Usage

Details about usage

Class Name Target Details
.disabled, [disabled] button, a, .action, .btn, input, select Required. Adds disabled behaviors such as coloration and pointer changes on hover
View Source

Icons

...

Example

Official Icons

These icons have been adopted into the the offical set and are unlikely to be removed. While the style of the icon may potentially change, the name should be reliable.

You may also notice that there are aliases for some icons. It is recommended that you use whichever name most closely matches what you are using the icon for. For instance, if it is a close button, use ns-icon-close, instead of ns-icon-x.

General Icons

While we will try to make sure that all icons can be reliably used, just be aware that at some point changes are more possible for the general ones. Whenever the same icon exists in both the official and extended, the ns- prefixed icon is always preferrable.

<i class='ns-icon-check'></i>

Usage

Class Name Target Details
.ns-checkbox input[type='checkbox'] Required. Makes the checkbox acquire custom checkbox styling.
.btn-primary .ns-checkbox Used to indicate a primary action. Generally should only be one primary button active at once. Applies the primary color and filled button style.
View Source

ns-icon-x

ns-icon-close

ns-icon-logout

ns-icon-search

ns-icon-help

ns-icon-feedback

ns-icon-plus

ns-icon-minus

ns-icon-circle-plus

ns-icon-circle-minus

ns-icon-circle-filled

ns-icon-circle

ns-icon-copy

ns-icon-rhombus

ns-icon-downline-blocked

ns-icon-check

ns-icon-info

ns-icon-i

ns-icon-arrow-left

ns-icon-arrow-back

ns-icon-arrow-right

ns-icon-arrow-forward

ns-icon-arrow-up

ns-icon-arrow-collapse

ns-icon-arrow-down

ns-icon-arrow-expand

ns-icon-menu

ns-icon-ellipses-menu

ns-icon-vertical-ellipses-menu

ns-icon-more

ns-icon-horizontal-ellipses-menu

icons8-alphabetical-sorting

icons8-alphabetical-sorting-2

icons8-ascending-sorting

icons8-back

icons8-calendar

icons8-calendar-2

icons8-cancel

icons8-cancel-2

icons8-checkmark-filled

icons8-circle-filled

icons8-circle-thin

icons8-clipboard

icons8-collapse-arrow

icons8-copy

icons8-cut

icons8-delete

icons8-delete-2

icons8-descending-sorting

icons8-document

icons8-document-filled

icons8-download

icons8-error

icons8-exit

icons8-expand-arrow

icons8-external-link

icons8-external-link-filled

icons8-file

icons8-file-filled

icons8-folder

icons8-folder-filled

icons8-forward

icons8-help

icons8-home

icons8-home-filled

icons8-idea

icons8-idea-filled

icons8-image-file

icons8-image-file-filled

icons8-info

icons8-key

icons8-key-filled

icons8-lock

icons8-lock-filled

icons8-menu

icons8-menu-2

icons8-message-filled

icons8-minus

icons8-minus-math

icons8-more

icons8-multiply

icons8-numerical-sorting

icons8-open-folder

icons8-open-folder-filled

icons8-paste

icons8-paste-special

icons8-pencil

icons8-phone

icons8-picture

icons8-picture-filled

icons8-pin-2

icons8-pin-3

icons8-plus

icons8-plus-math

icons8-rating

icons8-rating-filled

icons8-repeat

icons8-reversed-numerical-sorting

icons8-rhombus

icons8-save

icons8-search

icons8-settings

icons8-settings-filled

icons8-sort-down

icons8-sort-up

icons8-star

icons8-star-filled

icons8-synchronize

icons8-talk-filled

icons8-unchecked-checkbox

icons8-unlock

icons8-unlock-filled

Inputs

There are a variety of input types in HTML from radio buttons to text inputs. Right now, we'll focus only on those which are essentially text input.

Example

<fieldset>
	<label for='standard-input'>Field Label</label>
	<input name='standard-input' class='ns-input'>
</fieldset>

Usage

ns-input can be applied to any element, though it is optimized for input elements. Some input elements currently automatically acquire styling if their type is text, tel, date, search, number, password, or email.

Class Name Target Details
.ns-input * Required. Makes an element behave like an ns-input
View Source

Modal

A Modal is a view which takes over the entire viewport and draws focus to itself using a scrim.

Example

ADR Timing

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed in justo non turpis vulputate semper. Donec venenatis sapien id libero maximus pharetra. Suspendisse vestibulum sapien eu semper pharetra. Suspendisse laoreet risus ac diam aliquet, et congue mauris euismod. Sed nec tempus tortor. Aenean congue ante eget pulvinar eleifend. Fusce porttitor sem a vehicula consequat. Praesent dui lacus, porttitor et metus ut, mollis accumsan neque. Nulla sed nibh sed mi vulputate posuere at et nunc. Pellentesque euismod lectus nec arcu gravida efficitur. Ut mattis, quam non luctus euismod, massa diam consequat urna, nec blandit lacus sapien a urna. Aliquam sollicitudin rhoncus nulla, a pellentesque lorem consectetur sed. Curabitur fringilla finibus orci ut luctus. Curabitur iaculis nibh at turpis venenatis imperdiet. Curabitur egestas vehicula auctor.

Cras id feugiat lacus, sit amet molestie arcu. Nunc lacus odio, efficitur id magna eget, convallis aliquet orci. Vivamus mollis ante non tempus condimentum. Suspendisse eget suscipit nulla, luctus dignissim ipsum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In hac habitasse platea dictumst. Nunc quis elit vel lorem consequat pulvinar. Phasellus nec neque sed elit interdum scelerisque quis non mauris. Suspendisse urna augue, feugiat eu ultricies at, interdum quis lorem. Duis velit felis, scelerisque eget tincidunt sed, dapibus nec tortor. Cras vel risus arcu.

<div class='scrim'>
	<aside class='modal'>
		<header>Modal Header</header>
	</aside>
</div>

Usage

A best practice for modals would be to use an aside and a scrim as shown here. However, the modal class will work on many tags, and a scrim is not required. The modal spec also defines default behavior for standard elements that might appear inside of it.

Class Name Target Details
.scrim * Creates a transparent fixed full-viewport overlay
.modal aside Required. Makes up the actual modal view, with a z-index establishing it above everything else on the page.
View Source

Radios

Apply custom styling to any radio button or radio set, and even set your own icons.

Example

<fieldset>
	<label>Select an Option:</label>
	<fieldset class='seamless ns-radio-set'>
		<fieldset>
			<input type='radio' name='new-radio-set' class='ns-radio btn btn-outline' id='ns-radio-1'>
			<label for='ns-radio-1'>Option 1</label>
		</fieldset>
		<fieldset>
			<input type='radio' name='new-radio-set' class='ns-radio btn btn-outline' id='ns-radio-2'>
			<label for='ns-radio-2'>Option 2</label>
		</fieldset>
	</fieldset>
</fieldset>

Usage

Getting the radio to work properly requires two structural provisions:

  1. .ns-radio class must be applied to a radio input
  2. Radio must have an ID
  3. Next sibling must be a label
  4. Label must have a 'for' attribute referencing radio ID

Class Name Target Details
.ns-radio-set fieldset Required. Makes a group of radio inputs behave like a cohesive unit
.ns-radio input[type='radio'] Required. Makes the radio acquire custom radio styling.
.btn-primary .ns-radio Used to indicate a primary action. Generally should only be one primary button active at once. Applies the primary color and filled button style.
View Source

Tables

Example

Table: Bordered-Horizontal

Actual Current Month Goal Final Goal Goal Month % Completed
Total Breakaway Volume 750,288.34 775000.00 900,000 12/2014 83%
Total Activites 750,288.34 775000.00 900,000 12/2014 83%
Passed LOIs 750,288.34 775000.00 900,000 12/2014 83%

Table: Bordered, Striped

Actual Current Month Goal Final Goal Goal Month % Completed
Total Breakaway Volume 750,288.34 775000.00 900,000 12/2014 83%
Total Activites 750,288.34 775000.00 900,000 12/2014 83%
Passed LOIs 750,288.34 775000.00 900,000 12/2014 83%

Table: Selectable Rows

Actual Current Month Goal Final Goal Goal Month % Completed
Total Breakaway Volume 750,288.34 775000.00 900,000 12/2014 83%
Total Activites 750,288.34 775000.00 900,000 12/2014 83%
Passed LOIs 750,288.34 775000.00 900,000 12/2014 83%
<table class='bordered-horizontal ns-table'>
	<thead>
		<tr>
			<th></th>
			<th>Actual</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>Total Breakaway Volume</td>
			<td>750,288.34</td>
		</tr>
		<tr>
			<td>Total Activites</td>
			<td>750,288.34</td>
		</tr>
	</tbody></table>

Usage

Class Name Target Details
.ns-table table Required. Applies some default styling to the table and allows it to use the ns-table utility classes
.bordered .ns-table ...
.striped .ns-table ...
.bordered-horizontal .ns-table ...
.table-no-outer-border .ns-table ...
.bordered-outer .ns-table ...
.dark .ns-table.striped, .ns-table.custom-striped ...
.custom-striped .ns-table ...
.no-padding .ns-table ...
.input-cells .ns-table ...
.narrow .ns-table ...
.selectable-rows .ns-table ...
.selectable-cells .ns-table ...
.font-color-light .ns-table ...
.font-color-dark .ns-table ...
.text-align-* .ns-table ...
View Source
WebDocs
Copied to clipboard!
Global Styles v1.12.1 build 829