Basics
Source: index.mdLightelligence Styles can be integrated to any project by installing the npm package via npm.
$ npm install @lightelligence/styles --save-dev
In your index.html
page you need to make sure you add the index.css
file :
<html>
<head>
<title>My awesome Lightelligence App</title>
<link href="node_modules/@lightelligence/styles/dist/index.css" rel="stylesheet"/>
</head>
<body>
<div class="olt-Frame">
<button class="olt-Button">Hello World</button>
</div>
</body>
</html>
The
index.css
file exist undernode_modules/@lightelligence/styles/dist/index.css
. In most cases you need to add the wholedist/
directory to yourpublic/dist
directory of your project to make those files accessible by the browser
The index.css
file itself will load the necessary fonts from dist/fonts
,
so you don't need to worry about adding those manually.
Make sure that you also wrap your content in a olt-Frame
class, which will
set defaults for most of the common elements. Part of the properties set by
olt-Frame
are colors, fonts, box-sizing
, etc.
Currently there is a bug with cssnano
, which affects users of this styleguide
to minify the output of their CSS files.
The bug is reported and the following workaround needs to be used until the external library is updated :
In package.json
file of your application please include :
{
"name": "...",
...
"cssnano": {
"preset": [
"default",
{
"calc": false
}
]
}
}
Concepts
Source: core/concepts.mdLightelligence UI relies on SUIT css naming patterns. If you got used to lowercase and dashes, it might look unfamiliar at first, but this will change very quickly because SUIT just makes sense where classic BEM either gets messy or just isn't suited, i.e. responsive utilities aren't covered by classic BEM.
Namespace
In order to prevent collisions, any of the css names get prefixed with the
olt-
namespace except for the state-classes which should never go alone.
OLT stands for OSRAM Lightelligence
Components
Component names are denoted in pascalcase
, e.g. Card
.
Syntax: olt-<Component>
Descendants
Descendant names are camelcase
. Separated by their parent component's name by
a single dash, e.g. Card-header
.
Syntax: olt-<Component> olt-<ComponentName>-<descendant>
Modifiers
Modifier names add up to the component, separated by double-dash, e.g.
Card--primary
.
Syntax: olt-<Component>--<modifier>
States
State css names are camelcase
and prefixed by is-
, e.g.
Button is-disabled
.
Syntax: olt-<Component> is-<state>
Utilities
All utility classes are camelcase
and prefixed with u-
.
You may target particular screens by adding a breakpoint-infix, e.g. md-
targets everything above. Combine multiple classes in order.
Syntax: olt-u-[sm-|md-|lg-|xl-]<utility>{Value1|Value2|...}
.
All interactive components work out of the box without the need of Javascript. Have a look at the examples to find out what is particularly needed in order to make it happen. However, you could always opt-out of this behavior by simply omitting trigger elements and control state classes via Javascript.
We support a set of Colors
Color | Name | Utility Class |
---|---|---|
Primary | olt-u-colorPrimary |
|
Secondary | olt-u-colorSecondary |
|
Info | olt-u-colorInfo |
|
Warning | olt-u-colorWarning |
|
Error | olt-u-colorError |
|
Success | olt-u-colorSuccess |
|
Light ( White ) | olt-u-colorLight |
|
Dark | olt-u-colorDark |
Screen
Source: core/screen.mdThe styleguide uses the following breakpoints :
Name | Extra small | Small | Medium | Large | Extra large |
---|---|---|---|---|---|
Breakpoint | <576px | ≥576px | ≥768px | ≥992px | ≥1200px |
Prefix | xs | sm | md | lg | xl |
In order to make your own custom stuff responsive along the lines of this
without hardcoding breakpoints in media-queries, @lightelligence/styles
provides suitable definitions as
@custom-media-rules.
@custom-media --olt-xs-down (max-width: 575.98px);
@custom-media --olt-sm-up (min-width: 576px);
@custom-media --olt-sm-down (max-width: 767.98px);
@custom-media --olt-md-up (min-width: 768px);
@custom-media --olt-md-down (max-width: 991.98px);
@custom-media --olt-lg-up (min-width: 992px);
@custom-media --olt-lg-down (max-width: 1199.98px);
@custom-media --olt-xl-up (min-width: 1200px);
Usage
@media (--olt-md-up) {
/* Styles for tablet portrait and above */
}
Please note that
@custom-media
at-rule as being part of "Media Queries Level 5" isn't supported natively by any browser today, so you will need to transpile your css for getting it to work, e.g. using postcss-custom-media.
White labeling
Source: core/white-labeling.mdLightelligence styles supports limited white labeling that can achieve the effect of having a feel of your application to match different corporate styles.
The white labeling feature includes changing the primary color :
Color | Name | CSS Custom Property |
---|---|---|
Primary | --olt-colorPrimary |
The design system's primary color that can be white labeled is exposed as CSS Custom Properties. However since there are additional shades of that color, which are mainly a mix between white and dark, there are also additional exposed CSS Custom Properties.
All those additional shades, though, can be derived by a color calculation between the Primary / Secondary and a black or white colors. See example below on how to properly use the white labeling feature with JavaScript.
:root {
/**
* The two major colors that are selectable
*/
--olt-primaryColor: #f60;
/**
* Color variations that are calculations based on the above colors.
*/
--olt-primaryColor-white-10: #fff0e6;
--olt-primaryColor-white-15: #ffe8d9;
--olt-primaryColor-white-20: #ffe0cc;
--olt-primaryColor-white-30: #ffd1b3;
--olt-primaryColor-white-40: #ffc299;
--olt-primaryColor-white-50: #ffb380;
--olt-primaryColor-white-60: #ffa366;
--olt-primaryColor-white-70: #ff944d;
--olt-primaryColor-white-80: #ff8533;
--olt-primaryColor-black-10: #1a0a00;
--olt-primaryColor-black-15: #260f00;
--olt-primaryColor-black-20: #331400;
--olt-primaryColor-black-30: #4d1f00;
--olt-primaryColor-black-40: #662900;
--olt-primaryColor-black-50: #803300;
--olt-primaryColor-black-60: #993d00;
--olt-primaryColor-black-70: #b34700;
--olt-primaryColor-black-80: #cc5200;
--olt-primaryColor-secondary-30: #562b1f;
--olt-primaryColor-secondary-40: #6e341a;
--olt-primaryColor-secondary-80: #cf5509;
/**
* Color that are exposed as read-only.
*/
--olt-readonly-secondaryColor: #0d122c;
--olt-readonly-errorColor: #fd5952;
--olt-readonly-successColor: #02bf1b;
--olt-readonly-infoColor: #46b4cd;
--olt-readonly-warningColor: #ffc94d;
--olt-readonly-lightColor: #fff;
--olt-readonly-darkColor: #000;
--olt-readonly-gray100Color: #f5f6f8;
--olt-readonly-gray200Color: #e9ecef;
--olt-readonly-gray300Color: #e3e4e5;
--olt-readonly-gray400Color: #d0d1d3;
--olt-readonly-gray500Color: #a7a8aa;
--olt-readonly-gray600Color: #58585a;
--olt-readonly-gray700Color: #343a40;
--olt-readonly-gray800Color: #2e3338;
--olt-readonly-gray900Color: #212529;
}
Avatar
Source: components/Avatar/Avatar.mdAvatars can be used with <i>
elements and occupy the olt-Avatar*
class
names.
The default avatar is primary color while size adopts to current font-size.
The Avatar can be rendered with any of the color classes :
To change the size of the Avatar you can use the size modifiers. We currently support :
small
medium
large
There are also two pre-configured aliases for semantic class naming :
olt-Avatar--user
which is the same asolt-Avatar-primary
olt-Avatar--tenant
which is the same asolt-Avatar-info
Card
Source: components/Card/Card.mdYou can use the Card component to wrap content inside a card-like block. This
component occupies olt-Card*
class names.
The card can be a div
, button
or an a
element, which makes it suitable
for actions on click, hover, etc.
Card with title, description and context icon
A Card can be additionally rendered with context icon on the top right, used for drop down menu or additional context actions.
Card with title, description, content and context icon
Any Card can contain additional content inside .olt-Card-content
if
provided.
Card with title, content and image
A Card can also have an image with an img
tag and olt-Card-image
class
name.
The Cards can be rendered with any of our background colors :
By adding olt-Card--selectable
you can make a card "selectable", which will
add additional :hover
and :active
states to it.
By adding olt-Card--edit
you can make a card "editable", which will
add an additional edit button at the top right corner as well as :hover
and :active
states to it.
Nested Cards will be shown with a border around them.
Chip
Source: components/Chip/Chip.mdChip can be used with <span>
elements and and occupy the olt-Chip*
class
names.
Clickable but no Call To Action
Tags, Attributes, Filters
Clickable but no Call To Action
Tags, Attributes, Filters
Clickable but no Call To Action
Active Tags, Attributes, Filters
Clickable but no CTA
No destructive CTA
Not Clickable
No confirmative CTA
Not Clickable
Important Notes & Announcements
Not Clickable
Chip can be rendered with different colors by adding one of the following modifiers :
--dark
--light
--primary/--active
--error
--success
--info
Disabled
Chips which are not --error
, --success
or --info
can have the is-disabled
state which will make them disabled
Selectable
Chips which are not --error
, --success
or --info
can have the --selectable
modifier which will make them selectable
Icons
Each Chip can have an icon rendered on the left or on the right side by adding
olt-Chip-icon-left
or olt-Chip-icon-right
and the desired Icon class to the component's classes.
Bubble
Each Chip can have an additional bubble rendered on the top right side by
adding --withBubble
modifier and a descendant -bubble
component inside the
Chip.
The Chip's bubble can also be an icon by adding olt-Chip-bubble-icon
and the desired icon class to the bubble element.
Bubble's colors can also be fixed with one of the additional modifier for the bubble's element. They only work with the default Chip.
olt-Chip-bubble--info
olt-Chip-bubble--success
olt-Chip-bubble--warning
olt-Chip-bubble--error
Dialog
Source: components/Dialog/Dialog.mdDialog occupies olt-Dialog*
class names. It provides a modal dialog to show any kind of content and is also utilized for dynamic lists and steppers.
The dialog changes to full screen on mobile and tablet devices.
A title of a card
Lorem ipsum dolor
<input data-toggle="dialog" id="dialog-toggle-1" type="checkbox">
<label class="olt-Button" for="dialog-toggle-1">Open</label>
<div class="olt-Dialog">
<div class="olt-Dialog-window">
<label class="olt-Dialog-close" for="dialog-toggle-1"></label>
<div class="olt-Dialog-title">Dialog Title</div>
<div class="olt-Dialog-description">This is the dialog description.</div>
<div class="olt-Dialog-content">
<div class="olt-Card">
<div class="olt-Card-header">
<h4 class="olt-Card-title">
A title of a card
</h4>
<p class="olt-Card-description">
Lorem ipsum dolor
</p>
</div>
</div>
<div class="olt-Dialog-footer">
<label class="olt-Button" for="dialog-toggle-1">Finish</label>
</div>
</div>
</div>
</div>
Filter
Source: components/Filter/Filter.mdYou can use the Filter component to show a dropdown that opens a filter popup and displays additional attributes. This component occupies olt-Filter*
class names.
You can add any element inside the filters dropdown. The --active
modifier identifies an active filter. The olt-Filter-bubble
class is used to place a bubble inside the filter intended to show the number of elements being displayed after the filter is applied.
Icon
Source: components/Icon/Icon.mdThe Icon component is an interface for the official OLT Icons. This
component occupies olt-Icon*
class names and can be used with <i>
element.
Per default, icons adjust to current color and font-size:
General
Interactive icons should be used with the primary color. For decorative and non-interactive icons (e.g. input fields) the default is gray 500.
Feedback
The new Icon set has filled and outline icons for feedback.
Three different versions indicate the importance of the warning.
Depending on the use case the icon color changes - info / warning / error.
To assign a color to the icon, use the olt-u-color*
classes as listed below.
If the icon is placed on a matching background color it has to be white.
- Circle - low:
olt-u-colorInfo
- Triangle - medium:
olt-u-colorWarning
- Rhomb - critical:
olt-u-colorError
- Circle - success:
olt-u-colorSuccess
The Icons exist in three different sizes - 24 x 24 / 16 x 16 / 12 x 12. Depending on the use case the correct icon has to be used.
olt-Icon--large
: 24 x 24 - icons that are used for decoration and standaloneolt-Icon--medium
: 16 x 16 - for input fields and sometimes for decoration, standalone and the edit action buttonolt-Icon--small
: 12 x 12 - exclusively for buttons - primary, secondary and tertiary
large (24 x 24) | medium (16 x 16) | small (12 x 12) |
---|---|---|
You can also change the size of the icon with the Font Size utility classes. This will resize the icon but without making any adjustments to account for smaller or bigger sizes. You can use:
olt-u-fontSizeXxSmall
olt-u-fontSizeXSmall
olt-u-fontSizeSmall
olt-u-fontSizeMedium
olt-u-fontSizeLarge
olt-u-fontSizeXLarge
olt-u-fontSizeXxLarge
Modal
Source: components/Modal/Modal.mdModals are used with <div>
elements and render a popup.
<input data-toggle="modal" id="modal-toggle-1" type="checkbox">
<label class="olt-Button" for="modal-toggle-1">Open</label>
<div class="olt-Modal">
<div class="olt-Modal-dialog">
<header class="olt-Modal-header">
This is a modal
</header>
<div class="olt-Modal-content">
You should really check the configuration
</div>
<footer class="olt-Modal-footer">
<label class="olt-Button olt-Button--tertiary" for="modal-demo-1">Cancel</label>
<label class="olt-Button" for="modal-toggle-1">Ok</label>
</footer>
</div>
</div>
The Modal can be rendered with different variations based on the context.
We support the following modifiers :
olt-Modal--error
olt-Modal--warning
olt-Modal--info
olt-Modal--success
olt-Modal--action
Critical modal
Use the critical Modal whenever you want to communicate an critical or error state to the user. Especially when proceeding will likely lead to an undesired outcome for the user that he is probably not aware of. E.g.: Deleting a role will lead to users being deleted from the tenant because they have no role afterward.
You should really check the configuration
<input data-toggle="modal" id="modal-toggle-2" type="checkbox">
<label class="olt-Button" for="modal-toggle-2">Open</label>
<div class="olt-Modal olt-Modal--critical">
<div class="olt-Modal-dialog">
<header class="olt-Modal-header">
Oh no! This is critical!
</header>
<div class="olt-Modal-content">
<p>You should really check the configuration</p>
</div>
<div class="olt-Modal-footer">
<label class="olt-Button olt-Button--destructive" for="modal-toggle-2">Yes, show me</label>
</div>
</div>
</div>
Warning modal
The warning Modal is used when needing to show information critical in preventing errors. e.g.: 15 of your devices have not responded, check your device management.
We detected a problem in your configuration
<input data-toggle="modal" id="modal-toggle-3" type="checkbox">
<label class="olt-Button" for="modal-toggle-3">Open</label>
<div class="olt-Modal olt-Modal--warning">
<div class="olt-Modal-dialog">
<div class="olt-Modal-header">
Attention! Here's a warning for you
</div>
<div class="olt-Modal-content">
<p>We detected a problem in your configuration</p>
</div>
<div class="olt-Modal-footer">
<label class="olt-Button olt-Button--warning" for="modal-toggle-3">Ok, show me</label>
</div>
</div>
</div>
Info modal
The info Modal can be used whenever an additional non-critical information should be provided to the user. The info will not have negative results no matter the users choice. e.g.: You have been invited to a tenant, accept or decline.
You should really check the configuration
<input data-toggle="modal" id="modal-toggle-4" type="checkbox">
<label class="olt-Button" for="modal-toggle-4">Open</label>
<div class="olt-Modal olt-Modal--info">
<div class="olt-Modal-dialog">
<div class="olt-Modal-header">
Oh! Here's some info for you
</div>
<div class="olt-Modal-content">
<p>You should really check the configuration</p>
</div>
<div class="olt-Modal-footer">
<label class="olt-Button" for="modal-toggle-4">Yes, show me</label>
</div>
</div>
</div>
Success modal
Use the success Modal to communicate a success message the user has to be made aware of.
Your configuration was approved
<input data-toggle="modal" id="modal-toggle-5" type="checkbox">
<label class="olt-Button" for="modal-toggle-5">Open</label>
<div class="olt-Modal olt-Modal--success">
<div class="olt-Modal-dialog">
<header class="olt-Modal-header">
Oh yes! Success!
</header>
<div class="olt-Modal-content">
<p>Your configuration was approved.</p>
</div>
<div class="olt-Modal-footer">
<label class="olt-Button olt-Button--confirmative" for="modal-toggle-6">Yes, show me</label>
</div>
</div>
</div>
Action modal
Use the action Modal for changes that demand active user input. e.g.: Edit the description of a tenant.
Start acting now!
<input data-toggle="modal" id="modal-toggle-6" type="checkbox">
<label class="olt-Button" for="modal-toggle-6">Open</label>
<div class="olt-Modal olt-Modal--action">
<div class="olt-Modal-dialog">
<header class="olt-Modal-header">
Action!!
</header>
<div class="olt-Modal-content">
<p>Start acting now!</p>
</div>
<div class="olt-Modal-footer">
<label class="olt-Button olt-Button--success" for="modal-toggle-5">Action</label>
</div>
</div>
</div>
In rare occasions the icon and background color of the header can be individually changed. If you use the --custom
modifier with the olt-Modal-header
element, you have to provide an icon as in the examples below. Use with care!
Your configuration was approved
<input data-toggle="modal" id="modal-toggle-7" type="checkbox">
<label class="olt-Button" for="modal-toggle-7">Open</label>
<div class="olt-Modal olt-Modal--action">
<div class="olt-Modal-dialog">
<header class="olt-Modal-header olt-Modal-header--custom olt-u-backgroundColorGray500">
<i class="olt-Icon olt-Icon-visible"></i>
Oh yes! Success!
</header>
<div class="olt-Modal-content">
<p>Your configuration was approved</p>
</div>
<div class="olt-Modal-footer">
<label class="olt-Button olt-Button--success" for="modal-toggle-7">Yes, show me</label>
</div>
</div>
</div>
Custom Header Icons
The icon can be changed while keeping the remaining styles. Also use with care!
... but watch out!
<input data-toggle="modal" id="modal-toggle-8" type="checkbox">
<label class="olt-Button" for="modal-toggle-8">Open</label>
<div class="olt-Modal olt-Modal--action">
<div class="olt-Modal-dialog">
<header class="olt-Modal-header olt-Modal-header--custom">
<i class="olt-Icon olt-Icon-visible"></i>
Action!
</header>
<div class="olt-Modal-content">
<p>... but watch out!</p>
</div>
<div class="olt-Modal-footer">
<label class="olt-Button olt-Button--action" for="modal-demo-8">I'll be careful</label>
</div>
</div>
</div>
There is an additional wide Modal which takes more space when rendered.
This is wide modal, it can accommodate more content than the smaller modal.
You can add more complex content like forms, etc.
It will scroll the content if needed.
It will also not shrink on mobile devices.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
<input data-toggle="modal" id="modal-toggle-9" type="checkbox">
<label class="olt-Button" for="modal-toggle-9">Open</label>
<div class="olt-Modal olt-Modal--wide">
<div class="olt-Modal-dialog">
<header class="olt-Modal-header">
This is a wide modal
</header>
<div class="olt-Modal-content">
<p>This is wide modal, it can accommodate more content than the smaller modal.</p>
<p>You can add more complex content like forms, etc.</p>
<p>It will also not shrink on mobile devices.</p>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
</div>
<footer class="olt-Modal-footer">
<label class="olt-Button olt-Button--tertiary" for="modal-demo-9">Cancel</label>
<label class="olt-Button" for="modal-toggle-9">Ok</label>
</footer>
</div>
</div>
Notification
Source: components/Notification/Notification.mdThe Notification is used to show a message on the bottom of the screen.
It occupies the olt-NotificationContainer
and olt-Notification*
class names,
with olt-NotificationContainer
being the container element holding the stack
of notifications.
On larger screens notifications are placed on the bottom right, on small devices only the header is displayed bottom-centered with full width. Notifications can stack up if they are not closed manually within a very short time. A notification that is not closed manually should hide automatically after a short time. For implementing the logic behind the visibility of the Notifications please use JavaScript ( check "Related JavaScript" section below for a demo ).
Like the modals the notifications got different color themes for various use cases. Depending on the use case a fitting color and icon is used.
- Info - e.g. new information became available
- Success - e.g. an action has successfully been completed
- Warning - e.g. something has not been configured correctly
- Error - e.g. communication has been interrupted
Respectively, we support the following modifiers :
olt-Notification--info
olt-Notification--success
olt-Notification--warning
olt-Notification--error
These different types will look as follows:
<div class="olt-NotificationContainer">
<div class="olt-Notification olt-Notification--info">
<div class="olt-Notification-dialog">
<header class="olt-Notification-header">Info Notification</header>
<div class="olt-Notification-content">
Everything went well.
</div>
</div>
<button type='button' class="olt-Notification-close">
<i class="olt-Icon olt-Icon--medium olt-Icon-close"></i>
</button>
</div>
<div class="olt-Notification olt-Notification--error">
<div class="olt-Notification-dialog">
<header class="olt-Notification-header">Error Notification</header>
<div class="olt-Notification-content">
Nothing went well.
</div>
</div>
<button type='button' class="olt-Notification-close">
<i class="olt-Icon olt-Icon--medium olt-Icon-close"></i>
</button>
</div>
</div>
A Notification is hidden by default. It can be rendered by adding is-open
state class at the main element. It will appear inside the
NotificationContainer, which is rendered at the bottom right of the page.
<div class="olt-NotificationContainer">
<div class="olt-Notification olt-Notification--info is-open">
<div class="olt-Notification-dialog">
<header class="olt-Notification-header">Info Notification</header>
<div class="olt-Notification-content">
Everything went well.
</div>
</div>
<button type='button' class="olt-Notification-close" />
</div>
<div class="olt-Notification olt-Notification--error is-open">
<div class="olt-Notification-dialog">
<header class="olt-Notification-header">Error Notification</header>
<div class="olt-Notification-content">
Nothing went well.
</div>
</div>
<button type='button' class="olt-Notification-close" />
</div>
</div>
The following JS snippet is used to show, hide and close notifications for the demo in this guide.
Spinner
Source: components/Spinner/Spinner.mdA loading spinner for your pending states. The Spinner occupies olt-Spinner*
class names and it scales by font-size.
The Spinner can be rendered with any of our colors :
The Spinner can be rendered in different sizes as well using the fontSize utility classes. You can use :
olt-u-fontSizeSmall
olt-u-fontSizeMedium
olt-u-fontSizeLarge
olt-u-fontSizeXLarge
olt-u-fontSizeXxLarge
StepperDialog
Source: components/StepperDialog/StepperDialog.mdStepperDialog occupies olt-StepperDialog*
class names. It provides a modal dialog to show any kind of content and is also utilized for dynamic lists and steppers.
The dialog changes to full screen on mobile and tablet devices.
<input data-toggle="stepperdialog" id="demo-1" type="checkbox">
<label class="olt-Button" for="stepper-dialog-demo-1">Open</label>
<div class="olt-StepperDialog">
<div class="olt-StepperDialog-window">
<div class="olt-StepperDialog-stepper">
<div class="olt-StepperDialog-stepper-header">Create Device Type Category</div>
<div class="olt-StepperDialog-stepper-counter">
2/5
</div>
<div class="olt-StepperDialog-stepper-step olt-StepperDialog-stepper-step--done">Select Type</div>
<div class="olt-StepperDialog-stepper-step olt-StepperDialog-stepper-step--current">Create Device</div>
<div class="olt-StepperDialog-stepper-step">Add Info</div>
<div class="olt-StepperDialog-stepper-step">Define Parameters</div>
<div class="olt-StepperDialog-stepper-step olt-StepperDialog-stepper-step--last">Set up monitoring</div>
</div>
<div class="olt-StepperDialog-content">
<label class="olt-Dialog-close" for="stepper-dialog-demo-1"></label>
<div class="olt-Dialog-title">Create the Device</div>
<div class="olt-Dialog-description">This is the dialog description. This is the dialog description. This is the dialog description.</div>
<div class="olt-Dialog-content">
<label class="olt-Label">
<input class="olt-Input" type="text" placeholder="Device Name" />
<span class="olt-Label-text">Name</span>
</label>
<label class="olt-Label">
<input class="olt-Input" type="text" placeholder="Device Location" />
<span class="olt-Label-text">Location</span>
</label>
<label class="olt-Label">
<textarea class="olt-TextArea" placeholder="Description"></textarea>
<span class="olt-Label-text">Description</span>
</label>
</div>
<div class="olt-Dialog-footer">
<label class="olt-StepperDialog-back" for="stepper-dialog-demo-1">Back</label>
<label class="olt-StepperDialog-proceed" for="stepper-dialog-demo-1">Proceed</label>
</div>
</div>
</div>
</div>
Tabs
Source: components/Tabs/Tabs.mdTabs render a tab-like navigation, with links that can point to the tab content.
olt-Tabs
- The tab barolt-Tabs-link
- The tab link
The Tabs are centered on large screens and right aligned on small screens.
The active tab is decorated via is-active
state class name.
Use the --forceScroll modifier to ensure the menu does not overflow, but scrolls whenever it is too large for the screen.
To add a gradient to show that there are more elements available, use has-gradient-left
and has-gradient-right
state class name. The gradient overlay on either side is used to indicate that more content is available outside of the visible area. note: you need a relatively positions container around the navigation for this.
Card Table
Source: content/CardTable/CardTable.mdThe CardTable component can be used to show table-like content that
is represented as a list of cards on tablet and mobile. The component occupies
olt-CardTable*
class names and must be structured with a specific layout.
Card Table on gray background:
Card Table are responsive. In desktop mode they are rendered as a table (table mode) and on tablet/mobile as a list of cards (list mode). We will refer to these modes in this document, because often modifiers or functionalities only apply to one of them.
In addition to these modes Card Table have two different underlying layout systems: flex layout and table layout. They can be enabled with the corresponding modifers: olt-CardTable--useFlexLayout
and olt-CardTable--useTableLayout
. These modifiers do only apply when the component is in table mode. In list mode they behave exactly the same.
With olt-CardTable--useFlexLayout
, every card in table mode is rendered with the flexbox layout model.
By default the Card Table component uses the flex layout to render data cards in table mode. This means that rows are rendered independent from each other. One issue with this approach is that the width of every column must be defined explicitly in order to have the same space distribution on all cards. By default all columns have a flex-basis
value of 0 which causes the available space to be distributed evenly.
In order to support more complex use cases it is possible to enable table layout rendering with olt-CardTable--useTableLayout
. Data cards will then use the same layout model as HTML-tables. This has the advantage that every card distributes the available space equally based on a common 2-dimensional grid.
Enforce table mode on smaller screens
Card Table are responsive by default. This means that the table layout changes to a list layout on smaller screens. Sometimes it might be desirable to enforce the table layout on all screens. Use olt-CardTable--alwaysTable
to achieve this.
Selectable cards
Cards do not react to mouse events by default. To make them behave like buttons, add the olt-CardTable--selectable
modifier. This modifer adds proper hover states to each card.
Adjust column sizes (table mode only)
Normally all column widths are evenly distributed. By applying the classes olt-CardTable--tableCellWidthXX
to olt-CardTable-headItem
and olt-DataCads-item
elements this can be customized. Valid values for XX
are: 5, 10, 15, 20, 25, 30, 40, 50, 60, 70, 80, 90. Be careful when not using the table layout. In flex-mode (default), those modifiers have to be added to all cardItems
and headItems
in order to avoid a broken layout.
Align header titles and card content (table mode only)
Header titles and contents in table mode are left aligned by default. To align them differently use olt-CardTable--alignCenter
and olt-CardTable--alignRight
.
Vertical align header titles and card content (table mode only)
Header titles and contents in table mode are middle/center aligned by default. To vertical align them differently use olt-CardTable--verticalAlignTop
and olt-CardTable--verticalAlignBottom
. This modifier has no effect when in list mode.
Displaying items more concisely (list mode only)
In list-mode (small screens) card items occupy the full size by default. The olt-CardTable--halfSize
modifier decreases the item size to 50%
instead of 100%
. This allows displaying content more concise.
Conditional Content
In some circumstances it's useful to show or hide content based on the current viewing mode. For those cases use olt-CardTable--tableOnly
and olt-CardTable--listOnly
.
In this example we use the modifiers on cardItems:
In this case they are applied to the content
of the cardItem
.
Increased horizontal card padding (list mode only)
For specific cases the horizontal padding of the card can the increased with olt-CardTable--largeCardPadding
. This has only an effect in list-mode.
Fixed table layout (table mode only)
By default table layout uses auto
as value for the table-layout
css property. This can be changed to fixed
by using the olt-CardTable--tableLayoutFixed
modifier. A fixed layout distributes the space between all columns evenly independent of their content. This is identical to the default behaviour of flex-mode.
Adjust Column to use minimal space (table mode only)
The table-layout enables additional options to control the width of card items. To decrease the size of a column to it's minimal width use olt-CardTable--tableCellMinimalWidth
in combination with the corresponding headItem
and cardItem
.
Fixing table layout quirks (table mode only)
Using olt-CardTable--listOnly
on the last item of a card could lead to a visual glitch in combination with olt-CardTable--useTableLayout
. The right border of a card is not applied correctly because it's impossible with css-only to figure out the last visible item inside of a card. For such cases the olt-CardTable--lastTableItem
modifier exists. An olt-CardTable-cardItem
with this modifier is styled in the same way as the last element of the row and therefor fixes the glitch.
There is an equivalent olt-CardTable--firstTableItem
modifier. It fixes the same glitch for the first visual element of a card. In contrast to the last item the usage of this modifier is rarely required, because common cases are already applied via css.
Floating List
Source: content/FloatingList/FloatingList.mdA Floating List allows to display a list of items with a gap inbetween them.
Items are floating horizontally in general, but they can wrap. In such a case the gap is also applied vertically.
Adjust the gap size
Normally a list uses 4px as a gap between elements. The --gap{size}
modifiers allow to change the default behaviour. It supports values 0, 1, 2, 4, 8, 16, 24, 32, 48, 72,and 96 for size
.
Change Alignment
By default all items are left aligned or in flex terms the content is positioned at flex-start. This can be changed with the --justifyEnd
modifier.
Image
Source: content/Image/Image.mdImages must be used with <img>
elements and give any image width: 100%
and height: auto
css styles. This gives harmony when an image is being used
Natural
Images preserve image ratio unless the --natural
-modifier is applied.
Round corners
Image also has --round
modifier, which sets border radius of the image.
InputList
Source: content/InputList/InputList.mdLink
Source: content/Link/Link.mdList
Source: content/List/List.mdList is normally used with <ul>
elements in which <li>
is contained but
can be used with arbitrary elements as well.
For Definition Lists the semantic elements are <dl>
, <dt>
and <dd>
.
The List occupies olt-List*
class names.
Unordered List
Unordered lists is the default
HTML unordered list
with extra styles that match this styleguide. Semantic tag for starting this
list is <ul>
.
No additional modifiers are necessary in order to make an unordered list.
Ordered List
Same as Unordered list above, it represents
HTML ordered list
with extra styles that match this styleguide. Semantic tag for ordered list is
<ol>
.
In order to produce Ordered list, you need to add --ordered
modifier.
Definition List
The definition list represents
HTML definition list.
Semantic tag for definition list is <dl>
.
The definition list works with additional modifier --definition
next to the
olt-List
class.
Definition list with 2 columns
You can display a definition list in 2 columns with the --2columns
modifier.
The modifier is responsive:
olt-List--xs-2columns
for only extra small screenolt-List--sm-2columns
for <= small screenolt-List--lg-2columns
for <= large screenolt-List--xl-2columns
for all screens
Vertically stacked definition list
You can display a definition list vertically stacked in a single column with
the --vertical
modifier. The modifier is responsive as well :
olt-List--xs-vertical
for only extra small screenolt-List--sm-vertical
for <= small screenolt-List--lg-vertical
for <= large screenolt-List--xl-vertical
for all screens
It can be combined with --2columns
modifier.
Paragraph
Source: content/Paragraph/Paragraph.mdParagraphs are used with <p>
elements and are styled with harmonized spacing
between them. Paragraph uses olt-Paragraph
class name.
You can modify the color of the paragraph by using the color utility classes. You can use :
olt-u-colorPrimary
olt-u-colorSecondary
olt-u-colorInfo
olt-u-colorSuccess
olt-u-colorError
olt-u-colorDark
olt-u-colorWhite
Checkbox
Source: controls/Checkbox/Checkbox.mdCheckbox is used with a wrapped <label>
element that contain
<input type="checkbox"/>
. It occupies olt-Checkbox*
class names.
The checkbox control is a native browser input[type="checkbox"]
so you can
apply disable
, checked
attributes directly to the input field
To set the indeterminate state of a checkbox you can either use the olt-Checkbox--indeterminate
class or set the :indeterminate
pseudo-class active via Javascript. Note: Activating the pseudo-class cannot be done with HTML.
Copyable
Source: controls/Copyable/Copyable.mdCopyable occupies olt-Copyable*
class names and adds a copy-to-clipboard icon to any element
Dropdown
Source: controls/Dropdown/Dropdown.mdYou can use the Dropdown component to show a dropdown that opens popup and displays a list of values to choose. This component occupies olt-Dropdown*
class names.
In contrast to the select, the dropdown displays a content div element instead of the native select
element.
The dropdown supports dark mode by putting it inside a Card element with olt-Card--dark
and olt-Theme-dark
classes.
The olt-Dropdown-selected-content
and the --selected
modifier are used when an element is selected and displayed as content in the dropdown.
Input
Source: controls/Input/Input.mdInput is used with a wrapped <label>
element that contain
<input />
. It occupies olt-Input*
class names.
By default the input label is not floating meaning even without an
input value or without focus the label stays on top of the input.
To have a floating label the olt-Label--floating
class has to
be added to the label
element. When the input contains a value
the has-value
class has to be set additionally in order to move
the label text on top of the input.
The input field can be disabled. The styles of the label and additional elements will change accordingly.
Setting the input element as required appends *
to the label.
The input can render an icon on its right side. It has different colors when the input is empty, contains a value or is disabled.
For inputs that are limited to a certain amount of characters you can render that information for better user experience.
If the user input is invalid the error can be indicated by adding
the has-error
class to the label. The color of the input and label
change. The error messsage can be displayed below the input.
If the user input is validated a hint can be shown below the input for better user experience.
Label
Source: controls/Label/Label.mdLabel represents a label in form fields, input fields, etc. Label is normally
used with <label>
elements and occupies olt-Label*
class names.
Check Input or Select for information on how to use Label together with input elements.
By default the label is not floating meaning even without an
input value or without focus the label stays on top of the input.
To have a floating label the olt-Label--floating
class has to
be added to the label
element. When the input contains a value
the has-value
class has to be set additionally in order to move
the label text on top of the input.
When an input element contains a value the has-value
class has to be
added to the label
.
If the user input is invalid the error can be indicated by adding
the has-error
class to the label. The colors of the contained
elements change accordingly.
Radio
Source: controls/Radio/Radio.mdRadio is used with a wrapped <label>
element that contain
<input type="radio"/>
. It occupies olt-Radio*
class names.
The radio control is a native browser input[type="radio"]
so you can apply
disable
, checked
attributes directly to the input field
You can use several radios as a radio group by using the same name
for all
of them as in the
HTML radio specs.
Select
Source: controls/Select/Select.mdSelect is used with a wrapped <label>
element that contain
<select />
. It occupies olt-Select*
class names.
By default the input label is not floating meaning even without an
input value or without focus the label stays on top of the input.
olt-Label--floating
class has to be added to the input label
.
When the input contains a value the has-value
class has to be set
additionally in order to move the label text on top of the input.
The select field can be disabled. The styles of the label and additional elements will change accordingly.
Setting the select element as required appends *
to the label.
If the user input is invalid the error can be indicated by adding
the has-error
class to the label. The color of the input and label
change. The error messsage can be displayed below the input.
If the user input is validated a hint can be shown below the input for better user experience.
The pagination use-case is an exception from the above button rules and uses the olt-Select--pagination
modifier. This will show a border around the element.
TextArea
Source: controls/TextArea/TextArea.mdInput is used with a wrapped <label>
element that contains
<textarea />
. It occupies olt-TextArea*
class names.
By default the input label is not floating meaning even without an
input value or without focus the label stays on top of the input.
To have a floating label the olt-Label--floating
class has to
be added to the label
element. When the input contains a value
the has-value
class has to be set additionally in order to move
the label text on top of the input.
The input field can be disabled. The styles of the label and additional elements will change accordingly.
Setting the input element as required appends *
to the label.
For inputs that are limited to a certain amount of characters you can render that information for better user experience.
If the user input is invalid the error can be indicated by adding
the has-error
class to the label. The color of the input and label
change. The error messsage can be displayed below the input.
If the user input is validated a hint can be shown below the input for better user experience.
Toggle
Source: controls/Toggle/Toggle.mdToggle is used with a wrapped <label>
element that contain
<input type="checkbox"/>
. It occupies olt-Toggle*
class names.
The toggle control is a native browser input[type="checkbox"]
so you can
apply disable
, checked
attributes directly to the input field
The display mode can be set to inline-flex
instead of flex
with the --inline
modifier.
To display the label on the left of the toggle button use --reversed
.
Container
Source: layout/Container/Container.mdContainer wraps content in a block and adds default padding around it, as
well as additional responsive-friendly margin on screens wider than 576px. The
Container occupies olt-Container*
class names.
In general the container occupies the full screen size minus some margin. Only on very large screens the max-width is limited to a maximum of 1248px
. You
can check the behaviour by reducing the screen size and look at the example
below :
Flexible width
By default the Container has max-width
css property which is being set,
this can be overridden by adding --fluid
modifier to the container. By default this only effects the rendering of the xl breakpoint.
No padding
You can remove the default padding of the Container by setting --noPadding
modifier class name. This will only remove the left and the right padding,
making it useful in situations where additional spacing is not needed.
Frame
Source: layout/Frame/Frame.mdA Frame represents the entry point of your application. It is usually applied
to the <body>
or <html>
of the document. Use Frame to inject fonts and basic
typography into your site. It is used with the olt-Frame
class name.
Styles applied by Frame globally :
- Font family and weight, as well as line height
- Enables font smoothing where available
- Changes the box model to
border-box
Frame also provides site layout building blocks : header
, footer
,
body
and main
. Below is example layout using Frame component.
Grid
Source: layout/Grid/Grid.mdGrid is our main layout component, which can be used to create responsive
grid layouts of your application. It occupies olt-Grid*
class names.
Grid implements typical 12-columns based grid by using Flexbox
Grid is used with typically a div.olt-Grid
having div.olt-Grid-item
nested inside.
Note: The grid applies the gutter vertically and horizontally by default.
Fixed size columns
You can specify the column size of each item via -item--
modifier. The
olt-Grid-item
elements must add up to 12 and can be different for each
column.
Auto size columns
With olt-Grid-item--auto
modifier, your columns get a flexible width, based
on their content.
Offsets
You can use olt-Grid-item--offset
modifier to specify if a column should take
pre-defined space before being rendered.
Responsive modifiers
All modifiers of the Grid item can be used per breakpoint in order to create different visual representation on different screen sizes. The prefixes are the very same used for our media queries :
Name | Extra small | Small | Medium | Large | Extra large |
---|---|---|---|---|---|
Breakpoint | <576px | ≥576px | ≥768px | ≥992px | ≥1200px |
Prefix | xs | sm | md | lg | xl |
Here is a table of how to use the Grid's modifiers with the prefixes above :
Prefix | Column fixed size | Column auto size | Offset |
---|---|---|---|
xs | olt-Grid-item--xs-1 |
olt-Grid-item--xs-auto |
olt-Grid-item--xs-offset1 |
sm | olt-Grid-item--sm-1 |
olt-Grid-item--sm-auto |
olt-Grid-item--sm-offset1 |
md | olt-Grid-item--md-1 |
olt-Grid-item--md-auto |
olt-Grid-item--md-offset1 |
lg | olt-Grid-item--lg-1 |
olt-Grid-item--lg-auto |
olt-Grid-item--lg-offset1 |
xl | olt-Grid-item--xl-1 |
olt-Grid-item--xl-auto |
olt-Grid-item--xl-offset1 |
Try checking the example below in another page and change the screen size accordingly to get a feeling of how the grid works.
Note: You can open the example in an external tab by clicking the Example button on top left.
Align Items
Source: utils/alignItems/alignItems.mdolt-u-[sm-|lg-|md-|xl-]alignItems{Start|Center|End|Stretch|Baseline}
Align items utility can be used to set the align-items
property of an
element. It is helpful for making custom
Flexbox
layouts.
Class name | CSS properties |
---|---|
olt-u-alignItemsStart |
align-items: flex-start |
olt-u-alignItemsCenter |
align-items: center |
olt-u-alignItemsEnd |
align-items: flex-end |
olt-u-alignItemsStretch |
align-items: stretch |
olt-u-alignItemsBaseline |
align-items: baseline |
Align items can also be used with the default screen prefixes :
Prefix | Example | Description |
---|---|---|
xs | olt-u-xs-alignItemsStart |
Will set align-items: flex-start on the element when rendered on extra small screen |
sm | olt-u-sm-alignItemsCenter |
Will set align-items: center on the element when rendered on a small screen |
md | olt-u-md-alignItemsStart |
Will set align-items: flex-start on the element when rendered on a medium sized screen |
lg | olt-u-lg-alignItemsEnd |
Will set align-items: flex-end on the element when rendered on a large screen |
xl | olt-u-xl-alignItemsStart |
Will set align-items: flex-start on the element when rendered on extra large screen |
Background Color
Source: utils/background/background.mdolt-u-[sm-|md-|lg-|xl-]backgroundColor{Primary|Secondary|Info|Error|Success}
Background Color utility can be used to set background-color
property of
an element. It is helpful when you want to use one of the default colors on
a custom HTML element.
It supports all of our conceptual colors :
Class name | Sets background color to |
---|---|
olt-u-backgroundColorPrimary |
|
olt-u-backgroundColorSecondary |
|
olt-u-backgroundColorInfo |
|
olt-u-backgroundColorError |
|
olt-u-backgroundColorSuccess |
|
olt-u-backgroundColorGray100 |
|
olt-u-backgroundColorGray200 |
|
olt-u-backgroundColorGray300 |
|
olt-u-backgroundColorGray400 |
|
olt-u-backgroundColorGray500 |
|
olt-u-backgroundColorGray600 |
|
olt-u-backgroundColorGray700 |
|
olt-u-backgroundColorGray800 |
|
olt-u-backgroundColorGray900 |
Background color can also be used with the default screen prefixes :
Prefix | Example | Description |
---|---|---|
xs | olt-u-xs-backgroundColorPrimary |
Will set primary background color on the element when rendered on extra small screen |
sm | olt-u-sm-backgroundColorSecondary |
Will set secondary background color on the element when rendered on a small screen |
md | olt-u-md-backgroundColorPrimary |
Will set primary background color on the element when rendered on a medium sized screen |
lg | olt-u-lg-backgroundColorError |
Will set error background color on the element when rendered on a large screen |
xl | olt-u-xl-backgroundColorInfo |
Will set info background color on the element when rendered on extra large screen |
Border
Source: utils/border/border.mdolt-u-[sm-|md-|lg-|xl-]border[Top|Right|Bottom|Left][None]
Border utility can be used to set border
property of an element. It sets the
default border width and the default border color and can be easily combined
with Border Color utility.
The default border-width is
1px
and the default border color is#e3e4e5
Class name | CSS Properties |
---|---|
olt-u-border |
border: 1px solid #E3E4E5; |
olt-u-borderTop |
border-top: 1px solid #E3E4E5; |
olt-u-borderRight |
border-right: 1px solid #E3E4E5; |
olt-u-borderBottom |
border-bottom: 1px solid #E3E4E5; |
olt-u-borderLeft |
border-left: 1px solid #E3E4E5; |
olt-u-borderNone |
border: none; |
olt-u-borderTopNone |
border-top: none; |
olt-u-borderRightNone |
border-right: none; |
olt-u-borderBottomNone |
border-bottom: none; |
olt-u-borderLeftNone |
border-left: none; |
Border can also be used with the default screen prefixes :
Prefix | Example | Description |
---|---|---|
xs | olt-u-xs-border |
Will set border on the element when rendered on extra small screen |
sm | olt-u-sm-borderTop |
Will set top border the element when rendered on a small screen |
md | olt-u-md-borderNone |
Will remove border of the element when rendered on a medium sized screen |
lg | olt-u-lg-borderBottomNone |
Will remove bottom border of the element when rendered on a large screen |
xl | olt-u-xl-borderLeft |
Will set left border on the element when rendered on extra large screen |
Border Color
Source: utils/border/border-color.mdolt-u-[sm-|md-|lg-|xl-]borderColor{Primary|Secondary|Info|Error|Success|Gray[100-900]}
Border color utility can be used to set border-color
property of an element.
Can be used in a combination with Border utility.
It supports all of our conceptual colors :
Class name | Sets border color to |
---|---|
olt-u-borderColorPrimary |
|
olt-u-borderColorInfo |
|
olt-u-borderColorError |
|
olt-u-borderColorSuccess |
|
olt-u-borderColorGray100 |
|
olt-u-borderColorGray200 |
|
olt-u-borderColorGray300 |
|
olt-u-borderColorGray400 |
|
olt-u-borderColorGray500 |
|
olt-u-borderColorGray600 |
|
olt-u-borderColorGray700 |
|
olt-u-borderColorGray800 |
|
olt-u-borderColorGray900 |
Background color can also be used with the default screen prefixes :
Prefix | Example | Description |
---|---|---|
xs | olt-u-xs-borderColorPrimary |
Will set primary border color on the element when rendered on extra small screen |
sm | olt-u-sm-borderColorSecondary |
Will set secondary border color on the element when rendered on a small screen |
md | olt-u-md-borderColorPrimary |
Will set primary border color on the element when rendered on a medium sized screen |
lg | olt-u-lg-borderColorError |
Will set error border color on the element when rendered on a large screen |
xl | olt-u-xl-borderColorInfo |
Will set info border color on the element when rendered on extra large screen |
Color
Source: utils/color/color.mdolt-u-[sm-|md-|lg-|xl-]color{Primary|Secondary|Info|Error|Success}
Color utility can be used to set color
property of
an element. It is helpful when you want to use one of the default colors on
a custom HTML element. It is similar to Background Color
utility.
It supports all of our conceptual colors :
Class name | Sets color to |
---|---|
olt-u-colorPrimary |
|
olt-u-colorSecondary |
|
olt-u-colorInfo |
|
olt-u-colorWarning |
|
olt-u-colorError |
|
olt-u-colorSuccess |
|
olt-u-colorGray100 |
|
olt-u-colorGray200 |
|
olt-u-colorGray300 |
|
olt-u-colorGray400 |
|
olt-u-colorGray500 |
|
olt-u-colorGray600 |
|
olt-u-colorGray700 |
|
olt-u-colorGray800 |
|
olt-u-colorGray900 |
Color can also be used with the default screen prefixes :
Prefix | Example | Description |
---|---|---|
xs | olt-u-xs-colorPrimary |
Will set primary the color on the element when rendered on extra small screen |
sm | olt-u-sm-colorSecondary |
Will set secondary the color on the element when rendered on a small screen |
md | olt-u-md-colorPrimary |
Will set primary the color on the element when rendered on a medium sized screen |
lg | olt-u-lg-colorError |
Will set error the color on the element when rendered on a large screen |
xl | olt-u-xl-colorInfo |
Will set info the color on the element when rendered on extra large screen |
Display
Source: utils/display/display.mdolt-u-[sm-|md-|lg-|xl-]display{None|Inline|InlineBlock|Block|Table|TableRow|TableCell|Flex|InlineFlex}
Display utility can be used to set display
property of an element. It can
be used to hide, inline elements or to create a
Flexbox
wrapper for other elements.
Class name | CSS properties |
---|---|
olt-u-displayNone |
display: none |
olt-u-displayInline |
display: inline |
olt-u-displayInlineBlock |
display: inline-block |
olt-u-displayBlock |
display: block |
olt-u-displayTable |
display: table |
olt-u-displayTableRow |
display: table-row |
olt-u-displayTableCell |
display: table-cell |
olt-u-displayFlex |
display: flex |
olt-u-displayInlineFlex |
display: inline-flex |
Display utility becomes very handy, when used in a combination with the default screen prefixes :
Prefix | Example | Description |
---|---|---|
xs | olt-u-xs-displayNone |
Will set display: none on the element when rendered on extra small screen |
sm | olt-u-sm-displayInline |
Will set display: inline on the element when rendered on a small screen |
md | olt-u-md-displayBlock |
Will set display: block on the element when rendered on a medium sized screen |
lg | olt-u-lg-displayFlex |
Will set display: flex on the element when rendered on a large screen |
xl | olt-u-xl-displayNone |
Will set display: none on the element when rendered on extra large screen |
Note: You can open the example in an external tab by clicking the Example button on top left.
Flex
Source: utils/flex/flex.mdolt-u-[sm-|md-|lg-|xl-]flex{Row|RowReverse|Column|ColumnReverse|Wrap|WrapReverse|Nowrap}
Flex utility sets flex-direction
or flex-wrap
CSS properties. It can be
used with olt-u-displayFlex
to make a
Flexbox
layout without additional class names or inline styles.
Class name | CSS properties |
---|---|
olt-u-flexRow |
flex-direction: row |
olt-u-flexRowReverse |
flex-direction: row-reverse |
olt-u-flexColumn |
flex-direction: column |
olt-u-flexColumnReverse |
flex-direction: column-reverse |
olt-u-flexWrap |
flex-wrap: wrap |
olt-u-flexWrapReverse |
flex-wrap: wrap-reverse |
olt-u-flexNowrap |
flex-wrap: nowrap |
Flex utility becomes very handy, when used in a combination with the default screen prefixes :
Prefix | Example | Description |
---|---|---|
xs | olt-u-xs-flexRow |
Will set flex-direction: row on the element when rendered on extra small screen |
sm | olt-u-sm-flexColumn |
Will set flex-direction: column on the element when rendered on a small screen |
md | olt-u-md-flexRow |
Will set flex-direction: row on the element when rendered on a medium sized screen |
lg | olt-u-lg-flexWrap |
Will set flex-wrap: wrap on the element when rendered on a large screen |
xl | olt-u-xl-flexNowrap |
Will set flex-wrap: nowrap on the element when rendered on extra large screen |
Font
Source: utils/font/font.mdolt-u-[H100 ... H500|Content|Description|Support|Code]
Class name | Reponsive | Sets the font to |
---|---|---|
olt-u-H500 |
x | Page Title |
olt-u-H400 |
x | Card Title |
olt-u-H300 |
Subtitle |
|
olt-u-H200 |
Content Title |
|
olt-u-H100 |
Stepper Title |
|
olt-u-content |
Content |
|
olt-u-description |
Description |
|
olt-u-support |
Support |
|
olt-u-code |
x | Code |
Font | L | M | S |
---|---|---|---|
Page Title (H500) |
24px, bold, 32px line height | 22px, bold, 26px line height | 20px, bold, 24px line height |
Card Title (H400) |
20px, bold, 24px line height | 20px, bold, 24px line height | 18px, bold, 20px line height |
Code |
14px, 22px line height | 14px, 22px line height | 18px, 24px line height |
Justify Content
Source: utils/justifyContent/justifyContent.mdolt-u-[sm-|md-|lg-|xl-]justifyContent{Start|Center|End|Between|Around|Evenly}
Justify Content utility sets justify-content
CSS property. It can be used
with Flex Utility to create
Flexbox
layouts.
Class name | CSS properties |
---|---|
olt-u-justifyContentStart |
justify-content: flex-start |
olt-u-justifyContentCenter |
justify-content: center |
olt-u-justifyContentEnd |
justify-content: flex-end |
olt-u-justifyContentBetween |
justify-content: space-between |
olt-u-justifyContentAround |
justify-content: space-around |
olt-u-justifyContentEvenly |
justify-content: space-evenly |
Justify Content utility becomes very handy, when used in a combination with the default screen prefixes :
Prefix | Example | Description |
---|---|---|
xs | olt-u-xs-justifyContentStart |
Will set justify-content: start on the element when rendered on extra small screen |
sm | olt-u-sm-justifyContentEnd |
Will set justify-content: end on the element when rendered on a small screen |
md | olt-u-md-justifyContentBetween |
Will set justify-content: between on the element when rendered on a medium sized screen |
lg | olt-u-lg-justifyContentEnd |
Will set justify-content: end on the element when rendered on a large screen |
xl | olt-u-xl-justifyContentStart |
Will set justify-content: start on the element when rendered on extra large screen |
Margin
Source: utils/margin/margin.mdolt-u-[sm-|md-|lg-|xl-]margin{Top|Right|Bottom|Left|X|Y}{<size>|Auto}
size
= 0|1|2|4|8|16|24|32|48|72|96
Margin utility sets margin
CSS property
Class name | CSS properties |
---|---|
olt-u-margin4 |
margin: 4px; |
olt-u-marginTopAuto |
margin-top: auto; |
olt-u-marginRight96 |
margin-right: 96px; |
olt-u-marginBottom8 |
margin-bottom: 8px; |
olt-u-marginLeftAuto |
margin-left: auto; |
olt-u-marginXAuto |
margin-left: auto; margin-right: auto; |
olt-u-marginY16 |
margin-top: 16px; margin-bottom: 16px; |
Allowed sizes are 0, 1, 2, 4, 8, 16, 24, 32, 48, 72, 96.
Margin can also be used with the default screen prefixes, where it can be very handy :
Prefix | Example | Description |
---|---|---|
xs | olt-u-xs-margin8 |
Will set margin: 8px on the element when rendered on extra small screen |
sm | olt-u-sm-marginTop16 |
Will set margin-top: 16px; on the element when rendered on a small screen |
md | olt-u-md-marginXAuto |
Will set margin-left: auto; margin-right: auto; on the element when rendered on a medium sized screen |
lg | olt-u-lg-marginBottom16 |
Will set margin-bottom: 16px; to the element when rendered on a large screen |
xl | olt-u-xl-marginLeft4 |
Will set margin-left: 4px; to the element when rendered on extra large screen |
Overflow
Source: utils/overflow/overflow.mdolt-u-[sm-|md-|lg-|xl-]overflow[X|Y]{Auto|Visible|Hidden|Scroll|Initial}
olt-u-[sm-|md-|lg-|xl-]overflowSnap
Overflow utility sets overflow
, overflow-x
and overflow-y
CSS properties.
It will also set -webkit-overflow-scrolling: touch;
to the element, when
being used.
Class name | CSS properties |
---|---|
olt-u-overflowAuto |
overflow: auto |
olt-u-overflowVisible |
overflow: visible |
olt-u-overflowHidden |
overflow: hidden |
olt-u-overflowScroll |
overflow: scroll |
olt-u-overflowInitial |
overflow: initial |
Overflow Snap
Setting olt-u-overflowSnap
will add the following CSS properties :
.olt-u-overflowSnap {
scroll-snap-type: mandatory;
scroll-snap-points-y: repeat(100vw);
scroll-snap-type: x mandatory;
}
Setting X / Y
Overflow Utility also supports setting overflow-x
and overflow-y
by adding
x
or y
to the class name :
Class name | CSS properties |
---|---|
olt-u-overflowXAuto |
overflow-x: auto |
olt-u-overflowYHidden |
overflow-y: hidden |
Overflow utility can be used as well with the default screen prefixes :
Prefix | Example | Description |
---|---|---|
xs | olt-u-xs-overflowXauto |
Will set overflow-x: auto on the element when rendered on extra small screen |
sm | olt-u-sm-overflowScroll |
Will set overflow: scroll on the element when rendered on a small screen |
md | olt-u-md-overflowYVisible |
Will set overflow-y: visible on the element when rendered on a medium sized screen |
lg | olt-u-lg-overflowScroll |
Will set overflow: scroll on the element when rendered on a large screen |
xl | olt-u-xl-overflowHidden |
Will set overflow: hidden on the element when rendered on extra large screen |
Padding
Source: utils/padding/padding.mdolt-u-[sm-|md-|lg-|xl-]padding{Top|Right|Bottom|Left|X|Y}{<size>}
size
= 0|1|2|4|8|16|24|32|48|72|96
Padding utility sets padding
CSS property
Class name | CSS properties |
---|---|
olt-u-padding4 |
padding: 4px; |
olt-u-paddingTop8 |
padding-top: 8px; |
olt-u-paddingRight96 |
padding-right: 96px; |
olt-u-paddingBottom8 |
padding-bottom: 8px; |
olt-u-paddingLeft16 |
padding-left: 16px; |
olt-u-paddingX16 |
padding-left: 16px; padding-right: 16px; |
olt-u-paddingY16 |
padding-top: 16px; padding-bottom: 16px; |
Allowed sizes are 0, 1, 2, 4, 8, 16, 24, 32, 48, 72, 96.
Margin can also be used with the default screen prefixes, where it can be very handy :
Prefix | Example | Description |
---|---|---|
xs | olt-u-xs-padding8 |
Will set padding: 8px on the element when rendered on extra small screen |
sm | olt-u-sm-paddingTop16 |
Will set padding-top: 16px; on the element when rendered on a small screen |
md | olt-u-md-paddingX24 |
Will set padding-left: 24px; padding-right: 24px; on the element when rendered on a medium sized screen |
lg | olt-u-lg-paddingBottom16 |
Will set padding-bottom: 16px; to the element when rendered on a large screen |
xl | olt-u-xl-paddingLeft4 |
Will set padding-left: 4px; to the element when rendered on extra large screen |
Text Align
Source: utils/textAlign/textAlign.mdolt-u-[sm-|md-|lg-|xl-]textAlign{Left|Center|Right|Justify|Initial}
Text Align utility sets text-align
CSS property.
Class name | CSS properties |
---|---|
olt-u-textAlignLeft |
text-align: left |
olt-u-textAlignCenter |
text-align: center |
olt-u-textAlignRight |
text-align: right |
olt-u-textAlignJustify |
text-align: justify |
olt-u-textAlignInitial |
text-align: initial |
Text Align utility can be used as well with the default screen prefixes :
Prefix | Example | Description |
---|---|---|
xs | olt-u-xs-textAlignLeft |
Will set text-align: left on the element when rendered on extra small screen |
sm | olt-u-sm-textAlignCenter |
Will set text-align: center on the element when rendered on a small screen |
md | olt-u-md-textAlignRight |
Will set text-align: right on the element when rendered on a medium sized screen |
lg | olt-u-lg-textAlignCenter |
Will set text-align: center on the element when rendered on a large screen |
xl | olt-u-xl-textAlignJustify |
Will set text-align: justify on the element when rendered on extra large screen |