-
Notifications
You must be signed in to change notification settings - Fork 0
ui style changes #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ui style changes #12
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| --- | ||
| description: UI styling conventions for a minimalistic, flat, and rounded aesthetic | ||
| globs: src/renderer/src/**/*.{css,tsx} | ||
| alwaysApply: false | ||
| --- | ||
|
|
||
| # Minimalistic UI Styling | ||
|
|
||
| When styling UI components in this application, adhere to a flat, clean, and rounded aesthetic. Avoid sharp edges, heavy borders, and prominent solid backgrounds for secondary elements. | ||
|
|
||
| ## 1. Rounded Edges over Sharp Cuts | ||
| Do not use `clip-path` polygons to create sharp, angled cuts (e.g., "blades" or "notches"). Instead, use smooth `border-radius` values (e.g., `10px`, `12px`, `18px`, or fully rounded). | ||
|
|
||
| ```css | ||
| /* ❌ BAD */ | ||
| .button { | ||
| clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%); | ||
| } | ||
|
|
||
| /* ✅ GOOD */ | ||
| .button { | ||
| border-radius: 10px; /* or 12px, 18px, etc. */ | ||
| } | ||
| ``` | ||
|
|
||
| ## 2. Flat Controls with Hover Highlights | ||
| Secondary buttons, pills, and toggle controls should sit flat against their container's background. Remove static borders and solid backgrounds. Instead, use transparent backgrounds that reveal a subtle highlight only on hover. | ||
|
|
||
| ```tsx | ||
| // ❌ BAD | ||
| <button className="border border-panel-border bg-surface-btn text-fg px-3 py-1"> | ||
| Action | ||
| </button> | ||
|
|
||
| // ✅ GOOD | ||
| <button className="bg-transparent text-muted hover:text-fg hover:bg-[var(--surface-item-hover-bg)] transition-colors rounded-[10px] px-3 py-1"> | ||
| Action | ||
| </button> | ||
| ``` | ||
|
|
||
| ## 3. Active States | ||
| When indicating an active state (like a selected workspace pill), avoid full borders or heavy background fills. Use minimalistic indicators, such as a single colored line or a subtle text color change. | ||
|
|
||
| ```css | ||
| /* ❌ BAD */ | ||
| .item-active { | ||
| border: 1px solid var(--active-border); | ||
| background-color: var(--active-bg); | ||
| } | ||
|
|
||
| /* ✅ GOOD */ | ||
| .item-active { | ||
| border-color: transparent; | ||
| background-color: transparent; | ||
| color: var(--color-fg); | ||
| /* Rely on a pseudo-element or separate indicator line for the active state */ | ||
| } | ||
| ``` |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,23 +17,20 @@ interface WorkspaceSidebarProps { | |||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| const SIDEBAR_BASE = | ||||||||||||||||||
| "surface-sidebar flex flex-col h-full grow-0 shrink-0 z-30 border-r border-panel-border backdrop-blur-2xl transition-[width,flex-basis] duration-150 ease-out max-md:absolute max-md:inset-y-0 max-md:left-0 max-md:basis-auto max-md:shadow-[24px_0_80px_rgba(0,0,0,0.25)]"; | ||||||||||||||||||
| "relative surface-sidebar flex flex-col h-full grow-0 shrink-0 z-30 border-r border-panel-border backdrop-blur-2xl transition-[width,flex-basis] duration-150 ease-out max-md:absolute max-md:inset-y-0 max-md:left-0 max-md:basis-auto max-md:shadow-[24px_0_80px_rgba(0,0,0,0.25)]"; | ||||||||||||||||||
|
|
||||||||||||||||||
| const SIDEBAR_COLLAPSED = "w-[66px] basis-[66px] max-md:w-[58px]"; | ||||||||||||||||||
| const SIDEBAR_COLLAPSED_MAC = "w-[96px] basis-[96px] max-md:w-[88px]"; | ||||||||||||||||||
| const SIDEBAR_EXPANDED = "w-[286px] basis-[286px] max-md:w-[min(82vw,286px)]"; | ||||||||||||||||||
|
|
||||||||||||||||||
| const ICON_BUTTON = | ||||||||||||||||||
| "app-region-no-drag chamfer surface-btn-secondary inline-flex items-center justify-center w-9 h-9 min-h-9 px-0 cursor-pointer"; | ||||||||||||||||||
|
|
||||||||||||||||||
| const SECONDARY_BUTTON = | ||||||||||||||||||
| "app-region-no-drag chamfer surface-btn-secondary min-h-9 min-w-0 px-1.5 text-[10px] font-medium tracking-[0.01em] text-center cursor-pointer overflow-hidden whitespace-nowrap text-ellipsis"; | ||||||||||||||||||
| "app-region-no-drag rounded-[10px] min-h-9 min-w-0 px-1.5 text-[10px] font-medium tracking-[0.01em] text-center cursor-pointer overflow-hidden whitespace-nowrap text-ellipsis text-muted hover:text-fg hover:bg-[var(--surface-item-hover-bg)] transition-colors"; | ||||||||||||||||||
|
|
||||||||||||||||||
| const ITEM_BASE = | ||||||||||||||||||
| "app-region-no-drag pill-rounded w-full flex items-center gap-3 p-2.5 mb-2 text-left border relative"; | ||||||||||||||||||
| "app-region-no-drag pill-rounded w-full flex items-center gap-3 p-2.5 mb-2 text-left relative"; | ||||||||||||||||||
|
|
||||||||||||||||||
| const ITEM_COLLAPSED = | ||||||||||||||||||
| "app-region-no-drag pill-rounded flex items-center justify-center w-11 h-11 mx-auto mb-2 border"; | ||||||||||||||||||
| "app-region-no-drag pill-rounded flex items-center justify-center w-11 h-11 mx-auto mb-2 relative"; | ||||||||||||||||||
|
|
||||||||||||||||||
| const ITEM_INACTIVE = "surface-item-inactive"; | ||||||||||||||||||
| const ITEM_ACTIVE = "surface-item-active"; | ||||||||||||||||||
|
|
@@ -76,41 +73,12 @@ export function WorkspaceSidebar(props: WorkspaceSidebarProps) { | |||||||||||||||||
| props.collapsed ? collapsedSidebarClass : SIDEBAR_EXPANDED | ||||||||||||||||||
| }`} | ||||||||||||||||||
| > | ||||||||||||||||||
| <div | ||||||||||||||||||
| className="absolute right-0 top-0 bottom-0 w-2 cursor-col-resize z-50 hover:bg-fg/10 transition-colors app-region-no-drag" | ||||||||||||||||||
| onClick={props.onToggleCollapsed} | ||||||||||||||||||
|
Comment on lines
+76
to
+78
|
||||||||||||||||||
| <div | |
| className="absolute right-0 top-0 bottom-0 w-2 cursor-col-resize z-50 hover:bg-fg/10 transition-colors app-region-no-drag" | |
| onClick={props.onToggleCollapsed} | |
| <button | |
| type="button" | |
| className="absolute right-0 top-0 bottom-0 w-2 cursor-col-resize z-50 hover:bg-fg/10 transition-colors app-region-no-drag" | |
| onClick={props.onToggleCollapsed} | |
| aria-label={props.collapsed ? "Expand sidebar" : "Collapse sidebar"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SECONDARY_BUTTONstyling no longer includes any disabled-state treatment, but the "Delete" button is still rendered withdisabled={props.workspaces.length === 1}. As a result, the disabled button may look enabled (no opacity/cursor change). Add explicit disabled styling (e.g., opacity/cursor and suppress hover) or keep using a class that applies consistent[disabled]styles.