1.2.0-3 • Published 3 years ago

sass-styles-containers v1.2.0-3

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

SASS Styles — Containers

Define container styles once, use everywhere

Installation

NOT YET

npm install @sass-styles/containers

Usage

As early as possible, include:

// entry.scss
@use "my-containers" as my-containers;
@use "@sass-styles/containers" with (
  $styles: my-containers.$styles,
);

@use "base";
// _base.scss
@use "@sass-styles/containers" as c;

body {
  @include c.style(body);
}
// _my-typography-styles.scss
$families: (/* family names */);
$sizes: (/* size matching */);
$weights: (/* weight naming */);
$rules: (/* rule definitions */);

Note: Output is HIGHLY unoptimised. As such you should include a good CSS minifier as part of your build.

An example of the cleanup provided by CSS Nano:

/* Styles */
$styles: (
  warning-outline: (
    border-width: 5,
    border-style: solid,
    border-color: orange,
  ),
);

/* Usage */
.card {
  &--warning-outline {
    @include c.style(warning-outline);
  }
}

/* Original output */
.card--warning-outline {
  border-top-width: 5px;
  border-right-width: 5px;
  border-bottom-width: 5px;
  border-left-width: 5px;
  border-top-style: solid;
  border-right-style: solid;
  border-bottom-style: solid;
  border-left-style: solid;
  border-top-color: orange;
  border-right-color: orange;
  border-bottom-color: orange;
  border-left-color: orange;
}

/* After CSS Nano */
.card--warning {
  border-top: 5px solid orange
}

Options

$root-font-px-size

A Number

$length-unit

px, rem, or rem-px

Note: whichever unit is chosen, unitless length values are assumed to be in px.

$styles

“@mixin”s

print

print-rule

FAQ

No op

No operation

1.2.0-1

3 years ago

1.2.0-3

3 years ago

1.2.0-2

3 years ago

1.0.0-alpha.19

3 years ago

1.0.0-alpha.20

3 years ago

1.0.0-alpha.18

3 years ago

1.0.0-alpha.16

3 years ago

1.0.0-alpha.15

4 years ago

1.0.0-alpha.14

4 years ago

1.0.0-alpha.13

4 years ago

1.0.0-alpha.9

4 years ago

1.0.0-alpha.8

4 years ago

1.0.0-alpha.7

4 years ago

1.0.0-alpha.6

4 years ago

1.0.0-alpha.5

4 years ago

1.0.0-alpha.3

4 years ago

1.0.0-alpha.1

4 years ago

1.0.0-alpha.0

4 years ago