General

functions

[private] bem-separator

@function bem-separator($object) { ... }

Description

Get the the separator used between an element or a modifier for the BEM convention

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$object

Accepted values: element or modifier

Stringnone

Used by

Links

set-text-from-color

@function set-text-from-color($color) { ... }

Description

Return a dark color or a light color based on the color given. This function can be used when wanting to dynamically set the font-color based on the background color.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$color

The background color you want to get a font color for

Colornone

Returns

Hex

A light color for a dark background or a dark color for a light background

get-next-key

@function get-next-key($map, $key) { ... }

Description

Get the next key in a map. This function will return null if the key provided is the last key in the map.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$map

The target map we will be looking through

Mapnone
$key

The key where it's following key needs to be found

Stringnone

Example

Usage

$map: (
  foo: 1,
  bar: 2,
  qux: 3
);

$next-key: get-next-key($map, bar); // "qux"

mixins

[private] bem-standard

@mixin bem-standard($object, $elements) { ... }

Description

Generate the appropriate CSS to follow the BEM convention.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$object

Accepted values: element or modifier

Stringnone
$elements

The list of element(s) we'll be creating the CSS structure for

Listnone

Content

This mixin allows extra content to be passed (through the @content directive).

Requires

Used by

Links

element

@mixin element($elements) { ... }

Description

Create a Block Element following the BEM naming scheme

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$elements

A single element's name or an argument list of elements

String or Argument listnone

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Usage

.foo {
    @include element('header') {
        display: block;
    }

    @include element('body', 'footer') {
        display: inline-block;
    }
}

Output

.foo .foo__header {
    display: block;
}
.foo .foo__body, .foo .foo__footer {
    display: inline-block;
}

Requires

modifier

@mixin modifier($modifiers) { ... }

Description

Create a Block Modifier following the BEM naming scheme

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$modifiers

A single modifier's name or an argument list of modifiers

String or Argument listnone

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Usage

.bar {
    @include modifier('quarter') {
        display: inline-block;
    }

    @include modifier('full', 'half') {
        display: block;
    }
}

Output

.bar .bar--quarter {
    display: inline-block;
}
.bar .bar--full, .bar .bar--half {
    display: block;
}

Requires

object

@mixin object($name) { ... }

Description

Objects abstract out the repetitive, shared, and purely structural aspects of a UI into reusable objects. This means that things like layout, wrappers and containers, the Media Object, etc. can all exist as non-cosmetic styles that handle the skeletal aspect of a lot of UI components, without ever actually looking like designed ‘things’.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$name

Object's name

Stringnone

Content

This mixin allows extra content to be passed (through the @content directive).

component

@mixin component($name) { ... }

Description

Components are finite, discrete, implementation-specific parts of our UI that most people (users, designers, developers, the business) would be able to identify: This is a button; This is the date picker; etc.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$name

Component's name

Stringnone

Content

This mixin allows extra content to be passed (through the @content directive).

utility

@mixin utility($name) { ... }

Description

Utilities are complete single responsibility rules which have a very specific and targeted task. It is also quite common for these rules’ declarations to carry !important so as to guarantee they beat other less specific ones. They do one thing in a very heavy-handed and inelegant way. They are to be used as a last resort when no other CSS hooks are available, or to tackle completely unique circumstances, e.g. using .u-text-center to centrally align one piece of text once and once only. They are only one step away from inline styles, so should be used sparingly.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$name

Utility's name

Stringnone

Content

This mixin allows extra content to be passed (through the @content directive).

theme

@mixin theme($name) { ... }

Description

When we work with Stateful Themes (that is to say, themes that we toggle on and off) we normally do so by adding a class to the body element. Examples of this approach to theming include style- switchers (a user can toggle between different themes) and sub-sections of a site (all blog posts have one theme colour, all news pages have another theme colour, etc.). We simply add a class high up the DOM which then invokes that theme for that particular page.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$name

Theme's name

Stringnone

Content

This mixin allows extra content to be passed (through the @content directive).

scope

@mixin scope($name) { ... }

Description

Scoped contexts in CSS solve a very specific and particular problem: please be entirely certain that you actually have this problem before employing Scopes, because they can be misused and end up leading to actively bad CSS.

Oftentimes it can be useful to set up a brand new styling context for a particular section of your UI. A perfect example of this is areas of user-generated content, where some long-form/prose HTML has come from a CMS. The styling of this kind of content usually differs from the more app-like UI around it. You may have a class-heavy UI architecture to provide complex pieces of design like navigations, buttons, modals, etc., and inside all of this you may have a simple blog post which is populated via a CMS where the user writes plain text and cannot add any classes or complexity.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$name

Scope's name

Stringnone

Content

This mixin allows extra content to be passed (through the @content directive).

is

@mixin is($name) { ... }

Description

Short-lived or temporary states of the UI that need styling accordingly.

When looking at a piece of interactive UI (e.g. a modal overlay) through developer tools, we’ll probably spend some time toggling things on and off. Being able to see classes like .is-open appear and disappear in the DOM is a highly readable and very obvious way of learning about state

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$name

State's name

Stringnone

Content

This mixin allows extra content to be passed (through the @content directive).

has

@mixin has($name) { ... }

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$name

State's name

Stringnone

Content

This mixin allows extra content to be passed (through the @content directive).

See

  • [mixin] is

javascript

@mixin javascript($name) { ... }

Description

JavaScript namespaces are pretty common now, and most people tend to use them. The idea is that—in order to properly separate our concerns—we should never have styling and behaviour bound to the same hooks. To bind both technologies onto the same hook means we can’t have one without the other: our UI becomes all- or-nothing, which makes it very opinionated and inflexible.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$name

Javascript class' name

Stringnone

Content

This mixin allows extra content to be passed (through the @content directive).

fa-perfect-alignment

@mixin fa-perfect-alignment() { ... }

Description

Perfectly center a Font Awesome icon both horizontally and vertically

Parameters

None.

Used by

TODO's

  • If SASS ever officially supports @extends inside of @media queries, then this should be a placeholder. See SASS issue #1050

set-circular-size

@mixin set-circular-size($size) { ... }

Description

Create a circle around a Font Awesome icon

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$size

The size of the circle

Number [unit]none

Requires

view-container

@mixin view-container() { ... }

Description

Creates a flex box container available to specified viewsize and smaller screen sizes that will contain flex children

Parameters

None.

view-columns

@mixin view-columns($viewSize, $columns) { ... }

Description

A mixin specify the amount of columns an element should take up

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$viewSize

Accepted values: xs, sm, md, lg, xl, xxl

Stringnone
$columns

Specifies the number of columns an element should span.

Number [unitless]none

Example

SCSS Equivalent

@include span-columns($columns);

Requires

respond-only-to

@mixin respond-only-to($media_list...) { ... }

Description

Similar to respond-to(), this mixin will restrict the content to only the specified Breakpoint and will not apply to a larger Breakpoint. This mixin will take Breakpoints with no larger or smaller Breakpoints and handle them appropriately with an efficient media query.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$media_list

Breakpoints that will be individually targeted

Arglistnone

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Usage

.phablets-only {
    @include respond-only-to(sm) {
        display: block;
    }
}

CSS Output

@media only screen and (min-width: 480px) and (max-width: 767px) {
    .phablets-only {
        display: block;
    }
}

Used by

respond-from

@mixin respond-from($start, $end) { ... }

Description

The specified content will be applied only to a specific range. If the start Breakpoint is xs, then it will automatically use only the max-width.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$start

The Breakpoint the media query will be applied from

Breakpointnone
$end

The Breakpoint the media query will be applied to

Breakpointnone

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Usage

.xs-to-md {
    @include respond-from(xs, md) {
        display: block;
    }
}

CSS Output

@media only screen and (max-width: 992px) {
    .xs-to-md {
        display: block;
    }
}

respond-up

@mixin respond-up($media) { ... }

Description

Have the specified content inside of the mixin respond to the specified Breakpoint and larger. BZiON is mobile-first so everything applied to a phone will be reflected on a desktop.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$media

The Breakpoint (and larger) that will have the specified CSS rules applied to

Breakpointnone

Content

This mixin allows extra content to be passed (through the @content directive).

Example

Usage

.phablet-and-larger {
    @include respond-up(sm) {
        display: block;
    }
}

CSS Output

@media only screen and (min-width: 480px) {
    .phablet-and-larger {
        display: block;
    }
}

Used by

theme-specific

@mixin theme-specific($rule, $variable, $function: "", $nth: 0, $args...) { ... }

Description

This function loops through all of the available themes and generates the appropriate CSS based on the theme definition

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$rule

The CSS keyword that will be effected based on the theme

Stringnone
$variable

The name of the key used in the theme map

Stringnone
$function

The name of the function that will be called with call()

String""
$nth

The index that the value will belong in with respect to the call() function

Number [unitless]0
$args

The arguments that will be passed to the call() function

Arglistnone

Example

a {
    @include theme-specific("color", "hyperlink");
}
.t-light a {
    color: blue;
}

.t-dark a {
    color: yellow;
}

Usage with w/function call

a {
    @include theme-specific("color", "link-color", darken, 1, 15%);
}

Pseudo code of previous example

a {
    // We use index 1 because the fetched value is the first argument in the function call
    color: darken(<'link-color' value @ index 1>, 15%);
}

autoMarginBottom

@mixin autoMarginBottom($margin: 30px) { ... }

Description

Automatically set the margin-bottom of an element to a specified value but have the last type of that element to have margin bottom 0

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$margin

The margin bottom that will be used

Number [unit]30px

Used by

make-margin

@mixin make-margin() { ... }

Description

Automatically set the margin bottom of an element to the global setting and set the last child to have no margin bottom on the specified views

Parameters

None.

Requires

[private] __set-visible

@mixin __set-visible($hide, $min, $max) { ... }

Description

Set the visibility of a specific element to be visible or hidden based on the screen width. An element will only be visible when the screen is at the specified width. For example, if you have an element only be visible on xs, you would set the minimum and maximum screen size a phone would have. You can use pre-defined values such as $phone-min-size and $phone-max-size to stay consistent with the project. This function should not be accessed directly and instead should only be used through convenience mixins.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$hide

Whether you want to hide or display the specified element in the specified screen width. True to display the element only on the specified screen size.

Booleannone
$min

The minimum size a screen should have in order for the specified element to be displayed

Number [unit]none
$max

(Optional) The maximum size a screen should have in order for the specified element to be displayed. If no maximum or 0 is specified, then the element will be displayed on a screen size at least $min in width.

Number [unit]none

Requires

Used by

invisible

@mixin invisible($media) { ... }

Description

A mixin that will hide the specified element

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$media

Accepted view sizes: phones, phablets, tablets

Stringnone

Example

.hide-desktop-only {
    @include invisible(lg);
}

Requires

visible

@mixin visible($media) { ... }

Description

A mixin that will make the specified element

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$media

Accepted view sizes: phones, phablets, tablets

Stringnone

Example

.display-phone-only {
    @include visible(xs);
}

Requires

placeholders

fa-fw

%fa-fw { ... }

Description

A magic placeholder for Font Awesome icons to have a fixed width. This uses the same code as Font Awesome's .fa-fw class but is available as a placeholder to be used in SASS

Links

clearfix

%clearfix { ... }

Description

A placeholder for the infamous "clearfix" hack to fix floats

margin-center

%margin-center { ... }

Description

A placeholder that will automatically horizontally center a block element

Used by

no-padding-ul

%no-padding-ul { ... }

Description

A placeholder that will remove the left padding of an element. This placeholder is intended to easily remove the padding of ul or ol elements.

container

%container { ... }

Description

The master width of the website that is set through $Settings-Global-Width in _base.scss. Because this project is mobile responsive, any view sizes smaller than a desktop will have 100% width.

Requires