Skip to content

Commit 8f19cdb

Browse files
committed
Add options for custom card header and overall card class
1 parent d096e6e commit 8f19cdb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ The theme displays information as a series of grouped cards, which must be speci
160160
# (ONLY USED WHEN TYPE IS "custom": the HTML file from the `_include` directory that provides the card body contents)
161161
include: custom-card-body.html
162162

163-
# (OPTIONAL, AND ONLY USED WHEN TYPE IS "custom": a custom CSS class to add to the card body, defaults to no class)
163+
# (OPTIONAL, AND ONLY USED WHEN TYPE IS "custom": CSS classes to add to the card, its header and its body, all default to no class)
164+
card-class: my-custom-class
165+
header-class: my-custom-class
164166
body-class: my-custom-class
165167
```
166168

_layouts/default.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ <h2 class="card-header">{{ card.name | escape }}</h2>
177177

178178
{% when "custom" %}
179179

180-
<div class="card">
181-
<h2 class="card-header">{{ card.name | escape }}</h2>
180+
<div class="card{% if card.card-class %} {{ card.card-class | escape }}{% endif %}">
181+
<h2 class="card-header{% if card.header-class %} {{ card.header-class | escape }}{% endif %}">{{ card.name | escape }}</h2>
182182
<div class="card-body{% if card.body-class %} {{ card.body-class | escape }}{% endif %}">
183183
{% include {{ card.include }} %}
184184
</div>

0 commit comments

Comments
 (0)