File tree Expand file tree Collapse file tree 6 files changed +390
-261
lines changed
Expand file tree Collapse file tree 6 files changed +390
-261
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ test-results/
3939
4040# generated files
4141shared /types /lexicons
42+ file-tree-sprite.svg
4243
4344** /__screenshots__ /**
4445
Original file line number Diff line number Diff line change @@ -80,8 +80,15 @@ const bytesFormatter = useBytesFormatter()
8080 :to =" getCodeRoute(parentPath || undefined)"
8181 class =" py-2 px-4 font-mono text-sm w-full"
8282 no-underline
83- classicon =" i-carbon:folder text-yellow-600"
8483 >
84+ <svg
85+ class =" w-4 h-4 me-1 shrink-0 text-yellow-600"
86+ viewBox =" 0 0 16 16"
87+ fill =" currentColor"
88+ aria-hidden =" true"
89+ >
90+ <use :href =" `/file-tree-sprite.svg#${ADDITIONAL_ICONS['folder']}`" />
91+ </svg >
8592 <span class =" w-full flex justify-self-stretch items-center gap-2" > .. </span >
8693 </LinkBase >
8794 </td >
@@ -98,12 +105,18 @@ const bytesFormatter = useBytesFormatter()
98105 :to =" getCodeRoute(node.path)"
99106 class =" py-2 px-4 font-mono text-sm w-full"
100107 no-underline
101- :classicon ="
102- node.type === 'directory'
103- ? 'i-carbon:folder text-yellow-600'
104- : getFileIcon(node.name)
105- "
106108 >
109+ <svg
110+ class =" w-4 h-4 me-1 shrink-0"
111+ viewBox =" 0 0 16 16"
112+ fill =" currentColor"
113+ :class =" node.type === 'directory' ? 'text-yellow-600' : undefined"
114+ aria-hidden =" true"
115+ >
116+ <use
117+ :href =" `/file-tree-sprite.svg#${node.type === 'directory' ? ADDITIONAL_ICONS['folder'] : getFileIcon(node.name)}`"
118+ />
119+ </svg >
107120 <span class =" w-full flex justify-self-stretch items-center gap-2" >
108121 <span class =" flex-1" >{{ node.name }}</span >
109122 <span
Original file line number Diff line number Diff line change @@ -57,14 +57,17 @@ watch(
5757 @click =" toggleDir(node.path)"
5858 :classicon =" isExpanded(node.path) ? 'i-carbon:chevron-down' : 'i-carbon:chevron-right'"
5959 >
60- <span
61- class =" w-4 h-4 shrink-0"
62- :class ="
63- isExpanded(node.path)
64- ? 'i-carbon:folder-open text-yellow-500'
65- : 'i-carbon:folder text-yellow-600'
66- "
67- />
60+ <svg
61+ class =" w-4 h-4 me-1 shrink-0"
62+ :class =" isExpanded(node.path) ? 'text-yellow-500' : 'text-yellow-600'"
63+ viewBox =" 0 0 16 16"
64+ fill =" currentColor"
65+ aria-hidden =" true"
66+ >
67+ <use
68+ :href =" `/file-tree-sprite.svg#${isExpanded(node.path) ? ADDITIONAL_ICONS['folder-open'] : ADDITIONAL_ICONS['folder']}`"
69+ />
70+ </svg >
6871 <span class =" truncate" >{{ node.name }}</span >
6972 </ButtonBase >
7073 <CodeFileTree
@@ -86,8 +89,15 @@ watch(
8689 class =" w-full justify-start! rounded-none! border-none!"
8790 block
8891 :style =" { paddingLeft: `${depth * 12 + 32}px` }"
89- :classicon =" getFileIcon(node.name)"
9092 >
93+ <svg
94+ class =" w-4 h-4 me-1 shrink-0"
95+ viewBox =" 0 0 16 16"
96+ fill =" currentColor"
97+ aria-hidden =" true"
98+ >
99+ <use :href =" `/file-tree-sprite.svg#${getFileIcon(node.name)}`" />
100+ </svg >
91101 <span class =" truncate" >{{ node.name }}</span >
92102 </LinkBase >
93103 </template >
You can’t perform that action at this time.
0 commit comments