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

Support setting local CSS file in style global directive #135

Open
marioarbras opened this issue Feb 25, 2019 · 2 comments
Open

Support setting local CSS file in style global directive #135

marioarbras opened this issue Feb 25, 2019 · 2 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@marioarbras
Copy link

Right now you can define a CSS style as a global directive to extend a base theme.
It appears this can only be written inline, e.g. from documentation:

---
theme: base-theme
style: |
  section {
    background-color: #ccc;
  }
---

If there is a considerable amount of styling being applied, it would be useful to be able define a local CSS style file and simply set its path in the style directive, e.g.:

---
theme: base-theme
style: "style.css"
---

style.css file would then contain

section {
    background-color: #ccc;
  }
@yhatt yhatt added the enhancement New feature or request label Feb 25, 2019
@yhatt
Copy link
Member

yhatt commented Feb 25, 2019

Nice suggestion, but Marpit cannot handle local files while rendering.

We have to manipulate style defined in style directive or <style> tag via PostCSS for converting style to suit to Marpit slides. So it requires loading CSS content if it would support external CSS, but the base converter (markdown-it) does not support an async architecture that is desired to handle file I/O.

In addition, it would prevent working on the environment without supporting file system, like a browser and web worker.

I agree with this suggestion, but we need to solve these problems.

@calidion
Copy link

calidion commented Nov 8, 2019

why not just?

theme:  `style.(s)css`

and all styles will be inherited from the default theme style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants