-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Use real theme style value replace var in preview mode #11458
Comments
似乎行级元素也是变量,这个没有影响吗? |
有影响的,用css变量的样式复制到微信公众号都无法正常显示样式。 |
This comment was marked as outdated.
This comment was marked as outdated.
88250
changed the title
导出预览模式优化:css变量替换为实际值
Use real theme style value replace var in preview mode
May 20, 2024
88250
added a commit
that referenced
this issue
May 20, 2024
尝试改进了一下,需要帮忙多测测,谢谢。 |
好的谢谢! |
@88250 这个改变会影响到 PDF 导出吗?还是只影响导出预览? p.s. 群里有个人说 PDF 导出的样式跟以前不一样了,我想问问是不是这个原因 |
不影响 PDF 导出,只影响预览才对。 |
@88250 发现还有问题 |
稍后改进 |
88250
added a commit
that referenced
this issue
Nov 17, 2024
88250
added a commit
that referenced
this issue
Nov 17, 2024
辛苦! |
外部的 css 没有解析,只解析 theme.css |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
导出预览模式优化:css变量替换为实际值
In what scenarios do you need this feature?
发现3.0.15 dev1的预览模式可以显示设置的blockquote背景色了
但是有一个问题,复制到微信公众号中的css如果要生效,就不能用变量var(--b3-card-warning-background)或者color: var(--b3-card-warning-color),需要硬编码指出颜色是什么、背景色是什么,否则不仅仅不能显示,我后续自己用外部css设置blockquote的样式也会失效(可能是检测到变量不存在,导致针对这个块的自定义css也没用了 )
改成这样才可以把样式粘贴到微信公众号了
Describe the optimal solution
导出预览模式优化,复制到微信公众号,css变量全部替换为实际值,包括外部css和DOM的style属性,都进行处理,这样思源笔记的样式基本可以完美复制到微信公众号
Describe the candidate solution
设置的块背景色、字体颜色不在html元素显示,这样我可以用自定义css自行设置样式,而不像现在,官方并不支持复制样式到微信公众号,自定义css也无法成功显示样式
Other information
无
The text was updated successfully, but these errors were encountered: