Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望能够自主调节滚动速度 #13

Open
shawnyuan-cn opened this issue May 29, 2024 · 1 comment
Open

希望能够自主调节滚动速度 #13

shawnyuan-cn opened this issue May 29, 2024 · 1 comment
Labels
question Further information is requested

Comments

@shawnyuan-cn
Copy link

shawnyuan-cn commented May 29, 2024

目前太快了有点晃眼,使滚动更自然点会好一些。

  • 滚动速度减缓是一方面(或许每个人感觉不同,可以留一个自主调节的入口)。
  • 至于自然滚动,我没什么明确的想法,或许和加速度有关?例如一个“潜入浅出”的效果?

说句题外话:或许焦点聚焦的颜色(使用不同主题就可以选择不同颜色)和边框类型(例如下边框/双边框/圆角边框/左边框加背景色?)也可以让我们自主设置?

@Zuoqiu-Yingyi Zuoqiu-Yingyi added the question Further information is requested label May 30, 2024
@Zuoqiu-Yingyi
Copy link
Owner

目前太快了有点晃眼,使滚动更自然点会好一些

目前滚动使用的是浏览器的 API Element: scrollBy()Element: scrollIntoView(), 这两个 API 仅支持设置滚动是否为平滑滚动, 没法设置滚动的速度

或许焦点聚焦的颜色和边框类型也可以让我们自主设置?

如果会 CSS 的话可以在代码片段中通过选择器 #plugin-focus-unique-id (全局唯一的焦点) 与 [data-plugin-focus=true] (每个编辑器中唯一的焦点) 定位到当前焦点所在的块, 进而自定义焦点所在块的样式

或者在代码片段中自定义如下的 CSS 变量可以覆盖插件默认的样式

:root {
--custom-focus-shadow-blur: 0.25em; // 焦点阴影模糊半径
--custom-focus-shadow-color: var(--b3-theme-secondary); // 焦点阴影的颜色
--custom-focus-unique-shadow-color: var(--b3-theme-primary); // 全局唯一焦点阴影的颜色
--custom-focus-table-row-outline-width: 1px; // 焦点所在表格行的轮廓宽度
--custom-focus-table-row-outline-color: var(--b3-theme-on-surface); // 焦点所在表格行的轮廓颜色
--custom-focus-table-cell-shadow-blur: 0.25em; // 焦点所在表格单元格的阴影模糊半径
--custom-focus-view-row-outline-width: 1px; // 焦点所在属性视图行的轮廓宽度
--custom-focus-view-row-outline-color: var(--b3-theme-on-surface); // 焦点所在属性视图行的轮廓颜色
--custom-focus-view-cell-shadow-blur: 0.25em; // 焦点所在属性视图单元格的阴影模糊半径
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants