Merge pull request #119 from tpansino/feature/custom-card-colors

Feature/custom card colors
This commit is contained in:
Bastien Wirtz 2020-09-04 15:30:01 -07:00 committed by GitHub
commit bcf0e1bec2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 4 deletions

View File

@ -110,7 +110,8 @@ services:
subtitle: "Another example"
tag: "other"
url: "https://www.reddit.com/r/selfhosted/"
target: "_blank" # optionnal html a tag target attribute
target: "_blank" # optional html a tag target attribute
# class: "green" # optional custom CSS class for card, useful with custom stylesheet
```
If you choose to fetch message information from an endpoint, the output format should be:

View File

@ -0,0 +1,9 @@
@charset "UTF-8";
/* Custom card colors */
/* Use with `class:` property of services in config.yml */
body #app .card .green
{
background-color: #006600;
color: #00ff00;
}

View File

@ -2,7 +2,10 @@
<div>
<div class="card">
<a :href="item.url" :target="item.target" rel="noreferrer">
<div class="card-content">
<div
class="card-content"
:class="item.class"
>
<div class="media">
<div v-if="item.logo" class="media-left">
<figure class="image is-48x48">
@ -15,8 +18,14 @@
</figure>
</div>
<div class="media-content">
<p class="title is-4">{{ item.name }}</p>
<p class="subtitle is-6">{{ item.subtitle }}</p>
<p
class="title is-4"
:class="item.class"
>{{ item.name }}</p>
<p
class="subtitle is-6"
:class="item.class"
>{{ item.subtitle }}</p>
</div>
</div>
<div class="tag" :class="item.tagstyle" v-if="item.tag">