A simple CLI tool to auto-generate design tokens, fonts.css, and theme.ts files for your project.
Install the package globally or as a dev dependency in your project:
# Global installation
npm install -g @dinethde/ds
# Or as a dev dependency
npm install --save-dev @dinethde/dsNavigate to your project root directory and run:
npx generate-dsOr if installed globally:
generate-dsThis will create the following files in your project:
your-project/
├── src/
│ ├── styles/
│ │ ├── design-tokens.json
│ │ └── fonts.css
│ └── theme.ts
Contains all design tokens including:
- Font styles (h1-h6, paragraphs)
- Color palettes (neutral, primary, secondary)
- Color tokens for backgrounds, borders, text, etc.
Contains font-face declarations for your custom fonts.
A complete Material-UI theme configuration that:
- Imports and uses the design tokens
- Provides light and dark mode support
- Includes custom palette extensions
- Configures typography based on design tokens
- Customizes MUI components (Button, TextField, Switch, Tooltip)
- ✅ Automatically creates
srcandsrc/stylesdirectories if they don't exist - ✅ Overwrites existing files (useful for updates)
- ✅ Zero configuration required
- ✅ Compatible with Material-UI v5+
- ✅ TypeScript support
- Node.js 14.0.0 or higher
After generating the files, you can use the theme in your React app:
import { createTheme, ThemeProvider } from "@mui/material";
import { themeSettings } from "./theme";
function App() {
const mode = "dark"; // or 'light'
const theme = createTheme(themeSettings(mode));
return <ThemeProvider theme={theme}>{/* Your app content */}</ThemeProvider>;
}Apache-2.0
dinethde