Basic Styles

mixins

base-styles

@mixin base-styles() { ... }
View source

Description

Outputs some basic typographic styles If $use-base is true, the result of this mixin is included in the default nebula.css output.

Parameters

None.

Requires

variables

type-bold-weight

$type-bold-weight: bolder !default;
View source

Type

String

Used by

font-variants

$font-variants: ('common-ligatures', 'ordinal', 'oldstyle-nums', 'contextual') !default;
View source

Type

List

Links

fancy-ligatures-in-headings

$fancy-ligatures-in-headings: false !default;
View source

Description

Use discretionary(fancier) ligatures for headings, this might be a bit too much for certain fonts, and is therefore off by default.

Type

Boolean

Used by

Borders

mixins

border-rules

@mixin border-rules($scale: 1) { ... }
View source

Description

Prints out multiple CSS classes for each $border-properties and $border-colors. If $use-borders is true, the result of this mixin is included in the default nebula.css output.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$scale

Determines the size (in pixels) of the border. This is useful if you want to scale border sizes at a breakpoint.

Number1

Output

.n-border-accent { border: 1px solid #009CDA; }
.n-border-bottom-accent { border-bottom: 1px solid #009CDA; }

// Also works with gradients (where possible)
.n-border-gradient {
  border: 1px solid #F9A03D;
  border-image: linear-gradient(-180deg, #FBDA61 0%, #F76B1C 100%) 1;
 }
.n-border-bottom-gradient { border-bottom: 1px solid #F9A03D; }

Throws

  • Can not generate #{$propertyName} class for color “#{$color}”, because it was not found in the $colors variable.

Requires

variables

border-colors

$border-colors: () !default;
View source

Description

an array of color names that should get border classes. Nebula will then look up that color in the $colors map and use that.

Type

List

Example

$border-colors: ('accent', 'black');

Used by

border-size

$border-size: 1 !default;
View source

Description

Default size in pixels for borders when they are generated.

Type

Number

border-properties

$border-properties: ('border', 'border-bottom') !default;
View source

Description

List of properties that should be generated by @border-rules. For example, assuming the existence of an 'accent' color, the default value ('border', 'border-bottom') will generate .n-border-accent, and .n-border-bottom-accent. If one of the colors is a gradient, it will use the fallback color for every property other than border;

Type

List

Used by

Colors

mixins

color-rules

@mixin color-rules() { ... }
View source

Description

Prints out text-color and background-color classes for every $colors in Nebula's configuration. You probably only need to use this once, and If $use-colors is true, the result of this mixin is included in the default nebula.css output.

Parameters

None.

Output

// For every $color, e.g. red:
.n-color-red { color: #B5200F; }
.n-background-red { background-color: #B5200F; }

Requires

variables

colors

$colors: (
  'accent'    : #009CDA,
  'background': #FFFFFF,
  'black'     : #262626,
) !default;
View source

Type

Map

Example

// Additionally, you can pass a Sass List with a value, which allows you
// to pass along a gradient:

$colors: (
  // The first parameter is the fallback that is used for text.
  // The second the gradient that will be used
 'gradient' : (#F9A03D, linear-gradient(-180deg, #FBDA61 0%, #F76B1C 100%))
  …
)

Used by

functions

color

@function color($name) { ... }
View source

Description

Retrieves the value of a color from your configuration.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$name

Name of the color to retrieve value for.

Stringnone

Example

.special-button { background: color('accent'); }

Requires

Used by

Helper Classes

mixins

helper-classes

@mixin helper-classes() { ... }
View source

Description

Exports some basic helper classes to aid in development. If $use-helper-classes is true, the result of this mixin is included in the default nebula.css output.

Parameters

None.

Output

.n-text-centered {}  // Centers text
.n-block-centered {} // Centers a block element
.n-inline {}         // Turns a block element into an inline element
.n-clear {}          // Applies a clearfix to the element
.n--small-caps {}    // Uses small-capitals, or synthesises them if not supported by font.
.n-hide-on-mobile {} // Hides element if viewport width < `$breakpoint-hide-on-mobile`
.n-show-on-mobile {} // Shows element only if viewport width < `$breakpoint-hide-on-mobile`

Requires

List

mixins

list-classes

@mixin list-classes() { ... }
View source

Description

By default, Nebula's reset stylesheet removes any styling of lists. This allows you to use semantic lists for non-text elements.

To use traditional list, you can use the .n-ul and .n-ol classes created by this mixin. If $use-lists is true, the result of this mixin is included in the default nebula.css output.

Parameters

None.

Output

.n-ul { list-style: disc outside; }
.n-ol { list-style: decimal outside; }

Requires

Modularity

variables

use-reset

$use-reset: true !default;
View source

Description

Toggles the creation of reset classes in the output css

Type

Boolean

use-base

$use-base: true !default;
View source

Description

Toggles the output of basic styling and typography in the output css

Type

Boolean

See

use-borders

$use-borders: true !default;
View source

Description

Toggles the output of border classes in the output css

Type

Boolean

See

use-colors

$use-colors: true !default;
View source

Description

Toggles the output of color classes in the output css

Type

Boolean

See

use-helper-classes

$use-helper-classes: true !default;
View source

Description

Toggles the output of basic helper classes in the output css

Type

Boolean

See

use-lists

$use-lists: true !default;
View source

Description

Toggles the output of list-related classes in the output css

Type

Boolean

See

use-spacing

$use-spacing: true !default;
View source

Description

Toggles the output of spacing classes in the output css

Type

Boolean

See

use-typography

$use-typography: true !default;
View source

Description

Toggles the output of typography and font-size classes in the output css

Type

Boolean

See

Spacing

variables

spacing-values

$spacing-values: (
  'smallest': 5,
  'small'   : 20,
  'medium'  : 40,
  'large'   : 70,
) !default;
View source

Type

Map

Used by

spacing-directions

$spacing-directions: ('top', 'bottom') !default;
View source

Description

Determines which extra “directions” to generate spacing classes for (besides “all”, vertical, and horizontal)

Type

List

Example

.n-spacing-top-medium {}
.n-spacing-bottom-medium {}
.n-padding-top-medium {}
.n-padding-bottom-medium {}

Used by

mixins

scale-spacing

@mixin scale-spacing($vSpacingScale) { ... }
View source

Description

Generate spacing rules for a specific scale. This will take the value defined for each item in $spacing-values, and multiply it by a number. Useful for adjusting spacing at different breakpoints. If either parameter is left empty, spacing for that direction will not be affected (see rules-for-space-value). If $use-spacing is true, the output this mixin with the parameters scale-spacing(1,1) is included in the default nebula.css output.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$vSpacingScale

Multiplier for the vertical spacing that is generated. Optional.

Numbernone

Output

  // Assuming, and the example above:
  $spacing-values: ('medium': 20, 'large': 40);

  @include scale-spacing(1.5, 1);
  // results in:
  @include rules-for-space-value('medium', 30, 20);
  @include rules-for-space-value('large', 60, 40);

  @include scale-spacing(.5);
  // results in:
  @include rules-for-space-value('medium', 10, 10);
  @include rules-for-space-value('large', 20, 20);

Requires

rules-for-space-value

@mixin rules-for-space-value($name, $vvalue, $hvalue) { ... }
View source

Description

Mixin that prints out multiple CSS classes for managing spacing between and within elements. Depending on values in the $spacing-directions list, it will generate additional classes for specific directions. By default this adds spacing classes for the top and bottom.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$name

The size's 'name', will be represented in the classname generated

Stringnone
$vvalue

Amount of vertical spacing applied

Numbernone
$hvalue

Amount of horizontal spacing applied

Numbernone

Output

.n-spacing-$name {}  // (margin on all sides)
.n-vspacing-$name {} // (vertical margins only)
.n-hspacing-$name {} // (horizontal margins)
.n-padding-$name {}  // (padding on all sides)
.n-vpadding-$name {} // (vertical padding only)
.n-hpadding-$name {} // (horizontal padding)

// For working with items in a grid:
.n-frame-$name    {} // (negative margins)

// Additionally, based on $spacing-directions:
.n-spacing-top-$name {}
.n-spacing-bottom-$name {}
.n-padding-top-$name {}
.n-padding-bottom-$name {}

// If either `$vvalue` or `$hvalue` parameter is left empty,
// the mixin wil omit output regarding that direction:
 @include rules-for-space-value('medium', null, 40);
 // Outputs:
 .n-spacing-medium  { margin-left: 40px;  margin-right: 40px; }
 .n-hspacing-medium { margin-left: 40px;  margin-right: 40px; }
 .n-padding-medium  { padding-left: 40px; padding-right: 40px; }
 .n-hpadding-medium { margin-left: 40px;  margin-right: 40px; }

Requires

Used by

See

functions

space

@function space($name) { ... }
View source

Description

Retrieves the value of a spacing value from your configuration. Please note that this value does not scale when @include scale-spacing() is used.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$name

Name of the spacing value to retrieve value for.

Stringnone

Used by

Typography

variables

body-line-height

$body-line-height: 1.4 !default;
View source

Type

Number

Used by

font-base-sizes

$font-base-sizes: (
  'normal'  : 18,
  'small'   : 15,
  'smallest': 12.5,
) !default;
View source

Type

Map

Used by

header-line-height

$header-line-height: 1.2 !default;
View source

Type

Number

Used by

header-base-sizes

$header-base-sizes: (31, 26, 21.5) !default;
View source

Type

List

Used by

mixins

scale-type

@mixin scale-type($bodyTextScale: 1, $headerTextScale: $bodyTextScale) { ... }
View source

Description

Generates typography classes for a scale parameter. This looks up every font size and multiplies it with the scale value. Useful for adjusting font size at a breakpoint.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$bodyTextScale

Scale multiplier for body text (based on $font-base-sizes)

Number1
$headerTextScale

Scale multiplier for header texts (based on $header-base-sizes)

Number$bodyTextScale

Example

@media screen and (min-width: $breakpoint-widescreen) {
  @include scale-type($bodyTextScale: 1.2);
}

Output

  @media screen and (min-width: 1280px) {
    body { font-size: 21.6px; }
    .n-type-normal { font-size: 21.6px; }
    .n-type-small { font-size: 18px; }
    .n-type-smallest { font-size:  12.52px; }
    h1, .n-type-h1 { font-size: 37.2px; }
    h2, .n-type-h2 { font-size: 31.2px; }
    h3, .n-type-h3 { font-size: 25.2px; }
  }

Requires

functions

font-size

@function font-size($name) { ... }
View source

Description

Retrieves the value of a font size from your configuration. Please note that this value does not scale when @include scale-type() is used.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$name

Name of the font size to retrieve value for.

Stringnone

Example

footer { font-size: font-size('small'); }

See

General

variables

class-prefix

$class-prefix: 'n' !default;
View source

Description

The text prefixed to all of the classes generated by Nebula. In some cases you might change this to something like L or UI.

Type

String

Used by

breakpoint-hide-on-mobile

$breakpoint-hide-on-mobile: 400px !default;
View source

Description

Used together with the .n-hide-on-mobile and .n-show-on-mobile classes, will either hide or show content depending on the value of this breakpoint.

Type

Number

See

Used by

breakpoint-mobile

$breakpoint-mobile: 400px !default;
View source

Type

Number

breakpoint-tablet

$breakpoint-tablet: 700px !default;
View source

Type

Number

breakpoint-widescreen

$breakpoint-widescreen: 1200px !default;
View source

Type

Number