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

Add theme set option #21

Merged
merged 4 commits into from
Sep 18, 2018
Merged

Add theme set option #21

merged 4 commits into from
Sep 18, 2018

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Sep 18, 2018

This PR will add --theme-set option to use additional theme CSS files. It can use the theme CSS created by the user! 🎉

Let’s say there is a theme CSS suitable for Marpit framework like this (css/additional.css):

/* @theme additional */

@import 'default';

section {
  background: #f80;
  color: #fff;
}

h1 {
  text-align: center;
  color: currentColor;
}

And slide.md:

<!-- theme: additional -->

# Hello, marp-cli :smile:

`--theme-set` option can use additional CSS themes by user.

The additional theme can use in theme directive of Marp Markdown by setting --theme-set option.

marp --theme-set css/additional.css -- slide.md

# It can specify theme by --theme option too
marp --theme-set css/additional.css --theme additional slide.md

--theme-set option recieves array, so you can add multiple themes.

# Add multiple themes
marp --theme-set one.css two.css three.css -- slide.md

# Add folder
marp --theme-set ./themes/ -- slide.md

This is the first step of Marp's better custom CSS support. It's related to yhatt/marp#1 and yhatt/marp#5.

Remaining tasks (will implement in other PR)

  • Pass theme CSS path in --theme option directly (It allows anonymous theme)
  • Track change of additional theme CSS in watch mode (-w)

ToDo

  • Add tests

@yhatt yhatt changed the title [WIP] Add theme set option Add theme set option Sep 18, 2018
@yhatt yhatt merged commit 4aa6fa8 into master Sep 18, 2018
@yhatt yhatt deleted the theme-set branch September 18, 2018 12:35
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

Successfully merging this pull request may close these issues.

1 participant