Skip to content

Instantly share code, notes, and snippets.

View necm1's full-sized avatar
🏠
Working from home

NECMI necm1

🏠
Working from home
View GitHub Profile
@necm1
necm1 / tailwind.config.js
Created January 5, 2025 23:17
Dynamic Color Mapping from Root Variables (Tailwind / shadcn)
const { join } = require('path');
const postcss = require('postcss');
const sass = require('sass');
function extractRootVariables(scssFile) {
const result = sass.renderSync({ file: scssFile });
const css = result.css.toString();
const rootVariables = {};
postcss.parse(css).walkRules(":root", (rule) => {