1ABOUT BUILDER CSS

Source: builder.scss

A 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
  1. Format your text content using basic HTML tags. (h1–h6, p, etc.)
  2. Create a layout by adding the .layout class to a parent element such as a div.
  3. Use modifier classes to change the size, spacing, and alignment of elements to create different layout patterns.
  4. Add responsive suffixes to target styles to specific views and make your layout responsive.

1CONTENT

Source: content/_content.scss
Basic HTML element and typography-related styles and modifiers.

Elements

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—Headers

Source: content/_content.scss

See 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.scss

See 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.scss
Use modifier classes to modify the default styles of elements.

Modifiers—List Style

Source: content/modifiers/_modifiers.scss

Remove default styling from ul and ol lists.

  • .plain

Modifiers—Target Area

Source: content/modifiers/_modifiers.scss

Usability / 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.scss
  • .uppercase
  • .italic or .em (or just use <em> HTML tag)

Modifiers—Text Weight

Source: content/modifiers/_modifiers.scss
  • .normal
  • .bold or .strong (Or just use HTML <strong> tag.)
  • .heavy

Modifiers—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.scss

Simple 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.scss

Animations 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.

Keyframe Animations

  • .animate-expand
  • .animate-contract
  • .animate-fade-in
  • .animate-fade-out
  • .animate-slide-up
  • .animate-slide-down
  • .animate-slide-left
  • .animate-slide-right
  • .animate-spin

Control Animation Play

  • .infinite Play animation continuously.
  • .pause Pause animation.
  • .play Play animation.

Background & Text Colors

Source: decoration/sub/_backgrounds-and-color.scss

Class Name Formats:

  • .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

Included Colors:

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.scss

Make square elements round and rectangular elements pill-shaped.

  • .round

Typography Style Overview

Source: content/_content.scss
An overview of standardized styles for headers and body text.

Font Families, Sizes, and Weights

Important: A minimum of 16px font size is needed for form fields to prevent auto zoom in iPhone.

1STRUCTURE

Source: structure/_structure.scss
The layout and arrangement of content.

Alignment

Source: structure/sub/_alignment.scss

The 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.scss
  • .align-bottoms Add to parent
  • .align-bottom Add to individual element

Align all child elements to the bottom.

Align an individual element to the bottom.

Alignment—Align Middle(s)

Source: structure/sub/_alignment.scss
  • .align-middles Add to parent
  • .align-middle Add to single element

Align all child elements to middle.

Align an individual element to the middle.

Alignment—Align Top(s)

Source: structure/sub/_alignment.scss
  • .align-tops Add to parent
  • .align-top Add to single element

Align all child elements to top.

Align an individual element to the top.

Alignment—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.scss

Stretch 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.scss

Display—Hide Content

Source: structure/sub/_display.scss

Classes 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.scss

Apply to a parent element to lay out the children.

  • .layout

Basic steps to creating layouts

  1. Create a layout context by adding the class .layout to a parent element.
  2. Add various modifier classes as needed to create different layout patterns.
  3. 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.scss

Default columns

This 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.scss

Equal width columns

These 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

Unequal width columns

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
Add various modifier classes to create common abstract layout patterns.

Media Object

"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

Flag 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

Justified Blocks

Centered Elements

Layout—Modifiers

Source: structure/sub/_layout.scss

Special classes for modifying layouts

Add Gutters

  • .gutters (default / medium gutters)
  • .gutters-hair
  • .gutters-xs
  • .gutters-sm
  • .gutters-lg
  • .gutters-xl

Reverse Column Order

  • .reverse

Add Rule Lines Between Columns

  • .ruled

Layout—Pre-baked Patterns

Source: structure/sub/_layout.scss

Instead 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

Types

  • .relative
  • .absolute
  • .fixed

Positions

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.scss

Most 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.scss

3 views (break points) are supported: “mobile”, “tablet”, and “desktop”.

Break Points:
  • mobile: 0–767px widths
  • tablet: 768px–1023px widths
  • desktop: 1024px and above widths
Widths for designers:
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:

Dev note on media query sizes: A long-standing bug with media queries using em was recently fixed in Safari 15. In light of this fix, Builder CSS has changed from using px to em for media queries.

Size

Source: structure/sub/_size.scss

Set dimensions of columns in layouts or various individual elements.

Size—Heights

Source: structure/sub/_size.scss
  • .height-100%

Screen-based heights

  • .screen-height-100%

Size—Widths

Source: structure/sub/_size.scss

Widths for individual elements

  • .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%

Widths for all child elements of a layout

Add to a .layout element to set widths for its children.

Equal width children:
  • .widths-auto
  • .widths-100%
  • .widths-1/2
  • .widths-1/3
  • .widths-1/4
  • .widths-1/5
Un-equal width children:
  • .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

See: Layout—Column & Grid for more examples

Spacing

Source: structure/sub/_spacing.scss

A 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

Spacing Sizes:

  • 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.scss

Apply 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)
  • .gutters
  • .gutters-hair
  • .gutters-xs
  • .gutters-sm
  • .gutters-lg
  • .gutters-xl
Horizontal Gutters:
  • .gutters-horizontal
  • .gutters-horizontal-hair
  • .gutters-horizontal-xs
  • .gutters-horizontal-sm
  • .gutters-horizontal-lg
  • .gutters-horizontal-xl
Vertical Gutters:
  • .gutters-vertical
  • .gutters-vertical-hair
  • .gutters-vertical-xs
  • .gutters-vertical-sm
  • .gutters-vertical-lg
  • .gutters-vertical-xl

Horizontal

Vertical

Spacing—Inner (Padding)

Source: structure/sub/_spacing.scss

Use padding to set inner spacing inside parent elements around all their content.

None:
  • .padding-none
  • .padding-top-none
  • .padding-bottom-none
  • .padding-left-none
  • .padding-right-none
Extra Small:
  • .padding-xs
  • .padding-top-xs
  • .padding-bottom-xs
  • .padding-left-xs
  • .padding-right-xs
Small:
  • .padding-sm
  • .padding-top-sm
  • .padding-bottom-sm
  • .padding-left-sm
  • .padding-right-sm
Default / Medium:
  • .padding
  • .padding-top
  • .padding-bottom
  • .padding-left
  • .padding-right
Large:
  • .padding-lg
  • .padding-top-lg
  • .padding-bottom-lg
  • .padding-left-lg
  • .padding-right-lg
Extra Large:
  • .padding-xl
  • .padding-top-xl
  • .padding-bottom-xl
  • .padding-left-xl

Spacing—Outer (Margins)

Source: structure/sub/_spacing.scss

Use margins to set outer spacing to space elements apart from each other.

Simple Margins

Apply to individual elements.

None:
  • .margin-none
  • .margin-top-none
  • .margin-bottom-none
  • .margin-left-none
  • .margin-right-none
Auto:
  • .margin-top-auto
  • .margin-bottom-auto
  • .margin-right-auto
  • .margin-left-auto
Extra Small:
  • .margin-top-xs
  • .margin-bottom-xs
  • .margin-right-xs
  • .margin-left-xs
Small:
  • .margin-top-sm
  • .margin-bottom-sm
  • .margin-right-sm
  • .margin-left-sm
Default size / Medium:
  • .margin-top
  • .margin-bottom
  • .margin-right
  • .margin-left
Large:
  • .margin-top-lg
  • .margin-bottom-lg
  • .margin-right-lg
  • .margin-left-lg
Extra Large:
  • .margin-top-xl
  • .margin-bottom-xl
  • .margin-right-xl
  • .margin-left-xl

Negative Margins

Use very sparingly.

Default / Medium:
  • .neg-margin-top
  • .neg-margin-bottom
  • .neg-margin-right
  • .neg-margin-left
Large:
  • .neg-margin-top-lg
  • .neg-margin-bottom-lg
  • .neg-margin-right-lg
  • .neg-margin-left-lg
Extra Large:
  • .neg-margin-top-xl
  • .neg-margin-bottom-xl
  • .neg-margin-right-xl
  • .neg-margin-left-xl

Spacing—Text

Source: structure/sub/_spacing.scss

Add 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

Builder CSS

No matches.