]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
Merge remote-tracking branch 'upstream/master' into feature/custom-card-colors
authorTom Pansino <2768420+tpansino@users.noreply.github.com>
Wed, 2 Sep 2020 06:47:59 +0000 (23:47 -0700)
committerTom Pansino <2768420+tpansino@users.noreply.github.com>
Wed, 2 Sep 2020 06:47:59 +0000 (23:47 -0700)
docs/configuration.md
src/components/Service.vue

index edcf1ed8592c6bade2184592c3e2483307921f60..a8c0619487b5869ee5dbdaae4c3033f48d3f3439 100644 (file)
@@ -111,6 +111,9 @@ services:
         tag: "other"
         url: "https://www.reddit.com/r/selfhosted/"
         target: "_blank" # optionnal html a tag target attribute
+        # colors: # optional custom colors for card
+        #   background: #66a5e2
+        #   text: #000000
 ```
 
 If you choose to fetch message information from an endpoint, the output format should be:
index 88e6e69cec28f8833d4ccdb50214d6cbd264b6e2..1766af648c7bdbf25c99cdf4febc341a531459ff 100644 (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"
+          :style="(item.colors && item.colors.background) ? {backgroundColor: item.colors.background} : null"
+        >
           <div class="media">
             <div v-if="item.logo" class="media-left">
               <figure class="image is-48x48">
               </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"
+                :style="(item.colors && item.colors.text) ? {color: item.colors.text} : null"
+              >{{ item.name }}</p>
+              <p
+                class="subtitle is-6"
+                :style="(item.colors && item.colors.text) ? {color: item.colors.text} : null"
+              >{{ item.subtitle }}</p>
             </div>
           </div>
           <div class="tag" :class="item.tagstyle" v-if="item.tag">