Skip to content

Commit 3abd01d

Browse files
committed
🐛 fix: 引入了容器查询导致 toolbar absolute 布局失效
1 parent f87970b commit 3abd01d

File tree

3 files changed

+15
-26
lines changed

3 files changed

+15
-26
lines changed

src/components/docs-flow/docs-flow-toolbar.svelte

+8-14
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,7 @@
300300
/>
301301

302302
<button
303-
class="b3-button {isMobile()
304-
? 'b3-button--text'
305-
: ''}"
303+
class="b3-button {isMobile() ? 'b3-button--text' : ''}"
306304
on:click={onOpenConfig}
307305
>
308306
{i18n.button.moreConfig}
@@ -390,25 +388,21 @@
390388
}
391389
392390
.docs-flow__toolbar.is-mobile {
393-
--width: 95%;
391+
--width: 90%;
392+
top: 25px;
393+
section.docs-flow__toolbar-body {
394+
width: 70%;
395+
min-width: max-content;
396+
}
394397
}
395398
.docs-flow__toolbar:not(.is-mobile) {
396-
@container docs-flow (min-width: 1000px) {
397-
--width: 72%;
398-
}
399-
400-
@container docs-flow (max-width: 800px) {
401-
--width: 90%;
402-
}
399+
--width: 80%;
403400
404401
section.docs-flow__toolbar-body {
405402
@container docs-flow-toolbar (min-width: 720px) {
406403
width: 720px;
407404
}
408405
@container docs-flow-toolbar (max-width: 720px) {
409-
max-width: 100%;
410-
}
411-
@container docs-flow-toolbar (max-width: 400px) {
412406
width: 100%;
413407
}
414408
}

src/components/docs-flow/docs-flow.svelte

+3-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Author : Yp Z
44
Date : 2023-07-28 20:49:27
55
FilePath : /src/components/docs-flow/docs-flow.svelte
6-
LastEditTime : 2025-01-18 17:31:07
6+
LastEditTime : 2025-01-18 18:40:13
77
Description :
88
-->
99
<script lang="ts">
@@ -208,9 +208,10 @@
208208
209209
//全局 css,用于隐藏gutter
210210
let hideGutterClass: "" | "hide-gutter" = "";
211+
let container: HTMLElement;
211212
</script>
212213

213-
<main class="docs-flow-container">
214+
<main class="docs-flow-container" bind:this={container}>
214215
<Toolbar
215216
bind:rule
216217
bind:config
@@ -237,12 +238,6 @@
237238
</main>
238239

239240
<style lang="scss">
240-
.docs-flow-container {
241-
container-type: inline-size;
242-
container-name: docs-flow;
243-
width: 100%;
244-
position: relative;
245-
}
246241
247242
.docs-flow {
248243
:global(div.docs-flow__protyle .protyle-breadcrumb) {

src/display.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class TabHub {
7272
this.plugin.saveRule(rule);
7373
});
7474
flow.$on("renameThis", ({ detail }) => {
75-
console.log("renameThis", detail);
75+
// console.log("renameThis", detail);
7676
let ruleHash = detail.ruleHash;
7777
const rule = this.tabs[ruleHash].rule;
7878

@@ -112,7 +112,7 @@ export class TabHub {
112112
},
113113
destroy: () => {
114114
delete Tabs[hash];
115-
console.log("destroy tab:", hash);
115+
// console.log("destroy tab:", hash);
116116
}
117117
});
118118
this.tabs[hash] = {
@@ -124,7 +124,7 @@ export class TabHub {
124124

125125
private openTab(hash: any, title?: string) {
126126
// let tab = this.tabs[hash].tab;
127-
console.log(`Open tab ${hash}`)
127+
// console.log(`Open tab ${hash}`)
128128
let rule = this.tabs[hash].rule;
129129
title = title || rule.title;
130130
rule.title = title;
@@ -139,7 +139,7 @@ export class TabHub {
139139
keepCursor: false,
140140
removeCurrentTab: true
141141
}).then(tab => {
142-
console.log(tab);
142+
// console.log(tab);
143143
if (window.siyuan.config.fileTree.openFilesUseCurrentTab) {
144144
let dblclickEvent = new MouseEvent('dblclick', {
145145
view: window,

0 commit comments

Comments
 (0)