feat: unify pastel application into single playground and remove standalone pages
This commit is contained in:
@@ -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}];`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user