
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
The goal of this project is to ease creation and usage of a basic CSS design system (design tokens). Our aim is to bring Tailwind's design system benefits to a regular CSS workflow.
As a result you will use a configurable set of CSS variables throughout your styles while your IDE and linter will assist you with snippets and auto fixing.
Main parts of the project:
All these parts are connected via special configuration file containing rules of your design system.
postcss and postcss-custom-mediapostcss-custom-media to postcss.config.jsstylelintdsgen.config.js to the root of your projectdsgen.config.js:
npx dsgen, it will generate:
index.css:
@import 'design-tokens.css';
stylelintYou can see full example in dsgen.config.js file in this repo.
Tokens from this config will be converted to CSS file and IDE snippets.
To create multiple themes:
themes object to config, where key is theme name and value is theme selector. E.g.:
themes: {
default: ':root',
dark: 'html.theme_dark',
},
textColors: {
primary: {
default: '#111',
dark: '#eee',
},
}
CSS variables generated from config are exported to a separate file. Don't change this file manually as it will be fully rewritten after config update.
See example CSS file in design-tokens.css.
For z-indices we recommend using postcss-easy-z to manually declare relations between them.
IDE snippets are also generated from config file.
Some examples:
@mobile -> @media (--mobile) {}
color-primary -> color: var(--color-primary);
bgc-secondary -> background-color: var(--color-bg-secondary);
fz-s -> font-size: var(--font-size-s);
JetBrains IDEs don't support project snippets, so you'll need to add snippets globally. Place snippets file inside jba_config/templates in the IDE configuration directory.
E.g. on Mac OS: ~/Library/Application\ Support/JetBrains/WebStorm2021.1/jba_config/templates/
Then restart IDE, and you'll see snippets group available in Preferences:

You'll need to manually enable/disable snippets groups if you are working on multiple projects with different design system configs.
To make this process easier please vote for per-project templates in JetBrains IDEs.
By default, VS Code snippets are placed inside .vscode folders. That way snippets will be available only for current project.
You'll need to update .gitignore to commit snippets without committing other workspace settings:
.vscode/*
!.vscode/*.code-snippets
We use linting to enforce usage of CSS variables instead of absolute values. To achieve that we use stylelint-declaration-strict-value plugin for stylelint.
// stylelint.config.js
module.exports = {
extends: ['dsgen/stylelint.config'],
}
Other benefit of using stylelint-declaration-strict-value is that it supports auto fixing. We use dsgen config file to determine which absolute values should be replaced with CSS variables.
E.g. with this config:
// dsgen.config.js
module.exports = {
fontSizes: {
s: '12px',
m: '16px',
l: '24px',
},
}
.component {
font-size: 16px;
}
/* becomes */
.component {
font-size: var(--font-size-m);
}
FAQs
Create your own design system using CSS variables
The npm package dsgen receives a total of 0 weekly downloads. As such, dsgen popularity was classified as not popular.
We found that dsgen demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.