diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Inch-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Inch-1-Google-Chrome-linux.png index 538dc40f9..d354a51a3 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Inch-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Inch-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Inch-2-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Inch-2-Google-Chrome-linux.png index 982488b48..4d3a0925c 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Inch-2-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Inch-2-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Millimeters-Millimeters-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Millimeters-Millimeters-1-Google-Chrome-linux.png index bd7d183fa..bf9f84fa5 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Millimeters-Millimeters-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Millimeters-Millimeters-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Millimeters-Millimeters-2-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Millimeters-Millimeters-2-Google-Chrome-linux.png index 3dca73698..b10b65c42 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Millimeters-Millimeters-2-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale---Millimeters-Millimeters-2-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-segments-should-look-right-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-segments-should-look-right-1-Google-Chrome-linux.png index 5da66d300..1ed74630a 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-segments-should-look-right-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-segments-should-look-right-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-segments-should-look-right-2-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-segments-should-look-right-2-Google-Chrome-linux.png index 7a2b601fb..0939bc54e 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-segments-should-look-right-2-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-segments-should-look-right-2-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-linux.png index 12167c9c9..53ea4b3ec 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-1-Google-Chrome-linux.png index 03e8eafd9..d8a229d4d 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-2-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-2-Google-Chrome-linux.png index 4dff8f5f6..e4f8c6a52 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-2-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-2-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-3-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-3-Google-Chrome-linux.png index 9ecc22559..76c238dad 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-3-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-3-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-4-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-4-Google-Chrome-linux.png index e51f593be..1bda444d8 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-4-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-4-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-5-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-5-Google-Chrome-linux.png index 5961d7b85..8912ce6cc 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-5-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-5-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-6-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-6-Google-Chrome-linux.png index 740d46281..49c3067eb 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-6-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-each-default-plane-should-be-stable-6-Google-Chrome-linux.png differ diff --git a/src/App.tsx b/src/App.tsx index fefdb4813..69b712336 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -153,7 +153,7 @@ export function App() { diff --git a/src/Toolbar.tsx b/src/Toolbar.tsx index 8f0714c1c..8e30ec2f9 100644 --- a/src/Toolbar.tsx +++ b/src/Toolbar.tsx @@ -18,8 +18,12 @@ export const Toolbar = () => { const { commandBarSend } = useCommandsContext() const { state, send, context } = useModelingContext() const toolbarButtonsRef = useRef(null) + const iconClassName = + 'group-disabled:text-chalkboard-50 group-enabled:group-hover:!text-chalkboard-10 group-pressed:!text-chalkboard-10' const bgClassName = - 'group-enabled:group-hover:bg-energy-10 group-pressed:bg-energy-10 dark:group-enabled:group-hover:bg-chalkboard-80 dark:group-pressed:bg-chalkboard-80' + 'group-disabled:!bg-transparent group-enabled:group-hover:bg-primary group-pressed:bg-primary' + const buttonClassName = + 'bg-chalkboard-10 dark:bg-chalkboard-100 hover:bg-chalkboard-10 dark:hover:bg-chalkboard-100' const pathId = useMemo(() => { if (!isSingleCursorInPipe(context.selectionRanges, kclManager.ast)) { return false @@ -64,12 +68,14 @@ export const Toolbar = () => { {state.nextEvents.includes('Enter sketch') && (
  • send({ type: 'Enter sketch', data: { forceNewSketch: true } }) } icon={{ icon: 'sketch', + iconClassName, bgClassName, }} disabled={disableAllButtons} @@ -81,10 +87,12 @@ export const Toolbar = () => { {state.nextEvents.includes('Enter sketch') && pathId && (
  • send({ type: 'Enter sketch' })} icon={{ icon: 'sketch', + iconClassName, bgClassName, }} disabled={disableAllButtons} @@ -96,10 +104,12 @@ export const Toolbar = () => { {state.nextEvents.includes('Cancel') && !state.matches('idle') && (
  • send({ type: 'Cancel' })} icon={{ icon: 'arrowLeft', + iconClassName, bgClassName, }} disabled={disableAllButtons} @@ -112,6 +122,7 @@ export const Toolbar = () => { <>
  • state?.matches('Sketch.Line tool') @@ -119,9 +130,9 @@ export const Toolbar = () => { : send('Equip Line tool') } aria-pressed={state?.matches('Sketch.Line tool')} - className="pressed:bg-energy-10/20 dark:pressed:bg-energy-80" icon={{ icon: 'line', + iconClassName, bgClassName, }} disabled={disableAllButtons} @@ -131,6 +142,7 @@ export const Toolbar = () => {
  • state.matches('Sketch.Tangential arc to') @@ -138,9 +150,9 @@ export const Toolbar = () => { : send('Equip tangential arc to') } aria-pressed={state.matches('Sketch.Tangential arc to')} - className="pressed:bg-energy-10/20 dark:pressed:bg-energy-80" icon={{ icon: 'arc', + iconClassName, bgClassName, }} disabled={ @@ -179,8 +191,8 @@ export const Toolbar = () => { .map((eventName) => (
  • send(eventName)} disabled={ @@ -191,6 +203,7 @@ export const Toolbar = () => { title={eventName} icon={{ icon: 'line', + iconClassName, bgClassName, }} > @@ -203,8 +216,8 @@ export const Toolbar = () => { {state.matches('idle') && (
  • commandBarSend({ type: 'Find and select command', @@ -219,6 +232,7 @@ export const Toolbar = () => { } icon={{ icon: 'extrude', + iconClassName, bgClassName, }} > @@ -231,14 +245,14 @@ export const Toolbar = () => { } return ( -
    - +
    + commandBarSend({ type: 'Open' })} - className="rounded-r-full pr-4 self-stretch border-energy-10 hover:border-energy-10 dark:border-chalkboard-80 bg-energy-10/50 hover:bg-energy-10 dark:bg-chalkboard-80 dark:text-energy-10" + className="rounded-r-full pr-4 self-stretch border-primary/30 hover:border-primary dark:border-chalkboard-80 dark:bg-chalkboard-80 text-primary" > {platform === 'darwin' ? '⌘K' : 'Ctrl+/'} diff --git a/src/colors.css b/src/colors.css index 2fc1b65be..610c13d2a 100644 --- a/src/colors.css +++ b/src/colors.css @@ -1,11 +1,21 @@ :root { + --primary-hue: 264.48; + --primary-chroma: 0.2167; + --primary-lightness: 60%; + --_primary: var(--primary-lightness) var(--primary-chroma) + var(--primary-hue, 264.48); + --primary: oklch( + var(--primary-lightness) var(--primary-chroma) var(--primary-hue, 264.48) / + var(--opacity, 1) + ); + /* Generated using Catmosphere Theme Builder by KittyCAD https://catmosphere-theme-builder.vercel.app/?colors=%5B%7B%22from%22:%7B%22l%22:1,%22c%22:0.01,%22h%22:78%7D,%22to%22:%7B%22l%22:0.065,%22c%22:0.05,%22h%22:182.6%7D,%22stops%22:10,%22steps%22:12%7D,%7B%22from%22:%7B%22l%22:1,%22c%22:0.45,%22h%22:122.4%7D,%22to%22:%7B%22l%22:0.13,%22c%22:0.031,%22h%22:137.2%7D,%22stops%22:10,%22steps%22:12%7D,%7B%22from%22:%7B%22l%22:1,%22c%22:0.13,%22h%22:176%7D,%22to%22:%7B%22l%22:0.116,%22c%22:0.097,%22h%22:213.1%7D,%22stops%22:10,%22steps%22:12%7D,%7B%22from%22:%7B%22l%22:1,%22c%22:0.169,%22h%22:144.4%7D,%22to%22:%7B%22l%22:0.12,%22c%22:0.45,%22h%22:132.7%7D,%22steps%22:12%7D,%7B%22from%22:%7B%22l%22:1,%22c%22:0.087,%22h%22:261.6%7D,%22to%22:%7B%22l%22:0.22,%22c%22:0.084,%22h%22:275.5%7D,%22steps%22:12,%22uuid%22:%227tpx9pf1zd6%22%7D,%7B%22from%22:%7B%22l%22:0.954,%22c%22:0.108,%22h%22:280.6%7D,%22to%22:%7B%22l%22:0.166,%22c%22:0.188,%22h%22:263.8%7D,%22steps%22:12,%22uuid%22:%22vu652mebd3%22%7D,%7B%22from%22:%7B%22l%22:1,%22c%22:0.115,%22h%22:0%7D,%22to%22:%7B%22l%22:0.096,%22c%22:0.261,%22h%22:302%7D,%22steps%22:12%7D,%7B%22from%22:%7B%22l%22:1,%22c%22:0.185,%22h%22:19.8%7D,%22to%22:%7B%22l%22:0.368,%22c%22:0.45,%22h%22:9.4%7D,%22steps%22:8,%22uuid%22:%22g05inkd34l%22%7D,%7B%22from%22:%7B%22l%22:0.912,%22c%22:0.139,%22h%22:87%7D,%22to%22:%7B%22l%22:0.502,%22c%22:0.45,%22h%22:97.7%7D,%22steps%22:8,%22uuid%22:%22l892hcw4ef%22%7D,%7B%22from%22:%7B%22l%22:0.89,%22c%22:0.16,%22h%22:143.4%7D,%22to%22:%7B%22l%22:0.466,%22c%22:0.208,%22h%22:147.7%7D,%22steps%22:8,%22uuid%22:%22hkd09y9ov4h%22%7D%5D */ /* Chalkboard */ - --chalkboard-10: oklch(99.7% 0.008766 102.8deg); + --chalkboard-10: oklch(99.9% 0.003766 102.8deg); --chalkboard-20: oklch(91.34% 0.009353 109deg); --chalkboard-30: oklch(82.99% 0.00994 115.2deg); --chalkboard-40: oklch(74.63% 0.01053 121.4deg); diff --git a/src/components/ActionIcon.tsx b/src/components/ActionIcon.tsx index 24ba380fb..0e0759679 100644 --- a/src/components/ActionIcon.tsx +++ b/src/components/ActionIcon.tsx @@ -30,9 +30,9 @@ export const ActionIcon = ({ children, }: ActionIconProps) => { // By default, we reverse the icon color and background color in dark mode - const computedIconClassName = `h-auto dark:text-energy-10 !group-disabled:text-chalkboard-60 !group-disabled:text-chalkboard-60 ${iconClassName}` + const computedIconClassName = `h-auto text-primary dark:text-current !group-disabled:text-chalkboard-60 !group-disabled:text-chalkboard-60 ${iconClassName}` - const computedBgClassName = `bg-chalkboard-20 dark:bg-chalkboard-90 !group-disabled:bg-chalkboard-30 !dark:group-disabled:bg-chalkboard-80 ${bgClassName}` + const computedBgClassName = `bg-primary/10 dark:bg-chalkboard-90 !group-disabled:bg-chalkboard-30 !dark:group-disabled:bg-chalkboard-80 ${bgClassName}` return (
    @@ -53,13 +53,13 @@ export const AppHeader = ({ className="text-sm self-center flex items-center w-fit gap-3" > Command Palette{' '} - + {platform === 'darwin' ? '⌘K' : 'Ctrl+/'} )}
    -
    +
    {/* If there are children, show them, otherwise show User menu */} {children || ( <> diff --git a/src/components/CodeMenu.module.css b/src/components/CodeMenu.module.css index 8d349b898..00e01f105 100644 --- a/src/components/CodeMenu.module.css +++ b/src/components/CodeMenu.module.css @@ -1,13 +1,13 @@ .button { @apply flex justify-between items-center gap-2 px-2 py-1 text-left border-none rounded-sm; @apply font-mono !no-underline text-xs font-bold select-none text-chalkboard-90; - @apply ui-active:bg-energy-10/50 ui-active:text-inherit; + @apply ui-active:bg-primary/10 ui-active:text-primary ui-active:text-inherit; @apply transition-colors ease-out; } :global(.dark) .button { - @apply text-chalkboard-30; - @apply ui-active:bg-chalkboard-80 ui-active:text-energy-10; + @apply !text-chalkboard-30; + @apply ui-active:bg-chalkboard-90; } .button small { diff --git a/src/components/CodeMenu.tsx b/src/components/CodeMenu.tsx index 55edd8558..dfc782dc0 100644 --- a/src/components/CodeMenu.tsx +++ b/src/components/CodeMenu.tsx @@ -30,12 +30,12 @@ export const CodeMenu = ({ children }: PropsWithChildren) => { className="p-1" size="sm" bgClassName={ - 'bg-chalkboard-20 dark:bg-chalkboard-110 hover:bg-energy-10/50 hover:dark:bg-chalkboard-90 ui-active:bg-chalkboard-80 ui-active:dark:bg-chalkboard-90 rounded-sm' + '!bg-transparent hover:!bg-primary/10 hover:dark:!bg-chalkboard-100 ui-active:!bg-primary/10 dark:ui-active:!bg-chalkboard-100 rounded-sm' } - iconClassName={'text-chalkboard-90 dark:text-chalkboard-40'} + iconClassName={'!text-chalkboard-90 dark:!text-chalkboard-40'} /> - + @@ -230,9 +225,9 @@ const FileTreeItem = ({ {!isRenaming ? ( -
    +

    Files

    @@ -375,11 +369,10 @@ export const FileTree = ({ Element="button" icon={{ icon: 'folderPlus', - iconClassName: '!text-energy-80 dark:!text-energy-20', - bgClassName: - 'bg-chalkboard-20/50 hover:bg-energy-10/50 dark:hover:bg-transparent', + iconClassName: '!text-current', + bgClassName: 'bg-transparent', }} - className="!p-0 bg-transparent !outline-none" + className="!p-0 !bg-transparent hover:text-primary border-transparent hover:border-primary !outline-none" onClick={createFolder} > diff --git a/src/components/Loading.tsx b/src/components/Loading.tsx index 38866ed76..362c41313 100644 --- a/src/components/Loading.tsx +++ b/src/components/Loading.tsx @@ -15,23 +15,20 @@ const Loading = ({ children }: React.PropsWithChildren) => { data-testid="loading" > - -

    - {children || 'Loading'} -

    +

    {children || 'Loading'}

    diff --git a/src/components/NetworkHealthIndicator.tsx b/src/components/NetworkHealthIndicator.tsx index a93413026..592e9ae1f 100644 --- a/src/components/NetworkHealthIndicator.tsx +++ b/src/components/NetworkHealthIndicator.tsx @@ -50,7 +50,7 @@ const hasIssueToIconColors: Record = bg: 'bg-chalkboard-30 dark:bg-chalkboard-70', }, false: { - icon: 'text-chalkboard-110 dark:!text-chalkboard-10', + icon: '!text-chalkboard-110 dark:!text-chalkboard-10', bg: 'bg-transparent dark:bg-transparent', }, } @@ -58,8 +58,8 @@ const hasIssueToIconColors: Record = const overallConnectionStateColor: Record = { [NetworkHealthState.Ok]: { - icon: 'text-energy-80 dark:text-energy-10', - bg: 'bg-energy-10/30 dark:bg-energy-80/50', + icon: 'text-succeed-80 dark:text-succeed-10', + bg: 'bg-succeed-10/30 dark:bg-succeed-80/50', }, [NetworkHealthState.Issue]: { icon: 'text-destroy-80 dark:text-destroy-10', @@ -214,7 +214,7 @@ export const NetworkHealthIndicator = () => { 'p-0 border-none bg-transparent dark:bg-transparent relative ' + (hasIssues ? 'focus-visible:outline-destroy-80' - : 'focus-visible:outline-energy-80') + : 'focus-visible:outline-succeed-80') } data-testid="network-toggle" > @@ -227,7 +227,7 @@ export const NetworkHealthIndicator = () => { 'rounded-sm ' + overallConnectionStateColor[overallState].bg } /> - + Network Health ({NETWORK_HEALTH_TEXT[overallState]}) diff --git a/src/components/ProjectCard.tsx b/src/components/ProjectCard.tsx index 38bcf90e9..7e7ca4bc9 100644 --- a/src/components/ProjectCard.tsx +++ b/src/components/ProjectCard.tsx @@ -13,6 +13,7 @@ import { getPartsCount, readProject } from '../lib/tauriFS' import { FILE_EXT } from 'lib/constants' import { Dialog } from '@headlessui/react' import { useHotkeys } from 'react-hotkeys-hook' +import Tooltip from './Tooltip' function ProjectCard({ project, @@ -64,17 +65,17 @@ function ProjectCard({ inputRef.current.focus() inputRef.current.select() } - }, [inputRef]) + }, [inputRef.current]) return (

  • {isEditing ? (
    + > + + Rename project + + setIsEditing(false)} - /> + > + + Cancel + +
  • ) : ( <>
    @@ -130,6 +145,7 @@ function ProjectCard({ icon: faPenAlt, className: 'p-1', iconClassName: 'dark:!text-chalkboard-20', + bgClassName: '!bg-transparent', size: 'xs', }} onClick={(e) => { @@ -138,15 +154,19 @@ function ProjectCard({ setIsEditing(true) }} className="!p-0" - /> + > + + Rename project + + { @@ -154,7 +174,11 @@ function ProjectCard({ e.nativeEvent.stopPropagation() setIsConfirmingDelete(true) }} - /> + > + + Delete project + +
    { const { onProjectClose } = useLspContext() return ( -
    +
    { onProjectClose(file || null, project?.path || null, false) }} to={paths.HOME} - className="group" + className="relative h-full grid place-content-center group p-1.5 before:block before:content-[''] before:absolute before:inset-0 before:bottom-2.5 before:z-[-1] before:bg-primary hover:before:brightness-110 before:rounded-b-sm" > - + {renderAsLink ? ( <> @@ -80,7 +80,7 @@ function ProjectMenuPopover({ return ( @@ -126,15 +126,12 @@ function ProjectMenuPopover({ <>
    -

    +

    {project?.name ? project.name : APP_NAME}

    {project?.entrypointMetadata && (

    Created{' '} @@ -183,11 +180,10 @@ function ProjectMenuPopover({ onProjectClose(file || null, project?.path || null, true) }} icon={{ - icon: faHome, + icon: 'arrowLeft', className: 'p-1', - size: 'sm', }} - className="border-transparent dark:border-transparent hover:bg-energy-10/20 dark:hover:bg-chalkboard-90" + className="border-transparent dark:border-transparent" > Go to Home diff --git a/src/components/SettingsAuthProvider.tsx b/src/components/SettingsAuthProvider.tsx index 18dc961e1..955bdbdc0 100644 --- a/src/components/SettingsAuthProvider.tsx +++ b/src/components/SettingsAuthProvider.tsx @@ -199,6 +199,17 @@ export const SettingsAuthProviderBase = ({ return () => matcher.removeEventListener('change', listener) }, [settingsState.context]) + /** + * Update the --primary-hue CSS variable + * to match the setting app.themeColor.current + */ + useEffect(() => { + document.documentElement.style.setProperty( + `--primary-hue`, + settingsState.context.app.themeColor.current + ) + }, [settingsState.context.app.themeColor.current]) + // Auth machine setup const [authState, authSend, authActor] = useMachine(authMachine, { actions: { diff --git a/src/components/UserSidebarMenu.tsx b/src/components/UserSidebarMenu.tsx index beea654c8..0e8ca4338 100644 --- a/src/components/UserSidebarMenu.tsx +++ b/src/components/UserSidebarMenu.tsx @@ -154,10 +154,9 @@ const UserSidebarMenu = ({ user }: { user?: User }) => { icon={{ icon: faSignOutAlt, className: 'p-1', - bgClassName: 'bg-destroy-80', + bgClassName: '!bg-transparent', size: 'sm', - iconClassName: - 'text-destroy-20 group-hover:text-destroy-10 hover:text-destroy-10', + iconClassName: '!text-destroy-70', }} className="border-transparent dark:border-transparent hover:border-destroy-40 dark:hover:border-destroy-60 hover:bg-destroy-10/20 dark:hover:bg-destroy-80/20" data-testid="user-sidebar-sign-out" diff --git a/src/index.css b/src/index.css index 019805362..c1b29d93c 100644 --- a/src/index.css +++ b/src/index.css @@ -64,15 +64,15 @@ select { } button { - @apply border border-chalkboard-30 m-0.5 px-3 rounded text-xs focus-visible:ring-energy-10; + @apply border border-chalkboard-30 m-0.5 px-3 rounded text-xs focus-visible:ring-primary; } button:hover { - @apply border-chalkboard-40 bg-energy-10/20; + @apply border-chalkboard-40 bg-primary/5; } .dark button { - @apply border-chalkboard-70 focus-visible:ring-energy-10/50; + @apply border-chalkboard-70 focus-visible:ring-primary/50; } .dark button:hover { @@ -80,7 +80,7 @@ button:hover { } button:disabled { - @apply cursor-not-allowed bg-chalkboard-20 text-chalkboard-60 border-chalkboard-20; + @apply cursor-not-allowed bg-chalkboard-20/50 text-chalkboard-60 border-chalkboard-20; } .dark button:disabled { @@ -88,19 +88,19 @@ button:disabled { } a:not(.action-button) { - @apply text-energy-70 hover:text-energy-60 underline; + @apply text-primary underline hover:hue-rotate-15; } .dark a:not(.action-button) { - @apply text-energy-20 hover:text-energy-10; + @apply hover:brightness-110 hover:hue-rotate-0; } input { - @apply selection:bg-energy-10/50; + @apply selection:bg-primary/50; } .dark input { - @apply selection:bg-energy-10/40; + @apply selection:bg-primary/40; } .mono { diff --git a/src/index.tsx b/src/index.tsx index b55bcf1d9..6f5f322f3 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -28,8 +28,8 @@ root.render( 'bg-chalkboard-10 dark:bg-chalkboard-90 text-chalkboard-110 dark:text-chalkboard-10 rounded-sm border-chalkboard-20/50 dark:border-chalkboard-80/50', success: { iconTheme: { - primary: 'oklch(93.31% 0.227 122.3deg)', - secondary: 'oklch(24.49% 0.01405 158.7deg)', + primary: 'oklch(89% 0.16 143.4deg)', + secondary: 'oklch(48.62% 0.1654 142.5deg)', }, duration: 1500, }, diff --git a/src/lib/settings/initialSettings.tsx b/src/lib/settings/initialSettings.tsx index 5ec464bcf..47a30a525 100644 --- a/src/lib/settings/initialSettings.tsx +++ b/src/lib/settings/initialSettings.tsx @@ -13,7 +13,7 @@ import { cameraSystems, } from 'lib/cameraControls' import { isTauri } from 'lib/isTauri' -import { useRef } from 'react' +import { CSSProperties, useRef } from 'react' import { open } from '@tauri-apps/api/dialog' import { CustomIcon } from 'components/CustomIcon' import Tooltip from 'components/Tooltip' @@ -132,6 +132,31 @@ export function createSettings() { })), }, }), + themeColor: new Setting({ + defaultValue: '264.5', + description: 'The hue of the primary theme color for the app', + validate: (v) => Number(v) >= 0 && Number(v) < 360, + Component: ({ value, onChange }) => ( +

    + + {value}º +
    +
    + ), + }), onboardingStatus: new Setting({ defaultValue: '', validate: (v) => typeof v === 'string', @@ -179,7 +204,7 @@ export function createSettings() { inputRef.current.value = newValue } }} - className="p-0 m-0 border-none hover:bg-energy-10 focus:bg-energy-10 dark:hover:bg-energy-80/50 dark:focus::bg-energy-80/50" + className="p-0 m-0 border-none hover:bg-primary/10 focus:bg-primary/10 dark:hover:bg-primary/20 dark:focus::bg-primary/20" > Choose a folder diff --git a/src/machines/settingsMachine.ts b/src/machines/settingsMachine.ts index 94b28922b..5ad28a7e1 100644 --- a/src/machines/settingsMachine.ts +++ b/src/machines/settingsMachine.ts @@ -32,6 +32,11 @@ export const settingsMachine = createMachine( internal: true, actions: ['setSettingAtLevel', 'persistSettings'], // No toast }, + 'set.app.themeColor': { + target: 'idle', + internal: true, + actions: ['setSettingAtLevel', 'persistSettings'], // No toast + }, 'set.modeling.defaultUnit': { target: 'idle', diff --git a/src/routes/Home.tsx b/src/routes/Home.tsx index 2289dd30a..2f46a7e3f 100644 --- a/src/routes/Home.tsx +++ b/src/routes/Home.tsx @@ -247,7 +247,7 @@ const Home = () => {

    Loaded from{' '} - + {settings.app.projectDirectory.current} .{' '} diff --git a/src/routes/Onboarding/CodeEditor.tsx b/src/routes/Onboarding/CodeEditor.tsx index 33b58c165..1b70f50f7 100644 --- a/src/routes/Onboarding/CodeEditor.tsx +++ b/src/routes/Onboarding/CodeEditor.tsx @@ -24,8 +24,7 @@ export default function CodeEditor() { >

    - Editing code with{' '} - kcl + Editing code with kcl

    kcl is our language for describing geometry. Building our own diff --git a/src/routes/Onboarding/Introduction.tsx b/src/routes/Onboarding/Introduction.tsx index 43d955e29..2dac0e291 100644 --- a/src/routes/Onboarding/Introduction.tsx +++ b/src/routes/Onboarding/Introduction.tsx @@ -137,7 +137,7 @@ export default function Introduction() { alt={APP_NAME} className="h-20 max-w-full" /> - + Alpha diff --git a/src/routes/Onboarding/ParametricModeling.tsx b/src/routes/Onboarding/ParametricModeling.tsx index 7ddb81af9..26c0268ee 100644 --- a/src/routes/Onboarding/ParametricModeling.tsx +++ b/src/routes/Onboarding/ParametricModeling.tsx @@ -49,10 +49,8 @@ export default function ParametricModeling() {

    We've received this sketch from a designer highlighting an{' '} - - aluminum bracket - {' '} - they need for this shelf: + aluminum bracket they need for + this shelf:

    We are able to easily calculate the thickness of the material based on the width of the bracket to meet a set safety factor on{' '} - + line {bracketThicknessCalculationLine} . diff --git a/src/routes/Settings.tsx b/src/routes/Settings.tsx index 78744ab42..bdd477201 100644 --- a/src/routes/Settings.tsx +++ b/src/routes/Settings.tsx @@ -420,9 +420,7 @@ export function SettingsSection({ className={ 'group grid grid-cols-2 gap-6 items-start ' + className + - (settingHasChanged - ? ' border-0 border-l-2 -ml-0.5 border-energy-50 dark:border-energy-20' - : '') + (settingHasChanged ? ' border-0 border-l-2 -ml-0.5 border-primary' : '') } >
    @@ -607,17 +605,14 @@ function SettingsTabButton(props: SettingsTabButtonProps) {
    {text} diff --git a/tailwind.config.js b/tailwind.config.js index 8974e35b1..3dd6bc0fa 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -32,6 +32,7 @@ module.exports = { theme: { extend: { colors: { + primary: `oklch(var(--_primary) / )`, ...themeColors, }, fontFamily: {