feat: unify pastel application into single playground and remove standalone pages

This commit is contained in:
2026-02-26 12:07:21 +01:00
parent 225a9ad7fb
commit 061ea1d806
21 changed files with 519 additions and 2127 deletions

View File

@@ -4,7 +4,7 @@
export interface ExportColor {
name?: string;
hex: string;
value: string;
}
/**
@@ -14,7 +14,7 @@ export function exportAsCSS(colors: ExportColor[]): string {
const variables = colors
.map((color, index) => {
const name = color.name || `color-${index + 1}`;
return ` --${name}: ${color.hex};`;
return ` --${name}: ${color.value};`;
})
.join('\n');
@@ -28,7 +28,7 @@ export function exportAsSCSS(colors: ExportColor[]): string {
return colors
.map((color, index) => {
const name = color.name || `color-${index + 1}`;
return `$${name}: ${color.hex};`;
return `$${name}: ${color.value};`;
})
.join('\n');
}
@@ -40,7 +40,7 @@ export function exportAsTailwind(colors: ExportColor[]): string {
const colorEntries = colors
.map((color, index) => {
const name = color.name || `color-${index + 1}`;
return ` '${name}': '${color.hex}',`;
return ` '${name}': '${color.value}',`;
})
.join('\n');
@@ -53,7 +53,7 @@ export function exportAsTailwind(colors: ExportColor[]): string {
export function exportAsJSON(colors: ExportColor[]): string {
const colorObjects = colors.map((color, index) => ({
name: color.name || `color-${index + 1}`,
hex: color.hex,
value: color.value,
}));
return JSON.stringify({ colors: colorObjects }, null, 2);
@@ -63,7 +63,7 @@ export function exportAsJSON(colors: ExportColor[]): string {
* Export colors as JavaScript array
*/
export function exportAsJavaScript(colors: ExportColor[]): string {
const colorArray = colors.map((c) => `'${c.hex}'`).join(', ');
const colorArray = colors.map((c) => `'${c.value}'`).join(', ');
return `const colors = [${colorArray}];`;
}