From f4df6991e6ee79fd00c5570918011b196f1c7fa5 Mon Sep 17 00:00:00 2001 From: Alem Tuzlak Date: Fri, 10 Oct 2025 13:57:20 +0200 Subject: [PATCH] Make UI more aligned with devtools website --- .changeset/pretty-news-smell.md | 6 + packages/devtools-ui/src/styles/use-styles.ts | 122 +++++++++--------- packages/devtools/src/styles/use-styles.ts | 118 +++++++++-------- 3 files changed, 130 insertions(+), 116 deletions(-) create mode 100644 .changeset/pretty-news-smell.md diff --git a/.changeset/pretty-news-smell.md b/.changeset/pretty-news-smell.md new file mode 100644 index 00000000..23b25efb --- /dev/null +++ b/.changeset/pretty-news-smell.md @@ -0,0 +1,6 @@ +--- +'@tanstack/devtools-ui': patch +'@tanstack/devtools': patch +--- + +update UI appearance diff --git a/packages/devtools-ui/src/styles/use-styles.ts b/packages/devtools-ui/src/styles/use-styles.ts index 43769a8a..532e2fd5 100644 --- a/packages/devtools-ui/src/styles/use-styles.ts +++ b/packages/devtools-ui/src/styles/use-styles.ts @@ -10,18 +10,18 @@ const buttonVariantColors: Record< { bg: string; hover: string; active: string; text: string; border: string } > = { primary: { - bg: tokens.colors.purple[500], - hover: tokens.colors.purple[600], - active: tokens.colors.purple[700], + bg: tokens.colors.gray[900], + hover: tokens.colors.gray[800], + active: tokens.colors.gray[700], text: '#fff', - border: tokens.colors.purple[500], + border: tokens.colors.gray[900], }, secondary: { - bg: tokens.colors.gray[800], - hover: tokens.colors.gray[700], - active: tokens.colors.gray[600], - text: tokens.colors.gray[100], - border: tokens.colors.gray[700], + bg: tokens.colors.gray[100], + hover: tokens.colors.gray[200], + active: tokens.colors.gray[300], + text: tokens.colors.gray[900], + border: tokens.colors.gray[300], }, info: { bg: tokens.colors.blue[500], @@ -54,7 +54,7 @@ const buttonVariantColors: Record< } export const css = goober.css const stylesFactory = (theme: Theme = 'dark') => { - const { colors, font, size, alpha, border } = tokens + const { colors, font, size, border } = tokens const { fontFamily } = font const t = (light: string, dark: string) => (theme === 'light' ? light : dark) @@ -104,13 +104,13 @@ const stylesFactory = (theme: Theme = 'dark') => { select: css` appearance: none; width: 100%; - padding: 0.75rem 3rem 0.75rem 0.75rem; - border-radius: 0.5rem; + padding: 0.5rem 3rem 0.5rem 0.75rem; + border-radius: 0.375rem; background-color: ${t(colors.gray[50], colors.darkGray[800])}; color: ${t(colors.gray[900], colors.gray[100])}; - border: 1px solid ${t(colors.gray[300], colors.gray[700])}; + border: 1px solid ${t(colors.gray[200], colors.gray[800])}; font-size: 0.875rem; - transition: all 0.2s ease; + transition: all 0.15s ease; cursor: pointer; /* Custom arrow */ @@ -120,13 +120,13 @@ const stylesFactory = (theme: Theme = 'dark') => { background-size: 1.25rem; &:hover { - border-color: ${t(colors.gray[400], colors.gray[600])}; + border-color: ${t(colors.gray[300], colors.gray[700])}; } &:focus { outline: none; - border-color: ${colors.purple[400]}; - box-shadow: 0 0 0 3px ${colors.purple[400]}${alpha[20]}; + border-color: ${colors.gray[400]}; + box-shadow: 0 0 0 3px ${t(colors.gray[200], colors.gray[800])}; } `, inputWrapper: css` @@ -156,28 +156,27 @@ const stylesFactory = (theme: Theme = 'dark') => { appearance: none; box-sizing: border-box; width: 100%; - padding: 0.75rem; - border-radius: 0.5rem; + padding: 0.5rem 0.75rem; + border-radius: 0.375rem; background-color: ${t(colors.gray[50], colors.darkGray[800])}; color: ${t(colors.gray[900], colors.gray[100])}; - border: 1px solid ${t(colors.gray[300], colors.gray[700])}; + border: 1px solid ${t(colors.gray[200], colors.gray[800])}; font-size: 0.875rem; font-family: ${fontFamily.mono}; - transition: all 0.2s ease; + transition: all 0.15s ease; &::placeholder { color: ${t(colors.gray[400], colors.gray[500])}; } &:hover { - border-color: ${t(colors.gray[400], colors.gray[600])}; + border-color: ${t(colors.gray[300], colors.gray[700])}; } &:focus { outline: none; - border-color: ${t(colors.purple[500], colors.purple[400])}; - box-shadow: 0 0 0 3px - ${t(colors.purple[100] + alpha[20], colors.purple[400] + alpha[20])}; + border-color: ${t(colors.gray[400], colors.gray[600])}; + box-shadow: 0 0 0 3px ${t(colors.gray[200], colors.gray[800])}; } `, checkboxWrapper: css` @@ -186,12 +185,12 @@ const stylesFactory = (theme: Theme = 'dark') => { gap: 0.75rem; cursor: pointer; user-select: none; - padding: 0.5rem; - border-radius: 0.5rem; - transition: background-color 0.2s ease; + padding: 0.375rem; + border-radius: 0.375rem; + transition: background-color 0.15s ease; &:hover { - background-color: ${t(colors.gray[100], colors.darkGray[800])}; + background-color: ${t(colors.gray[50], colors.darkGray[900])}; } `, checkboxContainer: css` @@ -208,28 +207,28 @@ const stylesFactory = (theme: Theme = 'dark') => { width: 1.25rem; height: 1.25rem; border: 2px solid ${t(colors.gray[300], colors.gray[700])}; - border-radius: 0.375rem; + border-radius: 0.25rem; background-color: ${t(colors.gray[50], colors.darkGray[800])}; display: grid; place-items: center; - transition: all 0.2s ease; + transition: all 0.15s ease; flex-shrink: 0; margin-top: 0.125rem; &:hover { - border-color: ${t(colors.purple[500], colors.purple[400])}; + border-color: ${t(colors.gray[400], colors.gray[600])}; } &:checked { - background-color: ${t(colors.purple[500], colors.purple[700])}; - border-color: ${t(colors.purple[500], colors.purple[700])}; + background-color: ${t(colors.gray[900], colors.gray[100])}; + border-color: ${t(colors.gray[900], colors.gray[100])}; } &:checked::after { content: ''; width: 0.4rem; height: 0.6rem; - border: solid ${t('#fff', colors.gray[100])}; + border: solid ${t('#fff', colors.gray[900])}; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -3px; @@ -256,14 +255,14 @@ const stylesFactory = (theme: Theme = 'dark') => { font-family: ${tokens.font.fontFamily.sans}; font-size: 0.8rem; font-weight: 500; - border-radius: 0.2rem; - padding: 0.2rem 0.6rem; + border-radius: 0.375rem; + padding: 0.375rem 0.75rem; cursor: pointer; transition: - background 0.2s, - color 0.2s, - border 0.2s, - box-shadow 0.2s; + background 0.15s, + color 0.15s, + border 0.15s, + box-shadow 0.15s; outline: none; border-width: 1px; border-style: solid; @@ -276,10 +275,10 @@ const stylesFactory = (theme: Theme = 'dark') => { color: ${t(v.bg, v.bg)}; border-color: transparent; &:hover { - background: ${t(colors.purple[100], colors.darkGray[700])}; + background: ${t(colors.gray[100], colors.darkGray[800])}; } &:active { - background: ${t(colors.purple[200], colors.darkGray[800])}; + background: ${t(colors.gray[200], colors.darkGray[700])}; } ` } @@ -289,11 +288,11 @@ const stylesFactory = (theme: Theme = 'dark') => { color: ${t(v.bg, v.bg)}; border-color: ${t(v.bg, v.bg)}; &:hover { - background: ${t(colors.purple[100], colors.darkGray[700])}; + background: ${t(colors.gray[50], colors.darkGray[800])}; border-color: ${t(v.hover, v.hover)}; } &:active { - background: ${t(colors.purple[200], colors.darkGray[800])}; + background: ${t(colors.gray[100], colors.darkGray[700])}; border-color: ${t(v.active, v.active)}; } ` @@ -536,48 +535,45 @@ const stylesFactory = (theme: Theme = 'dark') => { }, section: { main: css` - margin-bottom: 2rem; - padding: 1.5rem; + margin-bottom: 1.5rem; + padding: 1rem; background-color: ${t(colors.gray[50], colors.darkGray[800])}; - border: 1px solid ${t(colors.gray[300], colors.gray[700])}; - border-radius: 0.75rem; - box-shadow: ${t( - '0 1px 3px rgba(0,0,0,0.06)', - '0 1px 3px rgba(0,0,0,0.18)', - )}; + border: 1px solid ${t(colors.gray[200], colors.gray[800])}; + border-radius: 0.5rem; + box-shadow: none; `, title: css` - font-size: 1.125rem; + font-size: 1rem; font-weight: 600; color: ${t(colors.gray[900], colors.gray[100])}; - margin: 0 0 1rem 0; + margin: 0 0 0.75rem 0; padding-bottom: 0.5rem; - border-bottom: 1px solid ${t(colors.gray[300], colors.gray[700])}; + border-bottom: 1px solid ${t(colors.gray[200], colors.gray[800])}; display: flex; align-items: center; gap: 0.5rem; text-align: left; `, icon: css` - height: 20px; - width: 20px; + height: 18px; + width: 18px; & > svg { height: 100%; width: 100%; } - color: ${t(colors.purple[500], colors.purple[400])}; + color: ${t(colors.gray[700], colors.gray[400])}; `, description: css` color: ${t(colors.gray[500], colors.gray[400])}; - font-size: 0.875rem; - margin: 0 0 1.5rem 0; - line-height: 1.5; + font-size: 0.8rem; + margin: 0 0 1rem 0; + line-height: 1.4; text-align: left; `, }, mainPanel: { panel: (withPadding: boolean) => css` - padding: ${withPadding ? tokens.size[4] : 0}; + padding: ${withPadding ? tokens.size[3] : 0}; background: ${t(colors.gray[50], colors.darkGray[700])}; overflow-y: auto; height: 100%; diff --git a/packages/devtools/src/styles/use-styles.ts b/packages/devtools/src/styles/use-styles.ts index 6dcf5cf6..e9262562 100644 --- a/packages/devtools/src/styles/use-styles.ts +++ b/packages/devtools/src/styles/use-styles.ts @@ -20,8 +20,8 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => { padding: 0; margin: 0 auto; background: ${t(colors.white, colors.darkGray[700])}; - border-radius: 12px; - box-shadow: 0 2px 16px ${t('rgba(0, 0, 0, 0.04)', 'rgba(0, 0, 0, 0.08)')}; + border-radius: 8px; + box-shadow: none; overflow-y: auto; height: 100%; display: flex; @@ -33,16 +33,16 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => { seoTabTitle: css` font-size: 1.25rem; font-weight: 600; - color: ${t(colors.purple[500], colors.purple[400])}; + color: ${t(colors.gray[900], colors.gray[100])}; margin: 0; padding: 1rem 1.5rem 0.5rem 1.5rem; text-align: left; - border-bottom: 1px solid ${t(colors.gray[300], colors.gray[700])}; + border-bottom: 1px solid ${t(colors.gray[200], colors.gray[800])}; `, seoTabSection: css` padding: 1.5rem; - background: ${t(colors.gray[100], colors.gray[800])}; - border: 1px solid ${t(colors.gray[300], colors.gray[700])}; + background: ${t(colors.gray[50], colors.darkGray[800])}; + border: 1px solid ${t(colors.gray[200], colors.gray[800])}; display: flex; flex-direction: column; gap: 0.5rem; @@ -61,12 +61,12 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => { padding-bottom: 0.5rem; `, seoPreviewCard: css` - border: 1px solid ${t(colors.gray[300], colors.gray[700])}; + border: 1px solid ${t(colors.gray[200], colors.gray[800])}; border-radius: 8px; padding: 12px 10px; background: ${t(colors.white, colors.darkGray[900])}; margin-bottom: 0; - box-shadow: 0 1px 4px ${t('rgba(0,0,0,0.02)', 'rgba(0,0,0,0.04)')}; + box-shadow: 0 1px 3px ${t('rgba(0,0,0,0.05)', 'rgba(0,0,0,0.1)')}; display: flex; flex-direction: column; align-items: flex-start; @@ -76,10 +76,10 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => { gap: 4px; `, seoPreviewHeader: css` - font-size: 1rem; - font-weight: 500; - margin-bottom: 6px; - color: ${t(colors.purple[500], colors.purple[400])}; + font-size: 0.875rem; + font-weight: 600; + margin-bottom: 0; + color: ${t(colors.gray[700], colors.gray[300])}; `, seoPreviewImage: css` max-width: 100%; @@ -87,28 +87,29 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => { margin-bottom: 6px; box-shadow: 0 1px 2px ${t('rgba(0,0,0,0.03)', 'rgba(0,0,0,0.06)')}; height: 160px; + object-fit: cover; `, seoPreviewTitle: css` - font-size: 1rem; + font-size: 0.9rem; font-weight: 600; - margin-bottom: 2px; + margin-bottom: 4px; color: ${t(colors.gray[900], colors.gray[100])}; `, seoPreviewDesc: css` - color: ${t(colors.gray[700], colors.gray[300])}; - margin-bottom: 2px; - font-size: 0.95rem; + color: ${t(colors.gray[600], colors.gray[400])}; + margin-bottom: 4px; + font-size: 0.8rem; `, seoPreviewUrl: css` color: ${t(colors.gray[500], colors.gray[500])}; - font-size: 0.9rem; - margin-bottom: 2px; + font-size: 0.75rem; + margin-bottom: 0; word-break: break-all; `, seoMissingTagsSection: css` margin-top: 4px; - font-size: 0.95rem; - color: ${t(colors.red[400], colors.red[400])}; + font-size: 0.875rem; + color: ${t(colors.red[500], colors.red[400])}; `, seoMissingTagsList: css` margin: 4px 0 0 0; @@ -116,22 +117,23 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => { list-style: none; display: flex; flex-wrap: wrap; - gap: 6px; + gap: 4px; max-width: 240px; `, seoMissingTag: css` background: ${t(colors.red[100], colors.red[500] + '22')}; color: ${t(colors.red[700], colors.red[500])}; - border-radius: 4px; - padding: 1px 6px; - font-size: 0.9rem; + border-radius: 3px; + padding: 2px 6px; + font-size: 0.75rem; font-weight: 500; `, seoAllTagsFound: css` color: ${t(colors.green[700], colors.green[500])}; font-weight: 500; - margin-left: 6px; - font-size: 0.95rem; + margin-left: 0; + padding: 0 10px 8px 10px; + font-size: 0.875rem; `, devtoolsPanelContainer: ( panelLocation: TanStackDevtoolsConfig['panelLocation'], @@ -146,7 +148,7 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => { z-index: 99999; width: 100%; ${isDetached ? '' : 'max-height: 90%;'} - border-top: 1px solid ${t(colors.gray[300], colors.gray[700])}; + border-top: 1px solid ${t(colors.gray[200], colors.gray[800])}; transform-origin: top; `, devtoolsPanelContainerVisibility: (isOpen: boolean) => { @@ -204,7 +206,7 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => { user-select: none; z-index: 100000; &:hover { - background-color: ${t(colors.purple[700], colors.purple[400])}; + background-color: ${t(colors.gray[400], colors.gray[500])}; } `, @@ -294,9 +296,9 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => { align-items: center; justify-content: flex-start; height: 100%; - background-color: ${t(colors.gray[100], colors.darkGray[800])}; - border-right: 1px solid ${t(colors.gray[300], colors.gray[700])}; - box-shadow: 0 1px 0 ${t(colors.gray[200], colors.gray[700])}; + background-color: ${t(colors.gray[50], colors.darkGray[900])}; + border-right: 1px solid ${t(colors.gray[200], colors.gray[800])}; + box-shadow: none; position: relative; width: ${size[10]}; `, @@ -310,24 +312,24 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => { cursor: pointer; font-size: ${fontSize.sm}; font-family: ${fontFamily.sans}; - color: ${t(colors.gray[700], colors.gray[300])}; + color: ${t(colors.gray[600], colors.gray[400])}; background-color: transparent; border: none; - transition: all 0.2s ease-in-out; + transition: all 0.15s ease; border-left: 2px solid transparent; &:hover:not(.close):not(.active):not(.detach) { - background-color: ${t(colors.gray[200], colors.gray[700])}; + background-color: ${t(colors.gray[100], colors.gray[800])}; color: ${t(colors.gray[900], colors.gray[100])}; - border-left: 2px solid ${t(colors.purple[700], colors.purple[500])}; + border-left: 2px solid ${t(colors.gray[900], colors.gray[100])}; } &.active { - background-color: ${t(colors.purple[200], colors.purple[500])}; + background-color: ${t(colors.gray[100], colors.gray[800])}; color: ${t(colors.gray[900], colors.gray[100])}; - border-left: 2px solid ${t(colors.purple[700], colors.purple[500])}; + border-left: 2px solid ${t(colors.gray[900], colors.gray[100])}; } &.detach { &:hover { - background-color: ${t(colors.gray[200], colors.gray[700])}; + background-color: ${t(colors.gray[100], colors.gray[800])}; } &:hover { color: ${t(colors.green[700], colors.green[500])}; @@ -336,7 +338,7 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => { &.close { margin-top: auto; &:hover { - background-color: ${t(colors.gray[200], colors.gray[700])}; + background-color: ${t(colors.gray[100], colors.gray[800])}; } &:hover { color: ${t(colors.red[700], colors.red[500])}; @@ -368,15 +370,15 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => { pluginsTabDraw: (isExpanded: boolean) => css` width: ${isExpanded ? size[48] : 0}; height: 100%; - background-color: ${t(colors.white, colors.darkGray[800])}; - box-shadow: 0 1px 0 ${colors.gray[700]}; + background-color: ${t(colors.white, colors.darkGray[900])}; + box-shadow: none; ${isExpanded - ? `border-right: 1px solid ${t(colors.gray[300], colors.gray[700])};` + ? `border-right: 1px solid ${t(colors.gray[200], colors.gray[800])};` : ''} `, pluginsTabDrawExpanded: css` width: ${size[48]}; - border-right: 1px solid ${t(colors.gray[300], colors.gray[700])}; + border-right: 1px solid ${t(colors.gray[200], colors.gray[800])}; `, pluginsTabDrawTransition: (mSeconds: number) => { return css` @@ -399,39 +401,49 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => { pluginName: css` font-size: ${fontSize.xs}; font-family: ${fontFamily.sans}; - color: ${t(colors.gray[700], colors.gray[300])}; + color: ${t(colors.gray[600], colors.gray[400])}; padding: ${size[2]}; cursor: pointer; text-align: center; - transition: all 0.2s ease-in-out; + transition: all 0.15s ease; + border-left: 2px solid transparent; + &:hover { - background-color: ${t(colors.gray[200], colors.gray[700])}; + background-color: ${t(colors.gray[100], colors.gray[800])}; color: ${t(colors.gray[900], colors.gray[100])}; padding: ${size[2]}; } &.active { - background-color: ${t(colors.purple[200], colors.purple[500])}; + background-color: ${t(colors.gray[100], colors.gray[800])}; color: ${t(colors.gray[900], colors.gray[100])}; + border-left: 2px solid ${t(colors.gray[900], colors.gray[100])}; + } + &.active:hover { + background-color: ${t(colors.gray[200], colors.gray[700])}; } `, pluginsTabContent: css` width: 100%; height: 100%; overflow-y: auto; + + &:not(:last-child) { + border-right: 5px solid ${t(colors.purple[200], colors.purple[800])}; + } `, settingsGroup: css` display: flex; flex-direction: column; - gap: 1rem; + gap: 0.75rem; `, conditionalSetting: css` margin-left: 1.5rem; padding-left: 1rem; - border-left: 2px solid ${t(colors.purple[600], colors.purple[400])}; - background-color: ${t(colors.gray[100], colors.darkGray[800])}; - padding: 1rem; - border-radius: 0.5rem; + border-left: 2px solid ${t(colors.gray[300], colors.gray[600])}; + background-color: ${t(colors.gray[50], colors.darkGray[900])}; + padding: 0.75rem; + border-radius: 0.375rem; margin-top: 0.5rem; `, settingRow: css`