Skip to content

建议:QYL自定义属性-块样式 #70

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

Closed
myeveryone opened this issue May 7, 2025 · 3 comments
Closed

建议:QYL自定义属性-块样式 #70

myeveryone opened this issue May 7, 2025 · 3 comments

Comments

@myeveryone
Copy link

图一咱这个主题的:

Image

下图这个是obsidian的:

Image

是否有计划改成这种obsidian这种callout样式的,用户可以自定义标题和内容。 直接'/'快捷键调出这个格式

@QYLexpired
Copy link
Owner

感谢反馈,这种自定义标题的主题不好实现,所以不考虑了,麻烦一点的方法是,用css自己实现,比如如果想要标题是“期末作业”,以下是一个例子(颜色可以自己更改):

[custom-style="期末作业"] {
    background-color: #fff2f2; /* 背景颜色 */
    border: 3px solid;
    border-top: 30px solid;
    border-color: #ff7676; /* 边框颜色 */
    padding: 5px 10px !important;
}
[custom-style="期末作业"]::before {
    content: "期末作业";
    position: absolute;
    top: -27px;
    left: 10px;
    color: white;/* 期末作业这几个字的颜色 */
    font-size: 16px;
    font-weight: bold;
}

使用方法,添加进css代码片段,然后给某个块设置自定义属性“style",填入”期末作业“

@myeveryone
Copy link
Author

感谢回复,你给的这个方法可以实现。

@QYLexpired
Copy link
Owner

QYLexpired commented May 10, 2025

提供一个简单方法,比如给某个块设置了待办样式,那么直接给这个块设置如下css属性,即可快速修改标题 (保留颜色)

&::before {content: "输入想要的标题"}

如图所示

Image

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

No branches or pull requests

2 participants