Giter Club home page Giter Club logo

sentro's Introduction

Sentro

A low-level SCSS library for building robust token-driven design systems at scale.

Installation

# NPM
npm install @matteusan/sentro --save

Documentation

  • The documentation for this project is located here.

Showcase

SCSS Input

@use 'pkg:@matteusan/sentro' with (
  $prefix: 'sdc',
  $context: 'theme'
);

:root {
  @include sentro.token-config(
    $primary: (
      'default': #122c53,
      'light': #536b99,
      'dark': #061021,
      'ink': #fff
    ),
    $secondary: (
      'default': #ffac00,
      'light': #ffd77e,
      'dark': #533800,
      'ink': #000
    ),
    $radius: (
      'small': 0.3rem,
      'medium': 0.5rem,
      'large': 0.7rem
    ),
  );
}

.my-button-theme {
  background: sentro.key-create('button-fill', 'secondary');
  color: sentro.key-create('button-ink', 'secondary-ink');
  border-color: sentro.key-create('button-border', 'secondary');
  border-radius: sentro.key-create('button-radius', 'radius-small');
}

CSS Output

:root {
  --sdc-theme-primary: #122c53;
  --sdc-theme-primary-light: #536b99;
  --sdc-theme-primary-dark: #061021;
  --sdc-theme-primary-ink: #fff;
  --sdc-theme-secondary: #ffac00;
  --sdc-theme-secondary-light: #ffd77e;
  --sdc-theme-secondary-dark: #533800;
  --sdc-theme-secondary-ink: #000;
  --sdc-theme-radius-small: 0.3rem;
  --sdc-theme-radius-medium: 0.5rem;
  --sdc-theme-radius-large: 0.7rem;
}

.my-button-theme {
    background: var(--sdc-button-fill, var(--sdc-theme-secondary));
    color: var(--sdc-button-ink, var(--sdc-theme-secondary-ink));
    border-color: var(--sdc-button-border, var(--sdc-theme-secondary));
    border-radius: var(--sdc-button-radius, var(--sdc-theme-radius-small));
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.