Importation

A single import for the entire framework

Loop is basing all its settings around the config map. Being also the case when including pieces of the framework, Loop main file becomes the only needed import.

@import 'oo-loop/loop'; // that's all

Make sure to use the correct path to the Loop node_modules. Javascript task runners can help you simplify the import, otherwise please use the following path node_modules/oo-loop/loop.

# Use of Config

Adjust your needs of the framework by updating the use property of the config map.

// the default use map
use: (
  base: true,
  headings: true,
  content: true,

  column: true,
  template: true,
  button: true,

  form: (
    input: true,
    select: false,
    checkbox: false,
    radio: false,
    toggle: false,
  ),

  container: true,
  visibility: true,
  list: true,
  misc: true,

  utilities: (
    color: true,
    typo: true,
    spacing: true,
    float: true,
    wrapper: true,
  ),
),

Update with ooUse()

Pass a config map to ooUse() to only update the use property.
This allows you to avoid going through ooCreate() gaining more readibility by not overloading the config there (depending on your preferences).

@import 'oo-loop/loop';

$ooLoop: ooUse((
  form: (
    checkbox: true, // include oo-checkbox
    radio: true, // include oo-radio
  ),
  utilities: (
    wrapper: false, // remove wrapper utilities
  )
));

@include ooCreate();

Include multiple styles at once

all form components and utilities classes can be included from the same parent property.

@import 'oo-loop/loop';

$ooLoop: ooUse((
  form: true, // include all
  utilities: false // remove all
));

@include ooCreate();

Update with ooCreate

Use the ooCreate() config to pass some preferences.

@import 'oo-loop/loop';

@include ooCreate((
  use: (
    form: true, // include all
    utilities: false // remove all
  )
));
@import 'oo-loop/loop';

@include ooCreate((
  use: (
    form: (
      select: true, // add oo-select component
    ),
    utilities: (
      typo: false, // remove typo utilities
      float: false, // remove float utilities
    )
  )
));

Update one property at a time

Use the functions ooSet() or ooPipe() to set individual properties.

@import 'oo-loop/loop';

$ooLoop: ooSet('use.utilities.wrapper', false);

$ooLoop: ooPipe(
  _set('use.form.select', true),
  _set('use.form.checkbox', true),
  _set('use.form.radio', true)
);

@include ooCreate();

# Use of mixin

Instead of using the autobuild of ooCreate(), you can include one by one the desired elements from Loop framework.

In any case, and before doing so, the initialization of $ooLoop is necessary and will be done via ooInit(). That will also give you the opportunity to set some global settings.

For the rest of the elements, keep their default style or customize them by passing new parameters.

When passing configuration to mixin, the referers this() and _this() are available. In the case of accessing global data oo() is usable.

// Here is an example

@import 'oo-loop/loop';

// Initialize Loop
@include ooInit((
  palette: (
    'dark-gray': #555,
  )
));

// Add base and set the main font-family
@include Base((
  props: (
    font-family: (Robotto, arial, serif),
  )
));

// Add headings and set some styles
@include Headings((
  props: (
    font-family: (Georgia, serif),
    color: oo('palette.darkGray'),
  )
));

// Add Button component
@include Button((
  props: (
    color: #fff,
    background-color: oo('palette.darkGray'),
  ),
  states: (
    hover: (
      background-color: ooDarken(this('button.props.backgroundColor'), 12%),
    ),
    focus: this('button.states.hover'),
  )
));

// Add Column component
@include Column();

// Add visibility classes helper
@include Visibility();

Base($config:null)

Mixin - Format your css to act the same accross all browers and set your body element. This is highly recommended!

  • $config (map) Optional
    Set the properties props and smoothing.
Use Base

Content($config:null)

Mixin - Set your html content elements.

  • $config (map) Optional
    Set the properties paragraph anchor list hr.
Use Content

Headings($config:null)

Mixin - Set your css headings.

  • $config (map) Optional
    Set the properties headings.
Use Headings

Column($config:null)

Mixin - Include the column component.

  • $config (map) Optional
    Set the map properties of column.
Use Column

Template($config:null)

Mixin - Include the template component.

  • $config (map) Optional
    Set the map properties of template.
Use Template

Button($config:null)

Mixin - Include the button component.

  • $config (map) Optional
    Set the map properties of button.
Use Button

Label($config:null)

Mixin - Include css for input label.

  • $config (map) Optional
    Set css properties of label.
Set Label

InputField($config:null)

Mixin - Include the input component.

  • $config (map) Optional
    Set the map properties of input.
Use Input

SelectField($config:null)

Mixin - Include the select component.

  • $config (map) Optional
    Set the map properties of select.
Use Select

Checkbox($config:null)

Mixin - Include the checkbox component.

  • $config (map) Optional
    Set the map properties of checkbox.
Use Checkbox

Radio($config:null)

Mixin - Include the radio component.

  • $config (map) Optional
    Set the map properties of radio.
Use Radio

Toggle($config:null)

Mixin - Include the toggle component.

  • $config (map) Optional
    Set the map properties of toggle.
Use Toggle

Container($config:null)

Mixin - Include the container classes.

  • $config (map) Optional
    Set the map properties of container.
Use Container

Visibility($config:null)

Mixin - Include the visiblity classes.

  • $config (map) Optional
    Set the map properties of visibility.
Use Visibility

Misc($config:null)

Mixin - Include the miscellaneous classes.

  • $config (map) Optional
    Set the map properties of misc.
Use Misc

Float($config:null)

Mixin - Include the float utilities.

  • $config (map) Optional
    Set the map properties of float.
Use Float

Spacing($config:null)

Mixin - Include the spacing utilities.

  • $config (map) Optional
    Set the properties of spacing.
Use Spacing

Color($config:null)

Mixin - Include the color utilities.

  • $config (map) Optional
    Set the property color in an utility format.
Use Color utilities

Typography($config:null)

Mixin - Include the typography utilities.

  • $config (map) Optional
    Set the property typo in an utility format.
Use Typo utilities

List($config:null)

Mixin - Include the list classes.

  • $config (map) Optional
    Set the properties of list.
Use List

Wrapper($config:null)

Mixin - Include the wrapper utilities.

  • $config (map) Optional
    Set the property wrapper in an utility format.
Use Wrapper

The Loop config map << >> Adjust Html elements