-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #903 from PandaNocturne/FAQ+Docs
8 Faq+1 docs
- Loading branch information
Showing
8 changed files
with
293 additions
and
23 deletions.
There are no files selected for viewing
111 changes: 111 additions & 0 deletions
111
10-Obsidian/Obsidian外观/CSS 片段/Obsidian插件样式-修改note toolbar插件布局像cmenu那样显示.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
--- | ||
uid: 20241214165026 | ||
title: Obsidian 插件样式 - 修改 note toolbar 插件布局像 cmenu 那样显示 | ||
tags: [] | ||
description: | ||
author: | ||
type: other | ||
draft: false | ||
editable: false | ||
modified: 20241214171631 | ||
--- | ||
|
||
# Obsidian 插件样式 - 修改 note toolbar 插件布局像 cmenu 那样显示 | ||
|
||
Note Toolbar 它可以为不同的文件夹配置不同的工具栏,并能够在文件夹之间自适应切换,而且可以非常方便的编辑工具栏按钮。 | ||
|
||
 | ||
|
||
可以用下面的样式定制 Note Toolbar 布局以模拟 Cmenu 显示 | ||
|
||
 | ||
|
||
## 样式设置 | ||
|
||
您可以将 Note Toolbar 的显示样式更改为类似于 Cmenu 插件的样式。这种设置仅在工具栏名称中包含“cmenu”时生效。 | ||
|
||
 | ||
|
||
--- | ||
|
||
- 将工具栏的位置设置为“置顶(固定位置)”即可,其他设置保持默认。 | ||
- 注意:目前,该设置暂不支持移动端,因此建议在移动设备上隐藏此工具栏。 | ||
|
||
 | ||
|
||
> [!tip] 自带的分割符和行号符可以正常运行 | ||
>  | ||
## CSS 样式 | ||
|
||
```css | ||
/* NoteToolbar 像 Cmenu那样显示 */ | ||
div[data-name *="cmenu"] { | ||
z-index: var(--layer-status-bar); | ||
position: absolute; | ||
bottom: 60px; | ||
width: 100%; | ||
display: flex; | ||
justify-content: center; | ||
background-color: transparent !important; | ||
|
||
div.callout, .callout-content { | ||
background-color: transparent !important; | ||
border: 0 !important; | ||
margin: 0 !important; | ||
opacity: 1 !important; | ||
width: fit-content; | ||
height: fit-content; | ||
} | ||
|
||
ul[role="menu"] { | ||
width: fit-content; | ||
max-width: 450px; | ||
/* display: grid !important; | ||
grid-template-columns: repeat(10, minmax(0, 1fr)); */ | ||
display: flex; | ||
flex-flow: row wrap; | ||
justify-content: flex-start; | ||
gap: 8px 5px !important; | ||
|
||
padding: 10px !important; | ||
transition: 200ms ease; | ||
height: auto; | ||
min-width: fit-content; | ||
border-radius: 6px !important; | ||
|
||
z-index: var(--layer-status-bar); | ||
box-shadow: 0px 3px 30px rgb(31 38 135 / 15%); | ||
margin: 30px !important; | ||
border: 1px solid var(--background-modifier-border); | ||
|
||
/* 添加毛玻璃效果 */ | ||
backdrop-filter: blur(10px) !important; | ||
background-color: rgba(255, 255, 255, 0.3) !important; | ||
|
||
li { | ||
border-radius: 6px; | ||
background-color: var(--background-secondary) !important; | ||
|
||
&>span { | ||
width: 40px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 6px !important; | ||
|
||
svg { | ||
transform: scale(1.2); | ||
} | ||
|
||
} | ||
|
||
.cg-note-toolbar-item-label { | ||
display: none; | ||
} | ||
} | ||
|
||
} | ||
|
||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
uid: 20241213233727 | ||
title: 如何在 OB 内应用 CSS 修改 | ||
tags: [Obsidian] | ||
description: | ||
author: Moy | ||
type: other | ||
draft: false | ||
editable: false | ||
modified: 20241214173629 | ||
|
||
--- | ||
|
||
# 如何在 OB 内应用 CSS 修改 | ||
|
||
> 如果你看到群友或者资料里写“用 CSS 改”,或者下载到了一个 CSS 文件,不知道如何使用——这篇文章能教你学会它! | ||
## CSS 文件 | ||
|
||
CSS 片段其实就是这样一段的代码: | ||
|
||
```` | ||
```css | ||
/* 隐藏标题栏文本 */ | ||
.titlebar-text { | ||
display: none; | ||
} | ||
``` | ||
```` | ||
|
||
想要在 OB 内应用 CSS,你需要做的是: | ||
|
||
1. 创建一个文本文档,命名为 `xxx.css` (后缀名用 `css` 而不是 `txt`) | ||
2. 用记事本或者任意编辑器打开,将 css 代码粘贴进去,保存 | ||
|
||
(有现成的 css 文件可以直接前往下一步) | ||
|
||
## 启用 CSS | ||
|
||
在 OB 设置中找到 **外观**,往下翻到 **CSS 代码片段** 并点击最右边的**文件夹按钮**: | ||
|
||
 | ||
|
||
将 CSS 文件放入打开的文件夹,然后回到 OB 点击文件夹边上的**刷新按钮**。 | ||
|
||
对应 CSS 片段会出现在下方,打开开关即可生效。 | ||
|
||
 | ||
|
||
> 顺便,上一章里的那个 **隐藏标题栏文本** 其实就是个可用的小片段,可以用它做个测试!成功的话你的标题栏中文本会隐藏起来~ | ||
## 修改 CSS 代码 | ||
|
||
用文本编辑器修改对应的 CSS 文件之后,保存,OB 内会实时更新效果。 | ||
|
||
在你调试一些样式的时候,**实时更新**的特性会很有帮助。 | ||
|
||
另外,推荐使用像是 [VSCode](https://code.visualstudio.com/) 这样的代码编辑器,除了会提供语法高亮、自动补全外,还有像是颜色代码高亮、取色器之类的便利工具: | ||
|
||
 | ||
|
||
如果想要尝试自己修改一些 OB 内的样式(例如标题颜色),可以查看:[[OB样式调整基础课-CSS入门科普]]。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.