]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
Add support for custom card colors
authorTom Pansino <2768420+tpansino@users.noreply.github.com>
Mon, 10 Aug 2020 06:03:00 +0000 (23:03 -0700)
committerTom Pansino <2768420+tpansino@users.noreply.github.com>
Mon, 10 Aug 2020 06:03:00 +0000 (23:03 -0700)
src/components/Service.vue

index 88e6e69cec28f8833d4ccdb50214d6cbd264b6e2..185d2a7723b099661a378c63b53832ff95b3e66b 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.color && item.color.background) ? {backgroundColor: item.color.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.color && item.color.text) ? {color: item.color.text} : null"
+              >{{ item.name }}</p>
+              <p
+                class="subtitle is-6"
+                :style="(item.color && item.color.text) ? {color: item.color.text} : null"
+              >{{ item.subtitle }}</p>
             </div>
           </div>
           <div class="tag" :class="item.tagstyle" v-if="item.tag">