yhatt/marp

Support custom CSS class

Closed this issue · 4 comments

Is it possible to add a custom CSS classes to elements ?

Example:

<style>
.image {
    border: 1px solid black;
}

.image.right {
    float: right;
}
</style>

![A junk image](junk.png){.image .right}

Duplicate of #1?

Woops, sorry!

NP, it might be worth closing the issue to keep the issue tracker clear.

yhatt commented

I thought that it is duplicated issue about the class of slide too (and Marp Next is supported class directive), but actually it was not correct.

A feature that is needed in this issue is an ability to specify class to element of Markdown contents. #1 says about CSS theming support.

However, we don't really want to extend markdown syntax like ![](image){.class}. Marp Markdown aims to keep a compatibillity with CommonMark. (See #87)

By using modulized projects in Marp Next, you can extend with markdown-it-attrs plugin if you want.