Skip to content

Commit

Permalink
chore: update figma plugin and themebuilder to new naming (#3220)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Marszalek <mimarz@gmail.com>
  • Loading branch information
Thunear and mimarz authored Feb 27, 2025
1 parent 8121b2c commit a0fa160
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 349 deletions.
10 changes: 6 additions & 4 deletions apps/theme/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ export const useThemeStore = create(
baseBorderRadius: 4,
colorScheme: 'light',
colors: {
main: [{ name: 'accent', colors: generateColorSchemes('#0062BA') }],
main: [
{ name: 'primary', colors: generateColorSchemes('#0062BA') },
{ name: 'accent', colors: generateColorSchemes('#1E98F5') },
],
neutral: [{ name: 'neutral', colors: generateColorSchemes('#1E2B3C') }],
support: [
{ name: 'brand1', colors: generateColorSchemes('#F45F63') },
{ name: 'brand2', colors: generateColorSchemes('#E5AA20') },
{ name: 'brand3', colors: generateColorSchemes('#1E98F5') },
{ name: 'extra1', colors: generateColorSchemes('#F45F63') },
{ name: 'extra2', colors: generateColorSchemes('#E5AA20') },
],
},
themeTab: 'overview',
Expand Down
2 changes: 1 addition & 1 deletion plugins/figma/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "figma-plugin",
"private": true,
"version": "0.3.0",
"version": "0.4.0",
"type": "module",
"scripts": {
"dev": "run-s watch",
Expand Down
288 changes: 28 additions & 260 deletions plugins/figma/src/common/dummyTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,271 +4,39 @@ export const getDummyTheme = () => {
return JSON.parse(JSON.stringify(dummyTheme)) as ColorTheme;
};

const generateColorSet = () => {
const colors: { [key: number]: string } = {};
for (let i = 1; i <= 16; i++) {
colors[i] = '#000000';
}

return colors;
};

const dummyTheme = {
primary: {
light: generateColorSet(),
dark: generateColorSet(),
contrast: generateColorSet(),
},
accent: {
light: {
'1': '#fefeff',
'2': '#eef4fa',
'3': '#d4e5f3',
'4': '#bad5ec',
'5': '#a1c5e5',
'6': '#97bfe3',
'7': '#3a85ca',
'8': '#004d93',
'9': '#0062BA',
'10': '#005099',
'11': '#003d75',
'12': '#0163ba',
'13': '#002c54',
'contrast-1': '#ffffff',
'contrast-2': '#dbe9f5',
},
dark: {
'1': '#001c36',
'2': '#002445',
'3': '#00315c',
'4': '#003d75',
'5': '#004b8f',
'6': '#00529d',
'7': '#1972c1',
'8': '#9cc2e4',
'9': '#4b90ce',
'10': '#287ac5',
'11': '#0163ba',
'12': '#72a8d9',
'13': '#d4e5f3',
'contrast-1': '#000000',
'contrast-2': '#0d1823',
},
contrast: {
'1': '#001c36',
'2': '#002445',
'3': '#00315c',
'4': '#003d75',
'5': '#004b8f',
'6': '#00529d',
'7': '#1972c1',
'8': '#9cc2e4',
'9': '#4b90ce',
'10': '#287ac5',
'11': '#0163ba',
'12': '#72a8d9',
'13': '#d4e5f3',
'contrast-1': '#000000',
'contrast-2': '#0d1823',
},
light: generateColorSet(),
dark: generateColorSet(),
contrast: generateColorSet(),
},
neutral: {
light: {
'1': '#fefefe',
'2': '#f3f4f5',
'3': '#e1e3e5',
'4': '#ced1d4',
'5': '#bdc1c6',
'6': '#b8bcc1',
'7': '#7a818c',
'8': '#444e5d',
'9': '#1E2B3C',
'10': '#303c4b',
'11': '#444e5d',
'12': '#5b6471',
'13': '#202c3d',
'contrast-1': '#ffffff',
'contrast-2': '#bbbfc4',
},
dark: {
'1': '#131c27',
'2': '#192433',
'3': '#243142',
'4': '#333e4e',
'5': '#424d5b',
'6': '#495361',
'7': '#67707c',
'8': '#bbbfc4',
'9': '#a6abb2',
'10': '#90969e',
'11': '#7a818c',
'12': '#9ea3ab',
'13': '#e1e3e5',
'contrast-1': '#000000',
'contrast-2': '#1b1b1d',
},
contrast: {
'1': '#131c27',
'2': '#192433',
'3': '#243142',
'4': '#333e4e',
'5': '#424d5b',
'6': '#495361',
'7': '#67707c',
'8': '#bbbfc4',
'9': '#a6abb2',
'10': '#90969e',
'11': '#7a818c',
'12': '#9ea3ab',
'13': '#e1e3e5',
'contrast-1': '#000000',
'contrast-2': '#1b1b1d',
},
},

brand1: {
light: {
'1': '#fffefe',
'2': '#fef0f1',
'3': '#fcdadb',
'4': '#fbc4c5',
'5': '#f9adaf',
'6': '#f9a5a7',
'7': '#d95558',
'8': '#843336',
'9': '#F45F63',
'10': '#d15155',
'11': '#b04447',
'12': '#a84144',
'13': '#4c1d1f',
'contrast-1': '#000000',
'contrast-2': '#000000',
},
dark: {
'1': '#2f1213',
'2': '#3c1819',
'3': '#522021',
'4': '#68292a',
'5': '#7f3234',
'6': '#8b3639',
'7': '#bc494c',
'8': '#f9a9ab',
'9': '#9f3e41',
'10': '#7f3234',
'11': '#602627',
'12': '#f67f82',
'13': '#fcdadb',
'contrast-1': '#ffffff',
'contrast-2': '#fefefe',
},
contrast: {
'1': '#2f1213',
'2': '#3c1819',
'3': '#522021',
'4': '#68292a',
'5': '#7f3234',
'6': '#8b3639',
'7': '#bc494c',
'8': '#f9a9ab',
'9': '#9f3e41',
'10': '#7f3234',
'11': '#602627',
'12': '#f67f82',
'13': '#fcdadb',
'contrast-1': '#ffffff',
'contrast-2': '#fefefe',
},
light: generateColorSet(),
dark: generateColorSet(),
contrast: generateColorSet(),
},
brand2: {
light: {
'1': '#fffefc',
'2': '#fbf3e0',
'3': '#f5dfac',
'4': '#f0ce7e',
'5': '#eaba4a',
'6': '#e8b338',
'7': '#a57a17',
'8': '#634a0e',
'9': '#E5AA20',
'10': '#c9951c',
'11': '#ae8118',
'12': '#7e5d12',
'13': '#382a08',
'contrast-1': '#000000',
'contrast-2': '#2b2006',
},
dark: {
'1': '#231a05',
'2': '#2d2206',
'3': '#3d2e09',
'4': '#4f3b0b',
'5': '#60470d',
'6': '#684e0f',
'7': '#8e6914',
'8': '#e9b742',
'9': '#513d0b',
'10': '#684e0f',
'11': '#826012',
'12': '#d09a1d',
'13': '#f5dfac',
'contrast-1': '#ffffff',
'contrast-2': '#ddd9cf',
},
contrast: {
'1': '#231a05',
'2': '#2d2206',
'3': '#3d2e09',
'4': '#4f3b0b',
'5': '#60470d',
'6': '#684e0f',
'7': '#8e6914',
'8': '#e9b742',
'9': '#513d0b',
'10': '#684e0f',
'11': '#826012',
'12': '#d09a1d',
'13': '#f5dfac',
'contrast-1': '#ffffff',
'contrast-2': '#ddd9cf',
},
extra1: {
light: generateColorSet(),
dark: generateColorSet(),
contrast: generateColorSet(),
},
brand3: {
light: {
'1': '#fdfeff',
'2': '#eaf6fe',
'3': '#c8e6fd',
'4': '#a9d7fb',
'5': '#84c7fa',
'6': '#7ac2f9',
'7': '#1a85d6',
'8': '#105082',
'9': '#1E98F5',
'10': '#1a83d3',
'11': '#166eb2',
'12': '#1466a5',
'13': '#092e4b',
'contrast-1': '#000000',
'contrast-2': '#010407',
},
dark: {
'1': '#061d30',
'2': '#07253c',
'3': '#0a3251',
'4': '#0d4068',
'5': '#0f4e7f',
'6': '#11558a',
'7': '#1773b9',
'8': '#81c5f9',
'9': '#13609a',
'10': '#0f4c7a',
'11': '#0b3a5d',
'12': '#44aaf7',
'13': '#c8e6fd',
'contrast-1': '#ffffff',
'contrast-2': '#fafcfd',
},
contrast: {
'1': '#061d30',
'2': '#07253c',
'3': '#0a3251',
'4': '#0d4068',
'5': '#0f4e7f',
'6': '#11558a',
'7': '#1773b9',
'8': '#81c5f9',
'9': '#13609a',
'10': '#0f4c7a',
'11': '#0b3a5d',
'12': '#44aaf7',
'13': '#c8e6fd',
'contrast-1': '#ffffff',
'contrast-2': '#fafcfd',
},
extra2: {
light: generateColorSet(),
dark: generateColorSet(),
contrast: generateColorSet(),
},
};
11 changes: 6 additions & 5 deletions plugins/figma/src/common/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ export type ColorIndex =
| '11'
| '12'
| '13'
| 'contrast-1'
| 'contrast-2';
| '14'
| '15'
| '16';

export type StoreThemes = StoreTheme[];

Expand All @@ -36,9 +37,9 @@ export type StoreTheme = {
export type ColorTheme = {
accent: ThemeInfo;
neutral: ThemeInfo;
brand1: ThemeInfo;
brand2: ThemeInfo;
brand3: ThemeInfo;
primary: ThemeInfo;
extra1: ThemeInfo;
extra2: ThemeInfo;
};

export type ThemeInfo = {
Expand Down
Loading

0 comments on commit a0fa160

Please sign in to comment.