我正在使用marp创建演讲幻灯片。为了对幻灯片内容进行微调,我创建了一个自定义css,它扩展了marp默认css模板中实现的一些样式规则。
My objective:我希望将css规则外部化到custom-theme.css
文件中,并将它们从幻灯片内容所在的.md
-document中删除。
The problem:当使用带有--theme-set
选项的marp调用custom-theme.css
时,我无法指定css“扩展”默认模板的样式规则。
问题:我如何指定我的custom-theme.css
是基于marp默认模板定义的?
提前感谢您的支持。
发布于 2020-07-31 10:50:42
如果其他用户遇到同样的问题,这个问题的解决方案在这里以一个例子的形式说明--由Yuki Hattori ( marp工具集的主要开发人员)提供:
Marp: Markdown.md
---
theme: custom-theme
---
# Hello, world!
/* custom-theme.css */
/* @theme custom-theme */
@import 'default';
section {
/* Override default background */
background: #def;
}
Marp-cli:
marp --engine ./engine.js --bespoke.progress --watch --theme-set custom-theme.css -- mymarkdo
发布于 2021-07-11 11:08:00
在与代码之间有一个动态主题呈现,而不需要CLI。
将下面的代码片段安装到extension
// Please put `.vscode/settings.json` on your workspace
{
"markdown.marp.themes": [
"https://example.com/foo/bar/custom-theme.css",
"./themes/your-theme.css"
]
}
https://stackoverflow.com/questions/63102715
复制相似问题