Skip to content

Commit 6374158

Browse files
t3dotggclaude
andcommitted
feat(web): the project icon has a stable selector for themes
Theme CSS could not restyle the project icon, because nothing named it. It now carries data-slot="project-monogram". The sidebar surface and the composer card join the stable selector list, and the guide says how to restyle icons. Co-Authored-By: Claude Fable 5.2 <[email protected]>
1 parent 9a8321f commit 6374158

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎apps/web/src/components/ProjectMonogram.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export function ProjectMonogram({
1717
return (
1818
<span
1919
aria-hidden="true"
20+
data-slot="project-monogram"
2021
className={cn("inline-flex size-4 shrink-0 items-center justify-center", className)}
2122
>
2223
<svg

‎packages/shared/src/themeCss.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ export function themeCssLoadsRemoteFiles(css: string): boolean {
2525
*/
2626
export const THEME_CSS_HOOKS = [
2727
{ selector: '[data-slot="sidebar"]', styles: "app sidebar" },
28+
{ selector: '[data-slot="sidebar-inner"]', styles: "sidebar surface" },
2829
{ selector: "[data-thread-item]", styles: "sidebar thread row" },
30+
{
31+
selector: '[data-slot="project-monogram"]',
32+
styles: "project icon with letters; its svg holds the tile",
33+
},
2934
{ selector: "[data-chat-header]", styles: "chat header" },
3035
{ selector: '[data-workspace-area="conversation"]', styles: "chat area, behind the messages" },
3136
{ selector: ".messages-timeline-scroll", styles: "chat scroller" },
@@ -36,6 +41,7 @@ export const THEME_CSS_HOOKS = [
3641
{ selector: ".chat-markdown", styles: "assistant text" },
3742
{ selector: ".chat-markdown-codeblock", styles: "code block" },
3843
{ selector: "[data-chat-composer-form]", styles: "composer" },
44+
{ selector: '[data-slot="composer-host"]', styles: "composer card" },
3945
{ selector: ".composer-tiptap", styles: "composer text" },
4046
{ selector: "[data-thread-details-card]", styles: "thread details card" },
4147
{ selector: "[data-thread-terminal-drawer]", styles: "terminal drawer" },
@@ -65,6 +71,7 @@ export const THEME_GUIDE = [
6571
"The app's own rules can be more specific. If a rule has no effect, add !important.",
6672
"It cannot reach the terminal text, the file tree, or diff internals. Use color roles for those.",
6773
"Native scrollbars take `::-webkit-scrollbar` and `::-webkit-scrollbar-thumb`.",
74+
"Icons are `svg.lucide`. stroke-width, stroke-linecap, and stroke-linejoin restyle them.",
6875
"",
6976
"Stable selectors (other class names change between releases, so do not use them):",
7077
...THEME_CSS_HOOKS.map((hook) => `- ${hook.selector}: ${hook.styles}`),

0 commit comments

Comments
 (0)