0.0.16 • Published 3 years ago

@infrabel-ui/styles v0.0.16

Weekly downloads
8
License
-
Repository
-
Last release
3 years ago

@infrabel-ui/styles

The library holds all the styling assets and utilities for Infrabel tools.

Installation

yarn add @infrabel-ui/styles

Usage

To use the styling assets and utilities of this library, you can import the scss files to your project, for example adding it to an angular project make sure to add it to this array:

angular.json > projects > {NAME_OF_YOUR_PROJECT} > architect > build > options

// Content of angular.json
...
"options": {
    "assets": [
        ...
        {
        "glob": "**/*.woff",
        "input": "./node_modules/@infrabel-ui/styles/src/assets/fonts",
        "output": "./assets/fonts"
        }
    ],
    "stylePreprocessorOptions": {
        "includePaths": [
        ...
        "./node_modules/@infrabel-ui/styles/src",
        "./node_modules/@infrabel-ui/styles/src/infrabel-ui"
        ]
    },
}

To include it inside a publishable library:

    // Content of ng-package.json
    ...
    "lib": {
        "entryFile": "src/index.ts",
        "styleIncludePaths": [
        ...
        "./node_modules/@infrabel-ui/styles/src",
        "./node_modules/@infrabel-ui/styles/src/infrabel-ui"
        ]
    }

then use it inside any .scss files within your angular projects (app or library) as such:

@import 'infrabel-ui';

body {
    background-color: infrabel-color(primary, base);
}

// this will compile to:
body {
    background-color: #02bcf0;
}

Variables table of contents

NametypeDescription
$infrabel-colorsscss mapContains base and variant colors
infrabel-color($name, $variant)scss functionreturns respected colors from color palette

Basic Color Palette

Color palette consist of the following base colors and their respected variant:

  • Primary: -- base, light, lighter, dark, darker
  • Accent: -- base, light, lighter, dark, darker
  • Supporting: -- base, light, lighter, dark, darker
  • Shade: -- base, light, lighter, lightest
  • Warn: -- base
  • Success: -- base
  • Grey: -- base
  • Basic: -- light -- dark

Material Design Palettes

Inheriting from the Basic Color Palette, a set of material design color palettes are available:

  • \$infrabel-md-primary
  • \$infrabel-md-accent
  • \$infrabel-md-supporting
  • \$infrabel-md-warn
  • \$infrabel-md-success
  • \$infrabel-md-grey

Fonts

The library contains set of fonts with different font-style and font-weight, under font-family 'Calibre'.

Typefont-stylefont-weight
calibre-thinnormal100
calibre-lightnormal300
calibre-regularnormal400
calibre-mediumnormal500
calibre-semiboldnormal600
calibre-boldnormal700
calibre-blacknormal900
calibre-thin-italicitalic100
calibre-light-italicitalic300
calibre-regular-italicitalic400
calibre-medium-italicitalic500
calibre-semibold-italicitalic600
calibre-bold-italicitalic700
calibre-black-italicitalic900

The @font-face has font-display: swap, to use it inside your SCSS files:

@import 'infrabel-ui';

// You may add the font details manually:
body {
    // Calibre is the default font, the rest are fallback
    // and browser will swap them with Calibre once loaded.
    font-family: Calibre, Roboto, "Helvetica Neue", sans-serif;
    font-style: normal;
    font-weight: 400;
}

// Or use the basic fonts settings:
@import 'infrabel-ui';
@import 'infrabel-ui/base/typography'; // <== This will add basic font settings to body as show:

// By default body will compile to:
body {
  // abstracts/_variables.scss > $text-font-family 
  font-family: 'Calibre', Roboto, 'Helvetica Neue', sans-serif !default; 
  
  // abstracts/_variables.scss > $text-font-style
  font-style: normal;
  
  // abstracts/_variables.scss > $text-font-weight;
  font-weight: 400; 
}

Development

To use the library locally follow the fellowing steps:

  • Run yarn link inside dist/libs/styles.
  • Run yarn link "@infarbel-ui/styles" inside the root folder of your own project.
  • Run yarn build --watch inside the root folder of this library.
  • To trigger a change you must save any .ts file, saving .scss won't do anything.
  • To unlink your project from the local development run yarn unlink "@infrabel-ui/styles" inside the root folder of your own project.

Publish to npm

WIP

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago