Skip to content

Commit

Permalink
v2.1.3: fix English README link in Chinese version's; separate tabbar…
Browse files Browse the repository at this point in the history
… & protyle's spacing calculation; fix FWD superblocks related css that causes lag in tabbar scrolling & inline memo's hover animation
  • Loading branch information
mustakshif committed Feb 14, 2024
1 parent ef7cf8f commit dcbde42
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ You can manually delete this attribute to restore the block to its default state

#### <em>Precautions</em>

1. Full-width display only applies to the first-level blocks in the document. If a block is nested in other content blocks, applying this attribute to it will not produce any effect. For example, applying this attribute to an image paragraph block in a quote block will not change the style of the paragraph block unless the external quote block is cancelled.
2. Full-width display is temporarily only effective in the main window editing area, and does not work in block reference preview windows, small windows, export previews, etc.
1. Full-width display only applies to the **first-level** blocks in the document. If a block is nested in other content blocks, applying this attribute to it will not produce any effect. For example, applying this attribute to an image paragraph block in a quote block will not change the style of the paragraph block unless the external quote block is cancelled.
2. Full-width display is only effective in the editing area of the main window and small windows, and does not work in block reference preview windows, export previews, backlink panel, search result previews, etc.
3. Enabling full-width display may cause the page to feel more jumpy when the editing area's size changes and automatically returns to the cursor position.

## How to use Asri
Expand Down
6 changes: 3 additions & 3 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<br/>

简体中文 | [English](https://github.com/mustakshif/Asri-for-SiYuan/blob/main/README_en_US.md)
简体中文 | [English](https://github.com/mustakshif/Asri-for-SiYuan/blob/main/README.md)

# Asri - theme for SiYuan

Expand Down Expand Up @@ -105,8 +105,8 @@ Asri 是一款极富现代感的[思源笔记](https://github.com/siyuan-note/si

#### <em>注意事项</em>

1. 全宽显示仅对文档中第一层级的块生效。如果一个块被嵌套在其他内容块中,对其应用此属性不会产生任何效果。例如,对引用块中的图片段落块应用此属性,该段落块不会有样式变化,除非将外部引用块取消。
2. 全宽显示暂时仅在主窗口编辑区有效,块引用预览窗、小窗、导出预览等场景均不生效
1. 全宽显示仅对文档中**第一层级**的块生效。如果一个块被嵌套在其他内容块中,对其应用此属性不会产生任何效果。例如,对引用块中的图片段落块应用此属性,该段落块不会有样式变化,除非将外部引用块取消。
2. 全宽显示仅在主窗口和小窗编辑区有效,块引用预览窗、导出预览、反链面板和搜索结果预览等场景均不生效
3. 启用全宽显示可能导致编辑区大小改变后,自动返回光标所在位置时页面的跳动感增强。

## 如何使用 Asri
Expand Down
36 changes: 18 additions & 18 deletions style/features/custom-properties.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,27 +124,27 @@ body:not([style*='-webkit-print-color-adjust']) {
&[custom-asri-full-width-display~="sb"]>.sb[data-sb-layout="col"]:not([custom-asri-full-width-display="off"]),
>.sb[data-sb-layout="col"][custom-asri-full-width-display="on"] {
> :first-child {
margin-left: calc(var(--protyle-spacing)*-1);

>*,
.sb,
.bq,
.render-node {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
margin-left: calc(var(--protyle-spacing)*-1 + min(24px, var(--protyle-spacing)));

// >*,
// .sb,
// .bq,
// .render-node {
// border-top-left-radius: 0;
// border-bottom-left-radius: 0;
// } // ❓ 为什么这里又没事??
}

> :nth-last-child(1 of [data-node-id]) {
margin-right: calc(var(--protyle-spacing)*-1);

>*,
.sb,
.bq,
.render-node {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
margin-right: calc(var(--protyle-spacing)*-1 + min(24px, var(--protyle-spacing)));

// >*,
// .sb,
// .bq,
// .render-node {
// border-top-right-radius: 0;
// border-bottom-right-radius: 0;
// } // ❓ 为什么这个声明会导致 tabbar 滚动卡顿 + 行内备注 hover 状态取消时动画卡顿??
}

// > .sb:first-child {
Expand Down
2 changes: 1 addition & 1 deletion theme.css

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@
// 仅在protylePadding有变化时才应用样式
if (protyles.length > 0) {
protyles.forEach(protyle => {
let protylePadding = window.getComputedStyle(protyle).paddingLeft;
// let protylePadding = window.getComputedStyle(protyle).paddingLeft;
let protylePadding = protyle.style.paddingLeft;
if (protylePadding !== protyle.dataset.prevPadding) {
protyle.style.setProperty('--protyle-spacing', protylePadding);
protyle.dataset.prevPadding = protylePadding;
Expand Down Expand Up @@ -1086,6 +1087,6 @@
// rule.styleSheet.insertRule(rule.rule, rule.styleSheet.cssRules.length);
// }
// }
// console.log('Asri theme destroyed!');
// // console.log('Asri theme destroyed!');
// }
})();
1 change: 0 additions & 1 deletion theme.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@use 'style/base' as *;
@use 'style/theme';
@use 'style/main';

Expand Down

0 comments on commit dcbde42

Please sign in to comment.