Skip to content

Commit 6ac27d6

Browse files
fix(styles): prefix Tailwind utilities with bc: to avoid colliding with other plugins' classes
Breadcrumbs shipped bare Tailwind utility classes (.static, .flex, .grow, etc.) scoped to the whole Obsidian DOM. Excalidraw's own canvas element carries a literal class `static` for an unrelated purpose; at equal specificity, Breadcrumbs' later-loaded stylesheet won and forced the canvas to position: static, breaking rendering. Prefixing every utility with bc: (bc:static, bc:flex, ...) removes the whole class of collision. Refs #761
1 parent ffb87f4 commit 6ac27d6

20 files changed

Lines changed: 129 additions & 123 deletions

src/components/NestedEdgeList.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
: `BC-edge BC-edge-implied BC-edge-implied-${render_data.edge_source}`}
7272

7373
<details class="tree-item" bind:open={opens[i]}>
74-
<summary class="tree-item-self is-clickable flex items-center">
74+
<summary class="tree-item-self is-clickable bc:flex bc:items-center">
7575
{#if children.length || render_data.has_cut_of_children}
7676
<div class="tree-item-icon collapse-icon mod-collapsible">
7777
<ChevronOpener open={opens[i]} />
@@ -117,7 +117,7 @@
117117
{#if render_data.has_cut_of_children && opens[i]}
118118
<div class="tree-item-children">
119119
<details class="tree-item">
120-
<summary class="tree-item-self flex items-center">
120+
<summary class="tree-item-self bc:flex bc:items-center">
121121
<div class="tree-item-inner">
122122
<span>Traversal limit reached...</span>
123123
</div>

src/components/ObsidianLink.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
2828
<span
2929
role="link"
30-
class="internal-link cursor-pointer {cls}"
30+
class="internal-link bc:cursor-pointer {cls}"
3131
class:is-unresolved={!resolved}
3232
class:BC-active-note={active_file?.path === path}
3333
data-href={path}

src/components/codeblocks/CodeblockErrors.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</script>
1717

1818
{#if errors.length}
19-
<p class="text-warning text-lg font-semibold">
19+
<p class="text-warning bc:text-lg bc:font-semibold">
2020
Breadcrumbs Codeblock Errors
2121
</p>
2222

src/components/codeblocks/CodeblockMarkmap.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,16 @@
269269
{/if}
270270

271271
{#if code}
272-
<div class="relative">
273-
<div class="absolute top-2 right-2 z-10 flex">
272+
<div class="bc:relative">
273+
<div class="bc:absolute bc:top-2 bc:right-2 bc:z-10 bc:flex">
274274
<CopyToClipboardButton
275275
text={code}
276276
cls="clickable-icon nav-action-button"
277277
/>
278278
</div>
279279
<div
280280
bind:this={toolbar_el}
281-
class="absolute bottom-2 right-2 z-10"
281+
class="bc:absolute bc:bottom-2 bc:right-2 bc:z-10"
282282
></div>
283283
<svg
284284
bind:this={svg_el}

src/components/codeblocks/CodeblockMermaid.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@
162162
{/if}
163163

164164
{#if code}
165-
<div class="relative">
166-
<div class="absolute top-2 right-2 z-10 flex">
165+
<div class="bc:relative">
166+
<div class="bc:absolute bc:top-2 bc:right-2 bc:z-10 bc:flex">
167167
<CopyToClipboardButton
168168
text={code}
169169
cls="clickable-icon nav-action-button"

src/components/codeblocks/CodeblockTree.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@
115115
{/if}
116116

117117
{#if data && !data.is_empty()}
118-
<div class="BC-codeblock-tree-items relative">
119-
<div class="absolute top-2 right-2 z-10 flex">
118+
<div class="BC-codeblock-tree-items bc:relative">
119+
<div class="bc:absolute bc:top-2 bc:right-2 bc:z-10 bc:flex">
120120
<CopyToClipboardButton
121121
cls="clickable-icon nav-action-button"
122122
text={() =>
@@ -136,7 +136,7 @@
136136
</div>
137137

138138
<!-- NOTE: Padded so that the flair doesn't interfere with the floating buttons -->
139-
<div class="pr-10">
139+
<div class="bc:pr-10">
140140
<NestedEdgeList
141141
{plugin}
142142
{node_stringify_options}

src/components/input/SimpleInput.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
let value = $state("");
1515
</script>
1616

17-
<div class="flex flex-col gap-1">
17+
<div class="bc:flex bc:flex-col bc:gap-1">
1818
{#if label}
1919
<label for="input">
2020
{label}

src/components/page_views/PrevNextView.svelte

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,21 @@
139139
let period_rows = $derived(period_rows_derived());
140140
</script>
141141

142-
<div class="BC-prev-next-view flex flex-col">
142+
<div class="BC-prev-next-view bc:flex bc:flex-col">
143143
{#if grouped_out_edges?.prev?.length || grouped_out_edges?.next?.length}
144-
<div class="BC-prev-next-daily flex">
144+
<div class="BC-prev-next-daily bc:flex">
145145
<div
146-
class="flex w-full flex-col"
146+
class="bc:flex bc:w-full bc:flex-col"
147147
style="border-radius: var(--radius-m) 0 0 var(--radius-m)"
148148
>
149149
{#each grouped_out_edges?.prev ?? [] as edge}
150150
<div
151-
class="BC-next-prev-item flex gap-3 py-1 pl-2 pr-1 text-left"
151+
class="BC-next-prev-item bc:flex bc:gap-3 bc:py-1 bc:pl-2 bc:pr-1 bc:text-left"
152152
>
153-
<span class="BC-field px-2">{edge.edge_type}</span>
153+
<span class="BC-field bc:px-2">{edge.edge_type}</span>
154154

155155
<EdgeLink
156-
cls="grow"
156+
cls="bc:grow"
157157
{edge}
158158
{plugin}
159159
{node_stringify_options}
@@ -163,33 +163,33 @@
163163
</div>
164164

165165
<div
166-
class="flex w-full flex-col"
166+
class="bc:flex bc:w-full bc:flex-col"
167167
style="border-radius: 0 var(--radius-m) var(--radius-m) 0"
168168
>
169169
{#each grouped_out_edges?.next ?? [] as edge}
170170
<div
171-
class="BC-next-prev-item flex gap-3 py-1 pl-1 pr-2 text-right"
171+
class="BC-next-prev-item bc:flex bc:gap-3 bc:py-1 bc:pl-1 bc:pr-2 bc:text-right"
172172
>
173173
<EdgeLink
174-
cls="grow"
174+
cls="bc:grow"
175175
{edge}
176176
{plugin}
177177
{node_stringify_options}
178178
/>
179179

180-
<span class="BC-field px-2">{edge.edge_type}</span>
180+
<span class="BC-field bc:px-2">{edge.edge_type}</span>
181181
</div>
182182
{/each}
183183
</div>
184184
</div>
185185
{/if}
186186

187187
{#each period_rows as row}
188-
<div class="BC-period-row flex items-center gap-1 py-1 px-2">
189-
<span class="BC-period-kind text-xs opacity-60">{row.kind}</span>
188+
<div class="BC-period-row bc:flex bc:items-center bc:gap-1 bc:py-1 bc:px-2">
189+
<span class="BC-period-kind bc:text-xs bc:opacity-60">{row.kind}</span>
190190

191-
<div class="flex grow items-center justify-between">
192-
<div class="flex-1 text-left">
191+
<div class="bc:flex bc:grow bc:items-center bc:justify-between">
192+
<div class="bc:flex-1 bc:text-left">
193193
{#if row.prev_path}
194194
<EdgeLink
195195
cls=""
@@ -208,14 +208,14 @@
208208
{/if}
209209
</div>
210210

211-
<span class="BC-period-current mx-2 font-medium">
211+
<span class="BC-period-current bc:mx-2 bc:font-medium">
212212
{row.period_path
213213
.split("/")
214214
.pop()
215215
?.replace(/\.[^.]+$/, "") ?? ""}
216216
</span>
217217

218-
<div class="flex-1 text-right">
218+
<div class="bc:flex-1 bc:text-right">
219219
{#if row.next_path}
220220
<EdgeLink
221221
cls=""
@@ -239,7 +239,7 @@
239239
.BC-prev-next-view > div {
240240
border: 1px solid var(--background-modifier-border);
241241
}
242-
.BC-prev-next-view .flex-col {
242+
.BC-prev-next-view .bc\:flex-col {
243243
background-color: var(--background-primary);
244244
}
245245
.BC-period-row {

src/components/page_views/TrailView.svelte

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@
8989
{#if sorted_paths && sorted_paths.length}
9090
<div>
9191
<div
92-
class="mb-1 flex flex-wrap justify-between gap-3"
93-
class:hidden={!settings.show_controls}
92+
class="bc:mb-1 bc:flex bc:flex-wrap bc:justify-between bc:gap-3 {settings.show_controls
93+
? ''
94+
: 'bc:hidden'}"
9495
>
9596
<select class="dropdown" bind:value={settings.format}>
9697
{#each ["grid", "path"] as format}
@@ -106,9 +107,9 @@
106107

107108
<MergeFieldsButton bind:merge_fields={settings.merge_fields} />
108109

109-
<div class="flex items-center gap-1">
110+
<div class="bc:flex bc:items-center bc:gap-1">
110111
<button
111-
class="aspect-square text-lg"
112+
class="bc:aspect-square bc:text-lg"
112113
aria-label="Decrease max depth"
113114
disabled={depth <= 1}
114115
onclick={() => (depth = Math.max(1, depth - 1))}
@@ -117,7 +118,7 @@
117118
</button>
118119

119120
<span
120-
class="font-mono"
121+
class="bc:font-mono"
121122
aria-label={data.hit_depth_limit
122123
? "Some paths have been truncated"
123124
: ""}
@@ -127,7 +128,7 @@
127128
</span>
128129

129130
<button
130-
class="aspect-square text-lg"
131+
class="bc:aspect-square bc:text-lg"
131132
aria-label="Increase max depth"
132133
disabled={depth >= MAX_DEPTH}
133134
onclick={() => (depth = Math.min(MAX_DEPTH, depth + 1))}

src/components/page_views/TrailViewGrid.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<!-- TODO: sailKite says using grid-template-rows: subgrid could work some magic here
6969
https://discord.com/channels/686053708261228577/702656734631821413/1234871810185629859 -->
7070
<div
71-
class="BC-trail-view grid"
71+
class="BC-trail-view bc:grid"
7272
style="grid-template-rows: min-content;
7373
grid-template-columns: {'1fr '.repeat(trail_grid.square.at(0)?.length ?? 0)};"
7474
>
@@ -77,15 +77,15 @@ grid-template-columns: {'1fr '.repeat(trail_grid.square.at(0)?.length ?? 0)};"
7777
{@const edge = trail_grid.square[first][j]}
7878

7979
<div
80-
class="BC-trail-view-item flex"
80+
class="BC-trail-view-item bc:flex"
8181
style="
8282
grid-area: {first + 1} / {j + 1} / {last + 2} / {j + 2};"
8383
>
8484
{#if edge}
8585
<EdgeLink
8686
{edge}
8787
{plugin}
88-
cls="p-1 grow flex justify-center items-center"
88+
cls="bc:p-1 bc:grow bc:flex bc:justify-center bc:items-center"
8989
{node_stringify_options}
9090
/>
9191
{/if}

0 commit comments

Comments
 (0)