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

导出文件样式丢失 #37

Closed
allynlin opened this issue Sep 9, 2022 · 10 comments
Closed

导出文件样式丢失 #37

allynlin opened this issue Sep 9, 2022 · 10 comments

Comments

@allynlin
Copy link

allynlin commented Sep 9, 2022

导出的HTML、PDF等文件没法保留设置的各种颜色、居中等设置

@svchord
Copy link
Owner

svchord commented Sep 9, 2022

确定是我的主题导致的吗?

@allynlin
Copy link
Author

allynlin commented Sep 9, 2022

我切换到默认主题导出是没有任何问题的,我没法确定一定是你的主题导致的这个问题,确实也没有测试其他主题,是不是都一样

@allynlin
Copy link
Author

allynlin commented Sep 9, 2022

目前来说,我只测试了 notion-light 主题和 默认主题,这两个主题都是没有任何问题的,所以暂时怀疑应该是主题导致的问题。其余的主题也并没有一个个尝试,还是希望您能查看一下,是不是主题的问题导致的它无法导出样式

@svchord
Copy link
Owner

svchord commented Sep 9, 2022

请问可以贴一下您的测试文档吗?我刚刚试了下,我这边默认主题导出预览时也没有自定义的字体颜色、背景颜色和居中等

@allynlin
Copy link
Author

allynlin commented Sep 9, 2022

@allynlin
Copy link
Author

allynlin commented Sep 9, 2022

这是刚提到的导出丢失样式的文档,您可以测试一下,关于默认主题导出和您的主题导出以及编辑器内预览的样式

@allynlin
Copy link
Author

allynlin commented Sep 9, 2022

导出预览和实际导出的效果还存在差异,具体还是要看实际导出 PDF 或 HTML 的样式

@svchord
Copy link
Owner

svchord commented Sep 11, 2022

我这边定位到了问题来源,字体颜色问题是因为我之前把自己添加的css变量从theme.css中抽了出来;居中是没问题的。

但是如果想要完全修改好,会影响我主题之后的功能添加计划,所以你看下这样能不能接受:每次更新主题后,把themes/tdesign/light.css里面的内容,全部复制粘贴到根目录下的theme.css的开头,这样导出就没有问题了。

你现在就可以试试看,不需要等主题更新。

等等,如果是集市上的版本,可能还要再在上面提到的文件开头添加以下代码:

:root{
  --b3-font-color1: var(--b3-card-error-color);
  --b3-font-color2: var(--b3-card-warning-color);
  --b3-font-color3: var(--b3-card-info-color);
  --b3-font-color4: var(--b3-card-success-color);
  --b3-font-color5: var(--b3-theme-on-surface);
  --b3-font-color6: var(--b3-theme-primary);
  --b3-font-color7: var(--b3-theme-secondary);
  --b3-font-color8: var(--b3-theme-error);
  --b3-font-color9: #f5539e;
  --b3-font-color10: #944194;
  --b3-font-color11: #65b84d;
  --b3-font-color12: #f5822e;
  --b3-font-color13: var(--b3-theme-background);
  --b3-font-background1: var(--b3-card-error-background);
  --b3-font-background2: var(--b3-card-warning-background);
  --b3-font-background3: var(--b3-card-info-background);
  --b3-font-background4: var(--b3-card-success-background);
  --b3-font-background5: var(--b3-theme-surface);
  --b3-font-background6: var(--b3-theme-primary-light);
  --b3-font-background7: rgba(217, 211, 215, 0.5);
  --b3-font-background8: rgba(255, 193, 153, 0.5);
  --b3-font-background9: rgba(189, 201, 255, 0.5);
  --b3-font-background10: rgba(239, 218, 251, 0.5);
  --b3-font-background11: rgba(234, 202, 220, 0.5);
  --b3-font-background12: rgba(253, 198, 200, 0.5);
  --b3-font-background13: var(--b3-theme-on-background);
}

下个版本就不需要了。

@svchord
Copy link
Owner

svchord commented Sep 11, 2022

啊,我突然找到了两全其美的办法,不需要你们操作了,等下个版本更新吧

@svchord
Copy link
Owner

svchord commented Sep 11, 2022

最新版已修改并上传,请等待集市打包上架或自行下载最新发布版本使用

@svchord svchord closed this as completed Sep 11, 2022
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