Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MatteuSan/sentro
A low-level SCSS library for building and managing token-driven design systems.
https://github.com/MatteuSan/sentro
css design design-system design-token design-tokens frontend scss scss-framework theme token tokens
Last synced: about 2 months ago
JSON representation
A low-level SCSS library for building and managing token-driven design systems.
- Host: GitHub
- URL: https://github.com/MatteuSan/sentro
- Owner: MatteuSan
- License: mit
- Created: 2021-10-27T16:12:09.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-12T03:07:08.000Z (8 months ago)
- Last Synced: 2024-04-12T11:14:14.449Z (8 months ago)
- Topics: css, design, design-system, design-token, design-tokens, frontend, scss, scss-framework, theme, token, tokens
- Language: SCSS
- Homepage: https://docs.matteusan.com/sentro
- Size: 958 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-pinoy-made - GitHub
README
# Sentro
A low-level SCSS library for building robust token-driven design systems at scale.## Installation
```sh
# NPM
npm install @matteusan/sentro --save
```## Documentation
- The documentation for this project is located [here](https://docs.matteusan.me/docs/sentro).## Showcase
#### SCSS Input
```scss
@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
```css
: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));
}
```