1ABOUT BUILDER CSS
Source: builder.scssA lightweight, intuitive responsive CSS layout system for building web apps.
Use together with any type of frontend UI component framework or none. Create sophisticated responsive layouts quickly and easily using a combination of simple key word utility classes.
Supports modern browsers, including Edge. (IE11 support is being phased out.)
Features
Source: builder.scss- Focused on layout and utility styles. No “component” styles.
- Easy to use and understand by people with only basic CSS knowledge.
- Intuitive, easy to remember class names that work logically based on context.
How to Use
Source: builder.scss- Format your text content using basic HTML tags. (h1–h6, p, etc.)
- Create a layout by adding the
.layout
class to a parent element such as a div. - Use modifier classes to change the size, spacing, and alignment of elements to create different layout patterns.
- Add responsive suffixes to target styles to specific views and make your layout responsive.
1CONTENT
Source: content/_content.scssElements
Source: content/_content.scss“Element” styles work with plain HTML tags or by using classes of the same name.
This gives you flexibility to change visual styling separately from the underlying HTML semantics.
Elements—Anchor Links
Source: content/_content.scssElements—Headers
Source: content/_content.scssSee also: Decoration—Typography Style Overview
Use either h1–h6 HTML tags or .h1–.h6 class names.
.h1
.h2
.h3
.h4
.h5
.h6
Elements—Paragraphs
Source: content/_content.scssSee also: Decoration—Typography Style Overview
Use either an HTML p tag or .p
class name.
.p
Note: These font styles apply to other non-header text (sometimes referred to as “body” text) content by default too, not just to paragraphs.
Example of typographic elements used together:
(Any links or superscripts are only for visual examples)
Modifiers
Source: content/modifiers/_modifiers.scssModifiers—Link Style
Source: content/modifiers/_modifiers.scssRemove default styling from anchor links.
.plain
See also: Decoration: Background & Text Colors: “.inherit-color” class
Modifiers—Link Underlines
Source: content/modifiers/_modifiers.scssRemove or add anchor link underlines.
.no-underline
.underline
.underline-hover
Modifiers—List Style
Source: content/modifiers/_modifiers.scssModifiers—Target Area
Source: content/modifiers/_modifiers.scssUsability / Functionality
.expand-target
.contain-target
Expand the active clickable area of a link or button with the “expand-target” class.
Constrain the active area by adding “contain-target” to a parent element.
(Adding "relative", "absolute", or "fixed" to a parent element will also constrain the clickable area.)
Modifiers—Text Alignment
Source: content/modifiers/_modifiers.scss.text-center
(alternate class.center
can be used instead on non-.layout
elements).text-left
(alternate class.left
can be used instead).text-right
(alternate class.right
can be used instead on non-.layout
elements).text-justify
Modifiers—Text Size
Source: content/modifiers/_modifiers.scss.big
(Useful for increasing font size for emphasis. For example to create an introductory paragraph.).small
(Use either HTML<small>
tag or class name.)
Modifiers—Text Style
Source: content/modifiers/_modifiers.scssModifiers—Text Weight
Source: content/modifiers/_modifiers.scssModifiers—Text Wrapping
Source: content/modifiers/_modifiers.scss.no-wrap
(prevent text from wrapping).soft-wrap
(insert hyphens automatically to improve text wrapping).hard-wrap
(force text to wrap by breaking words without adding hyphens).truncate
(truncate long text with an ellipsis instead of wrapping)
Default text wrapping behavior:
With "soft-wrap" class:
(The lang
attribute must be specified for your HTML doc or another wrapper element for hyphenation to work)
With "hard-wrap" class:
With "no-wrap" class:
With "truncate" class:
1DECORATION
Source: decoration/_decoration.scssSimple visual styles such as backgrounds, text colors, basic animations & transitions, etc.
Note: Many styles in this category are more appropriate as part of individual component styles so only a few basic decoration styles are included.
Animations
Source: decoration/sub/_animation.scssAnimations can be triggered by adding classes directly to HTML elements or you can use JavaScript to apply and remove classes based on an action or event.
Note: Animations may make more sense as part of a specialized component so could be removed from Builder CSS in the future.
.animate-expand
.animate-contract
.animate-fade-in
.animate-fade-out
.animate-slide-up
.animate-slide-down
.animate-slide-left
.animate-slide-right
.animate-spin
.infinite
Play animation continuously..pause
Pause animation..play
Play animation.
Background & Text Colors
Source: decoration/sub/_backgrounds-and-color.scss.bg-COLORNAME
(set background color).text-COLORNAME
(set text, border, or SVG icon color)
Inherit text color:
Make an element inherit the text color of its parent. (Note: This is the default behavior for many elements so you may not need this class.)
.inherit-color
See also: Content: Modifiers—Link Style: “.plain” class
Basic:
.bg-white
,.text-white
.bg-black
,.text-black
.bg-transparent
(background use only, not for text)
Blues:
.bg-turquoise
,.text-turquoise
.bg-ocean
,.text-ocean
.bg-ink
,.text-ink
Warm colors:
.bg-cantaloupe
,.text-cantaloupe
.bg-poppy
,.text-poppy
.bg-berry
,.text-berry
.bg-buttercup
,.text-buttercup
Cool and neutral colors:
.bg-eggplant
,.text-eggplant
.bg-taupe
,.text-taupe
(Ok for decorative icons but do not use for text)
Grays (light to dark):
.bg-gray-1
,.text-gray-1
(Ok for decorative icons but do not use for actual text).bg-gray-2
,.text-gray-2
(Ok for decorative icons but do not use for actual text).bg-gray-3
,.text-gray-3
(Ok for decorative icons but do not use for actual text).bg-gray-4
,.text-gray-4
(Ok for decorative icons but do not use for actual text).bg-gray-5
,.text-gray-5
(Ok for decorative icons but do not use for actual text)
Text only colors:
.text-default
.text-subtle
.text-danger
(for error text, etc.)
Shapes
Source: decoration/sub/_borders-and-shapes.scssTypography Style Overview
Source: content/_content.scssImportant: A minimum of 16px font size is needed for form fields to prevent auto zoom in iPhone.
1STRUCTURE
Source: structure/_structure.scssAlignment
Source: structure/sub/_alignment.scssThe behavior of alignment classes can vary depending on what type of element and in what context they are applied to.
Alignment—Align Bottom(s)
Source: structure/sub/_alignment.scssAlignment—Align Middle(s)
Source: structure/sub/_alignment.scssAlignment—Align Top(s)
Source: structure/sub/_alignment.scssAlignment—Center
Source: structure/sub/_alignment.scss.center
Note: .text-center
can be used instead for centering text or for centering all text in a layout vs. centering child elements.
Apply either to parent or individual element.
Alignment—Justify
Source: structure/sub/_alignment.scss.justify
.justify-vertical
Note: .text-justify
can be used instead for justifying text or for justifying all text in a layout vs. justifying child elements.
Apply either to parent or individual element.
Alignment—Left
Source: structure/sub/_alignment.scss.text-left
- Alternate class:
.left
Note: These only affect text alignment since elements in a layout context are already left-aligned by default.
Apply either to parent or individual element.
Alignment—Right
Source: structure/sub/_alignment.scss.right
Note: .text-right
can be used instead for right-aligning text or for right-aligning all text in a layout vs. right-aligning child elements.
Apply either to parent or individual element.
Alignment—Stretch
Source: structure/sub/_alignment.scssStretch the height and width of child content elements to fill the full height and width of a layout column.
.stretch-contents
(Add to parent).no-stretch
(Add to element to stop it from stretching)
Display
Source: structure/sub/_display.scssDisplay—Hide Content
Source: structure/sub/_display.scssClasses to hide content. Add a responsive suffix to target to a specific view.
Hide an entire element and all its content:
.hide
(hide in all views).hide@mobile
.hide@tablet
.hide@desktop
Hide just the content sticking out of an element:
(Does not work with responsive suffixes)
.hide-overflow
Hide content visually but not from screen readers:
(for accessibility)
.visually-hidden
See: https://snook.ca/archives/html_and_css/hiding-content-for-accessibility https://a11yproject.com/posts/how-to-hide-content/
Make element invisible and prevent user interaction:
(Element still takes up space.)
.invisible
Display—Modify Display
Source: structure/sub/_display.scss.inline
.inline-block
.block
Floats
Source: structure/sub/_floats.scss“Float” elements, such as images, so that text and other content will wrap around them.
.float-left
.float-right
Layout
Source: structure/sub/_layout.scssApply to a parent element to lay out the children.
.layout
- Create a layout context by adding the class
.layout
to a parent element. - Add various modifier classes as needed to create different layout patterns.
- Add responsive suffixes to classes to target a specific view and to make your layout responsive.
(The “layout” class itself cannot be combined with responsive suffixes.)
Note: The layout class can be partially overridden by applying “block” class together with responsive suffixes.
Layout—Column & Grid
Source: structure/sub/_layout.scssThis is the most basic layout pattern. Simply apply the layout
class to a parent element. The gutters
class can be used to add spacing in between the columns.
Child elements (columns) are equal width by default. They will not wrap unless forced to. (IE: if they run out of room to fit on one line)
The content of default columns can stretch the columns wider. Set explicit widths to prevent this.
Layout—Column Sizes
Source: structure/sub/_layout.scssThese are columns with explicitly set equal widths. They will wrap if there are more than will fit in a row.
Setting the widths explicitly prevents content from stretching the columns wider and forces them to maintain their set width if they wrap to the next line.
You can add a width style either to a layout parent or to individual layout children. Widths applied to layout parents affect all the children inside.
Add to .layout
element:
.widths-auto
.widths-100%
.widths-1/2
.widths-1/3
.widths-1/4
.widths-1/5
These are columns with unequal widths. They will wrap if there are more than will fit in a row.
Add to .layout
element:
.widths-1/3-and-2/3
.widths-2/3-and-1/3
.widths-1/4-and-3/4
.widths-3/4-and-1/4
.widths-2/5-and-3/5
.widths-3/5-and-2/5
Layout—Example Patterns
Source: structure/sub/_layout.scss"The media object is an image to the left, with descriptive content to the right" (Note: element on left doesn't have to be an image)
http://www.stubbornella.org/content/2010/06/25/the-media-object-saves-hundreds-of-lines-of-code/
Alternative:
Use .layout-media
class. See: Layout—Pre-baked Patterns: media object
A variation of the Media Object pattern but with "the image content and text content aligned to their vertical middles".
https://csswizardry.com/2013/05/the-flag-object/
Alternative:
Use .layout-flag
class. See: Layout—Pre-baked Patterns: flag object
Reversed, Bottom-Aligned Media Object
Layout—Modifiers
Source: structure/sub/_layout.scssLayout—Pre-baked Patterns
Source: structure/sub/_layout.scssInstead of building up these common layout patterns yourself you can use these alternate keyword classes.
.layout-media
.layout-flag
Note: large (lg) and extra large (xl) size gutters don’t currently work with these pre-baked patterns. Use smaller size gutters or combine layout and modifier classes instead.
Media Object
Flag Object
Position
Source: structure/sub/_position.scss.relative
.absolute
.fixed
Use for fixed or absolutely positioned elements
Tip: Setting all positions to zero and all margins to "auto" will center elements which have a defined height and width.
.top-zero
.bottom-zero
.left-zero
.right-zero
Layers (z-index)
Change the layer of a positioned element.
(Must be combined with .relative
, .absolute
, or .fixed
class.)
Change layer to below parent:
.send-back
Change layer to above other elements.
(This will make elements one layer above a link or button which uses the “expand-target” class,)
.bring-forward
Responsive
Source: structure/sub/_responsive.scssMost CSS classes in Builder CSS work together with optional responsive suffixes which can be used to target specific responsive views.
To target a class only to a particular view add one of 3 suffixes to the end. To apply a style to all views, just use the non-suffixed class name.
To target multiple views, add multiple classes with different responsive suffixes. You can also set a “default” view using a non-suffixed class then override it for just one view by adding a second class with a responsive suffix.
Responsive—Views/Break Points
Source: structure/sub/_responsive.scss3 views (break points) are supported: “mobile”, “tablet”, and “desktop”.
- mobile: 0–767px widths
- tablet: 768px–1023px widths
- desktop: 1024px and above widths
Create design mocks using these screen widths.
- mobile: 320px (iPhone SE 2016)
- tablet: 768px (9.7-inch iPad Pro)
- desktop: 1440px (27-inch monitor)
(Note: The media query break points use em units under the hood, not px.)
Responsive Suffixes:
To target a class only to a particular view, add one of these suffixes to the end.
@mobile
@tablet
@desktop
Example usage:
Size
Source: structure/sub/_size.scssSet dimensions of columns in layouts or various individual elements.
Size—Widths
Source: structure/sub/_size.scss.width-auto
.width-100%
.width-1/2
,.width-1/3
,.width-1/4
,.width-1/5
.width-2/3
,.width-3/4
,.width-2/5
,.width-3/5
Max-width
.max-width-100%
Screen-based widths
.screen-width-100%
.screen-width-50%
Add to a .layout
element to set widths for its children.
Equal width children:
|
Un-equal width children:
|
See: Layout—Column & Grid for more examples
Spacing
Source: structure/sub/_spacing.scssA standardized range of sizes for margins, padding, and gutters.
Spacing sizes use a logarithmic scale. Starting from the base size, each following size is equal to the previous one multiplied by a constant.
Base: 12px, Constant: 1.7
- xs = 12px Extra Small
- sm = 20px Small
- md / default = 34px (Medium / the default size)
- lg = 58px Large
- xl = 99px Extra Large
(Actual spacing size styles use rem, not px.)
Spacing—In-between (Gutters)
Source: structure/sub/_spacing.scssApply gutter classes to a parent element to add margins in-between child elements.
(In-between spacing is set by default on text related elements such as p
and h1
to h6
. Use margin or gutter utility styles to override when needed.)
Gutters on all sides (Use on "layout" only)
|
Horizontal Gutters:
|
Vertical Gutters:
|
Horizontal
Vertical
Spacing—Inner (Padding)
Source: structure/sub/_spacing.scssUse padding to set inner spacing inside parent elements around all their content.
None:
|
||
Extra Small:
|
Small:
|
|
Default / Medium:
|
Large:
|
Extra Large:
|
Spacing—Outer (Margins)
Source: structure/sub/_spacing.scssUse margins to set outer spacing to space elements apart from each other.
Apply to individual elements.
None:
|
Auto:
|
|
Extra Small:
|
Small:
|
|
Default size / Medium:
|
Large:
|
Extra Large:
|
Use very sparingly.
Default / Medium:
|
Large:
|
Extra Large:
|
Spacing—Text
Source: structure/sub/_spacing.scssAdd a text space before or after content. Useful if you are using a framework or compiler that strips spaces between elements or after returns.
.space-after
.space-before