Text Alignment Utils

Introduction

A collection of dynamically generated text-alignment utility classes.

Class names follow the Emmet abbreviation syntax, with colons (':') replaced by two dashes (--) to follow BEM naming conventions.

Available classes

  • .u-ta--start: text-align: (left|right) (left in LTR, right in RTL)
    • [dir=ltr] .u-ta--start: text-align: left
    • [dir=rtl] .u-ta--start: text-align: right
  • .u-ta--l: text-align: left
  • .u-ta--c: text-align: center
  • .u-ta--end: text-align: (right|left) (right in LTR, left in RTL)
    • [dir=ltr] .u-ta--end: text-align: right
    • [dir=rtl] .u-ta--end: text-align: left
  • .u-tr--r: text-align: right
  • .u-ta--j: text-align: justify

Installation

Using npm:

npm i -S jigsass-utils-text

Usage

Import JigSass Utils Text into your main scss file near its very end, together with all other utilities (utilities should always be the last to be imported).

@import 'path/to/jigsass-utils-text/scss/index';

Like all other JigSass Utils, JigSass Text does not automatically generate any CSS when imported. You would need to explicitly indicate that each individual text alignment class should actually be generated in each component or object it is used in (clarification: This will include style declarations inside .foo and .bar):

// _c.foo.scss
.foo {
  @include jigsass-util(u-ta, $modifier: c); // <-- text-align: center

  ...
}
// _c.bar.scss
.bar {
  @include jigsass-util(u-ta, $modifier: j);  // <-- text-align: justify
  @include jigsass-util(u-ta, $modifier: r, $from: large); // <-- text-align: right from large bp and on.

  ...
}

Doing so helps us a great deal with portability, as no matter where we import component or object partials, the correct utility classes will be generated. Think of it as a poor man's dependency management.

Developer communication is also assisted by including "dependencies" wherever they are required, as anyone going through a partial, can easily understand how it should be marked up with just a glance.

As far as bloat goes, just don't worry about it - the actual styles will only be generated once, at the location in the cascade where the Jigsass Text partial was imported into the main file.

JigSass Text classes are responsive-enabled, using JigSass MQ and the breakpoints defined in the $jigsass-breakpoints variable.

Based on the breakpoint arguments passed to jigsass-util when including a text-alignment class, responsive modifiers are generated according to the following logic:

.u-ta--<modifier>[-[-from-<breakpoint-name>][-until-<breakpoint-name>][-misc-<breakpoint-name>]]

So, assuming the medium, large and landscape breakpoints are defined in $jigsass-breakpoints as 600px, 1024px and (orientation: landscape) respectively,

@include jigsass-util(u-ta, $modifier: end);

will generate the .u-ta--end class, which is not limited to any media-query.

@include jigsass-util(u-ta, $modifier: start, $until: medium);

will generate the .u-ta--start--until-medium class, which will be in effect at (max-width: 37.49em) and will override styles in the default class until that point.

@include jigsass-util(u-ta, $modifier: c, $from: large, $misc: landscape);

will generate the .u-ta--c--from-large-when-landscape class, which will go into effect at (min-width: 64em) and (orientation: landscape) and will override styles in the default class under these conditions.

License: MIT

Align to start

.u-ta--start

A utility class for aligning text to the horizontal start

Include with:

@include jigsass-util(u-ta, $modifier: start [, $from, $until, $misc]);

Example

<p class='fpo  u-ta--start'>
  The text in this element is aligned towards the horizontal start.
</p>

Align to left

.u-ta--l

A utility class for aligning text to the horizontal left

Include with:

@include jigsass-util(u-ta, $modifier: l [, $from, $until, $misc]);

Example

<p class='fpo  u-ta--l'>
  The text in this element is aligned towards the horizontal left.
</p>

Align to end

.u-ta--end

A utility class for aligning text to the horizontal end

Include with:

@include jigsass-util(u-ta, $modifier: end [, $from, $until, $misc]);

Example

<p class='fpo  u-ta--end'>
  The text in this element is aligned towards the horizontal end.
</p>

Align to right

.u-ta--r

A utility class for aligning text to the horizontal right

Include with:

@include jigsass-util(u-ta, $modifier: r [, $from, $until, $misc]);

Example

<p class='fpo  u-ta--r'>
  The text in this element is aligned towards the horizontal right.
</p>

Align to center

.u-ta--c

A utility class for aligning text to the horizontal center

Include with:

@include jigsass-util(u-ta, $modifier: c [, $from, $until, $misc]);

Example

<p class='fpo  u-ta--c'>
  The text in this element is aligned towards the horizontal center.
</p>

Align to justify

.u-ta--j

A utility class for justifying blocks of text

Include with:

@include jigsass-util(u-ta, $modifier: j [, $from, $until, $misc]);

Example

<p class='fpo  u-ta--j'>
  The text in this element is justified.
</p>

Text decoration Utils

Introduction

A collection of dynamically generated text-decoration utility classes.

Class names follow the Emmet abbreviation syntax, with colons (':') replaced by two dashes (--) to follow BEM naming conventions.

Available classes

  • .u-td--n: text-decoration: none
  • .u-td--u: text-decoration: underline
  • .u-td--o: text-decoration: overline
  • .u-td--l: text-decoration: line-through
  • .u-td--n:hover: text-decoration: none when hovered
  • .u-td--u:hover: text-decoration: underline when hovered
  • .u-td--o:hover: text-decoration: overline when hovered
  • .u-td--l:hover: text-decoration: line-through when hovered
  • .u-td--n:focus: text-decoration: none when focused
  • .u-td--u:focus: text-decoration: underline when focused
  • .u-td--o:focus: text-decoration: overline when focused
  • .u-td--l:focus: text-decoration: line-through when focused
  • .u-td--n:active: text-decoration: none when active
  • .u-td--u:active: text-decoration: underline when active
  • .u-td--o:active: text-decoration: overline when active
  • .u-td--l:active: text-decoration: line-through when active

Installation

Using npm:

npm i -S jigsass-utils-text

Usage

Import JigSass Utils Text into your main scss file near its very end, together with all other utilities (utilities should always be the last to be imported).

@import 'path/to/jigsass-utils-text/scss/index';

Like all other JigSass Utils, JigSass Text does not automatically generate any CSS when imported. You would need to explicitly indicate that each individual text decoration class should actually be generated in each component or object it is used in (clarification: This will include style declarations inside .foo and .bar):

// _c.foo.scss
.foo {
  @include jigsass-util(u-td, $modifier: u); // <-- text-decoration: underline

  ...
}
// _c.bar.scss
.bar {
  @include jigsass-util(u-td, $modifier: n);  // <-- text-decoration: none
  @include jigsass-util(u-td, $modifier: o, $from: large); // <-- text-decoration: overline from large bp and on.

  ...
}

Doing so helps us a great deal with portability, as no matter where we import component or object partials, the correct utility classes will be generated. Think of it as a poor man's dependency management.

Developer communication is also assisted by including "dependencies" wherever they are required, as anyone going through a partial, can easily understand how it should be marked up with just a glance.

As far as bloat goes, just don't worry about it - the actual styles will only be generated once, at the location in the cascade where the Jigsass Text partial was imported into the main file.

JigSass Text classes are responsive-enabled, using JigSass MQ and the breakpoints defined in the $jigsass-breakpoints variable.

Based on the breakpoint arguments passed to jigsass-util when including a text-decoration class, responsive modifiers are generated according to the following logic:

.u-td--<modifier>[-[-from-<breakpoint-name>][-until-<breakpoint-name>][-misc-<breakpoint-name>]]

So, assuming the medium, large and landscape breakpoints are defined in $jigsass-breakpoints as 600px, 1024px and (orientation: landscape) respectively,

@include jigsass-util(u-td, $modifier: n);

will generate the .u-td--n class, which is not limited to any media-query.

@include jigsass-util(u-td, $modifier: n, $until: medium);

will generate the .u-td--n--until-medium class, which will be in effect at (max-width: 37.49em) and will override styles in the default class until that point.

@include jigsass-util(u-td, $modifier: n, $from: large, $misc: landscape);

will generate the .u-td--n--from-large-when-landscape class, which will go into effect at (min-width: 64em) and (orientation: landscape) and will override styles in the default class under these conditions.

License: MIT

Text Decoration: none:hover

.u-td--n:hover

A utility class for adding none text decoration to an elementwhen :hovered

Include with:

@include jigsass-util(u-td, $modifier: n:hover [, $from, $until, $misc]);

Example

<p class='fpo  u-td--n:hover'>
  This text has none text decoration when :hovered
</p>

Text Decoration: none

.u-td--n

A utility class for adding none text decoration to an element

Include with:

@include jigsass-util(u-td, $modifier: n [, $from, $until, $misc]);

Example

<p class='fpo  u-td--n'>
  This text has none text decoration 
</p>

Text Decoration: underline:hover

.u-td--u:hover

A utility class for adding underline text decoration to an elementwhen :hovered

Include with:

@include jigsass-util(u-td, $modifier: u:hover [, $from, $until, $misc]);

Example

<p class='fpo  u-td--u:hover'>
  This text has underline text decoration when :hovered
</p>

Text Decoration: underline

.u-td--u

A utility class for adding underline text decoration to an element

Include with:

@include jigsass-util(u-td, $modifier: u [, $from, $until, $misc]);

Example

<p class='fpo  u-td--u'>
  This text has underline text decoration 
</p>

Text Decoration: overline:hover

.u-td--o:hover

A utility class for adding overline text decoration to an elementwhen :hovered

Include with:

@include jigsass-util(u-td, $modifier: o:hover [, $from, $until, $misc]);

Example

<p class='fpo  u-td--o:hover'>
  This text has overline text decoration when :hovered
</p>

Text Decoration: overline

.u-td--o

A utility class for adding overline text decoration to an element

Include with:

@include jigsass-util(u-td, $modifier: o [, $from, $until, $misc]);

Example

<p class='fpo  u-td--o'>
  This text has overline text decoration 
</p>

Text Decoration: line-through:hover

.u-td--l:hover

A utility class for adding line-through text decoration to an elementwhen :hovered

Include with:

@include jigsass-util(u-td, $modifier: l:hover [, $from, $until, $misc]);

Example

<p class='fpo  u-td--l:hover'>
  This text has line-through text decoration when :hovered
</p>

Text Decoration: line-through

.u-td--l

A utility class for adding line-through text decoration to an element

Include with:

@include jigsass-util(u-td, $modifier: l [, $from, $until, $misc]);

Example

<p class='fpo  u-td--l'>
  This text has line-through text decoration 
</p>

Vertical Alignment Utils

Introduction

A collection of dynamically generated vertical-alignment utility classes.

Class names follow the Emmet abbreviation syntax, with colons (':') replaced by two dashes (--) to follow BEM naming conventions.

Available classes

  • .u-va--sup: vertical-align: super
  • .u-va--t: vertical-align: top
  • .u-va--tt: vertical-align: text-top
  • .u-va--m: vertical-align: middle
  • .u-va--bl: vertical-align: baseline
  • .u-va--b: vertical-align: bottom
  • .u-va--tb: vertical-align: text-bottom
  • .u-va--sub: vertical-align: sub
  • .u-va--<length>: vertical-align: sub

Installation

Using npm:

npm i -S jigsass-utils-text

Usage

Import JigSass Utils Text into your main scss file near its very end, together with all other utilities (utilities should always be the last to be imported).

@import 'path/to/jigsass-utils-text/scss/index';

Like all other JigSass Utils, JigSass Text does not automatically generate any CSS when imported. You would need to explicitly indicate that each individual vertical alignment class should actually be generated in each component or object it is used in (clarification: This will include style declarations inside .foo and .bar):

// _c.foo.scss
.foo {
  @include jigsass-util(u-va, $modifier: m); // <-- vertical-align: middle

  ...
}
// _c.bar.scss
.bar {
  @include jigsass-util(u-va, $modifier: b);  // <-- vertical-align: bottom
  @include jigsass-util(u-va, $modifier: t, $from: large); // <-- vertical-align: top from large bp and on.

  ...
}

Doing so helps us a great deal with portability, as no matter where we import component or object partials, the correct utility classes will be generated. Think of it as a poor man's dependency management.

Developer communication is also assisted by including "dependencies" wherever they are required, as anyone going through a partial, can easily understand how it should be marked up with just a glance.

As far as bloat goes, just don't worry about it - the actual styles will only be generated once, at the location in the cascade where the Jigsass Text partial was imported into the main file.

JigSass Text classes are responsive-enabled, using JigSass MQ and the breakpoints defined in the $jigsass-breakpoints variable.

Based on the breakpoint arguments passed to jigsass-util when including a vertical-alignment class, responsive modifiers are generated according to the following logic:

.u-va--<modifier>[-[-from-<breakpoint-name>][-until-<breakpoint-name>][-misc-<breakpoint-name>]]

So, assuming the medium, large and landscape breakpoints are defined in $jigsass-breakpoints as 600px, 1024px and (orientation: landscape) respectively,

@include jigsass-util(u-va, $modifier: bl);

will generate the .u-va--bl class, which is not limited to any media-query.

@include jigsass-util(u-va, $modifier: tt, $until: medium);

will generate the .u-va--tt--until-medium class, which will be in effect at (max-width: 37.49em) and will override styles in the default class until that point.

@include jigsass-util(u-va, $modifier: t, $from: large, $misc: landscape);

will generate the .u-va--t--from-large-when-landscape class, which will go into effect at (min-width: 64em) and (orientation: landscape) and will override styles in the default class under these conditions.

License: MIT

V Align to top

u-va--t

A utility class for vertically aligning elements to top

Include with:

@include jigsass-util(u-va, $modifier: t [, $from, $until, $misc]);

Example

<p class='fpo'>
  <span class='u-va--t'>
    The text in this element is vertically aligned to top
  </span>
  <span class='fpo--va u-va--t'></span>
</p>

V Align to middle

u-va--m

A utility class for vertically aligning elements to middle

Include with:

@include jigsass-util(u-va, $modifier: m [, $from, $until, $misc]);

Example

<p class='fpo'>
  <span class='u-va--m'>
    The text in this element is vertically aligned to middle
  </span>
  <span class='fpo--va u-va--m'></span>
</p>

V Align to bottom

u-va--b

A utility class for vertically aligning elements to bottom

Include with:

@include jigsass-util(u-va, $modifier: b [, $from, $until, $misc]);

Example

<p class='fpo'>
  <span class='u-va--b'>
    The text in this element is vertically aligned to bottom
  </span>
  <span class='fpo--va u-va--b'></span>
</p>

V Align to text-top

u-va--tt

A utility class for vertically aligning elements to text-top

Include with:

@include jigsass-util(u-va, $modifier: tt [, $from, $until, $misc]);

Example

<p class='fpo'>
  <span class='u-va--tt'>
    The text in this element is vertically aligned to text-top
  </span>
  <span class='fpo--va u-va--tt'></span>
</p>

V Align to text-bottom

u-va--tb

A utility class for vertically aligning elements to text-bottom

Include with:

@include jigsass-util(u-va, $modifier: tb [, $from, $until, $misc]);

Example

<p class='fpo'>
  <span class='u-va--tb'>
    The text in this element is vertically aligned to text-bottom
  </span>
  <span class='fpo--va u-va--tb'></span>
</p>

V Align to baseline

u-va--bl

A utility class for vertically aligning elements to baseline

Include with:

@include jigsass-util(u-va, $modifier: bl [, $from, $until, $misc]);

Example

<p class='fpo'>
  <span class='u-va--bl'>
    The text in this element is vertically aligned to baseline
  </span>
  <span class='fpo--va u-va--bl'></span>
</p>

V Align to super

u-va--sup

A utility class for vertically aligning elements to super

Include with:

@include jigsass-util(u-va, $modifier: sup [, $from, $until, $misc]);

Example

<p class='fpo'>
  <span class='u-va--sup'>
    The text in this element is vertically aligned to super
  </span>
  <span class='fpo--va u-va--sup'></span>
</p>

V Align to sub

u-va--sub

A utility class for vertically aligning elements to sub

Include with:

@include jigsass-util(u-va, $modifier: sub [, $from, $until, $misc]);

Example

<p class='fpo'>
  <span class='u-va--sub'>
    The text in this element is vertically aligned to sub
  </span>
  <span class='fpo--va u-va--sub'></span>
</p>

V Align by

u-va--2em

A utility class for vertically aligning elements by

Include with:

@include jigsass-util(u-va, $modifier: 2em [, $from, $until, $misc]);

Example

<p class='fpo'>
  <span class='u-va--2em'>
    The text in this element is vertically aligned to 
  </span>
  <span class='fpo--va u-va--2em'></span>
</p>

V Align by

u-va--min-2em

A utility class for vertically aligning elements by

Include with:

@include jigsass-util(u-va, $modifier: min-2em [, $from, $until, $misc]);

Example

<p class='fpo'>
  <span class='u-va--min-2em'>
    The text in this element is vertically aligned to 
  </span>
  <span class='fpo--va u-va--min-2em'></span>
</p>

White-space Utils

Introduction

A collection of dynamically generated white-space utility classes.

Class names follow the Emmet abbreviation syntax, with colons (':') replaced by two dashes (--) to follow BEM naming conventions.

Available classes

  • .u-whs--n: white-space: normal
  • .u-whs--p: white-space: pre
  • .u-whs--nw: white-space: nowrap
  • .u-whs--pw: white-space: pre-wrap
  • .u-whs--pl: white-space: pre-line

Installation

Using npm:

npm i -S jigsass-utils-text

Usage

Import JigSass Utils Text into your main scss file near its very end, together with all other utilities (utilities should always be the last to be imported).

@import 'path/to/jigsass-utils-text/scss/index';

Like all other JigSass Utils, JigSass Text does not automatically generate any CSS when imported. You would need to explicitly indicate that each individual white-space class should actually be generated in each component or object it is used in (clarification: This will include style declarations inside .foo and .bar):

// _c.foo.scss
.foo {
  @include jigsass-util(u-whs, $modifier: nw); // <-- white-space: nowrap

  ...
}
// _c.bar.scss
.bar {
  @include jigsass-util(u-whs, $modifier: n);  // <-- white-space: normal
  @include jigsass-util(u-whs, $modifier: pw, $from: large); // <-- white-space: pre-wrap from large bp and on.

  ...
}

Doing so helps us a great deal with portability, as no matter where we import component or object partials, the correct utility classes will be generated. Think of it as a poor man's dependency management.

Developer communication is also assisted by including "dependencies" wherever they are required, as anyone going through a partial, can easily understand how it should be marked up with just a glance.

As far as bloat goes, just don't worry about it - the actual styles will only be generated once, at the location in the cascade where the Jigsass Text partial was imported into the main file.

JigSass Text classes are responsive-enabled, using JigSass MQ and the breakpoints defined in the $jigsass-breakpoints variable.

Based on the breakpoint arguments passed to jigsass-util when including a white-space class, responsive modifiers are generated according to the following logic:

.u-whs--<modifier>[-[-from-<breakpoint-name>][-until-<breakpoint-name>][-misc-<breakpoint-name>]]

So, assuming the medium, large and landscape breakpoints are defined in $jigsass-breakpoints as 600px, 1024px and (orientation: landscape) respectively,

@include jigsass-util(u-whs, $modifier: nw);

will generate the .u-whs--nw class, which is not limited to any media-query.

@include jigsass-util(u-whs, $modifier: nw, $until: medium);

will generate the .u-whs--nw--until-medium class, which will be in effect at (max-width: 37.49em) and will override styles in the default class until that point.

@include jigsass-util(u-whs, $modifier: p, $from: large, $misc: landscape);

will generate the .u-whs--p--from-large-when-landscape class, which will go into effect at (min-width: 64em) and (orientation: landscape) and will override styles in the default class under these conditions.

License: MIT

White-space normal

u-whs--n

A utility class for setting an element's white-space to normal

Include with:

@include jigsass-util(u-whs, $modifier: n [, $from, $until, $misc]);

Example

<p class='fpo u-whs--n'>
  The white-space of      the text in thiselement is set to normal.
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>

White-space pre

u-whs--p

A utility class for setting an element's white-space to pre

Include with:

@include jigsass-util(u-whs, $modifier: p [, $from, $until, $misc]);

Example

<p class='fpo u-whs--p'>
  The white-space of      the text in thiselement is set to pre.
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>

White-space nowrap

u-whs--nw

A utility class for setting an element's white-space to nowrap

Include with:

@include jigsass-util(u-whs, $modifier: nw [, $from, $until, $misc]);

Example

<p class='fpo u-whs--nw'>
  The white-space of      the text in thiselement is set to nowrap.
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>

White-space pre-wrap

u-whs--pw

A utility class for setting an element's white-space to pre-wrap

Include with:

@include jigsass-util(u-whs, $modifier: pw [, $from, $until, $misc]);

Example

<p class='fpo u-whs--pw'>
  The white-space of      the text in thiselement is set to pre-wrap.
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>

White-space pre-line

u-whs--pl

A utility class for setting an element's white-space to pre-line

Include with:

@include jigsass-util(u-whs, $modifier: pl [, $from, $until, $misc]);

Example

<p class='fpo u-whs--pl'>
  The white-space of      the text in thiselement is set to pre-line.
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>