Skip to content

Latest commit

 

History

History
216 lines (149 loc) · 4.02 KB

spacing.md

File metadata and controls

216 lines (149 loc) · 4.02 KB

_spacing.scss

File includes function and mixins which add margins and paddings in many variations

List of content:

Default variables

Default variables declared in file to be used in mixins.

$spacing-sizes: (
  0: 0rem,
  1: 0.25rem,
  2: 0.5rem,
  3: 1rem,
  4: 2rem,
  5: 4rem,
  6: 8rem,
) !default;
$spacing-important: false !default;

Mixin ml

Description

Mixin which helps to add margin-left to class

Parameters

  • $size - variable which will be used as a value for margin-left (default 1)

Usage:

Assigned 2rem of left margin to class

.exampleClass {
    @include ml(4);
}

Mixin mt

Description

Mixin which helps to add margin-top to class

Parameters

  • $size - variable which will be used as a value for margin-top (default 1)

Usage:

Assigned 2rem of top margin to class

.exampleClass {
    @include mt(4);
}

Mixin mr

Description

Mixin which helps to add margin-right to class

Parameters

  • $size - variable which will be used as a value for margin-right (default 1)

Usage:

Assigned 2rem of right margin to class

.exampleClass {
    @include mr(4);
}

Mixin mb

Description

Mixin which helps to add margin-bottom to class

Parameters

  • $size - variable which will be used as a value for margin-bottom (default 1)

Usage:

Assigned 2rem of bottom margin to class

.exampleClass {
    @include mb(4);
}

Mixin mx

Description

Mixin which helps to add margin-right and margin-left to class

Parameters

  • $r - value for margin-right (default 1)
  • $l - value for margin-left (default null)

Usage:

Assigned 2rem of right margin and 1rem of left margin to class

.exampleClass {
    @include mx(4, 3);
}

Mixin my

Description

Mixin which helps to add margin-top and margin-bottom to class

Parameters

  • $t - value for margin-top (default 1)
  • $b - value for margin-bottom (default null)

Usage:

Assigned 2rem of top margin and 1rem of bottom margin to class

.exampleClass {
    @include my(4, 3);
}

Mixin m

Description

Mixin which helps to add all margins to class

Parameters

  • $t - value for margin-top (default 1)
  • $r - value for margin-right (default null)
  • $b - value for margin-bottom (default null)
  • $l - value for margin-left (default null)

Usage:

Assigned 0.25rem of top and bottom margin and 1rem of left margin to class.
Right margin wasn't assigned!

.exampleClass {
    @include m($t : 1, $b: 1, $l: 3);
}

Mixin pl

Description

Mixin which helps to add padding-left to class.
Adequate to Mixin ml

Mixin pt

Description

Mixin which helps to add padding-top to class.
Adequate to Mixin mt

Mixin pr

Description

Mixin which helps to add padding-right to class.
Adequate to Mixin mr

Mixin pb

Description

Mixin which helps to add padding-bottom to class.
Adequate to Mixin mb

Mixin px

Description

Mixin which helps to add padding-right and padding-left to class.
Adequate to Mixin mx

Mixin py

Description

Mixin which helps to add padding-top and padding-bottom to class.
Adequate to Mixin my

Mixin p

Description

Mixin which helps to add all paddings to class.
Adequate to Mixin m