https://github.com/MatteuSan/sentro
A low-level SCSS library for building robust token-driven design systems at scale.
https://github.com/MatteuSan/sentro
css design design-system design-token design-tokens frontend scss scss-framework theme token tokens
Last synced: 27 days ago
JSON representation
A low-level SCSS library for building robust token-driven design systems at scale.
- Host: GitHub
- URL: https://github.com/MatteuSan/sentro
- Owner: MatteuSan
- License: mit
- Created: 2021-10-27T16:12:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-01T09:36:04.000Z (12 months ago)
- Last Synced: 2025-03-16T09:32:46.323Z (about 1 month ago)
- Topics: css, design, design-system, design-token, design-tokens, frontend, scss, scss-framework, theme, token, tokens
- Language: SCSS
- Homepage: https://sentro.matteusan.com
- Size: 1.15 MB
- Stars: 7
- 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));
}
```