]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
Rewrite custom card colors to use custom CSS classes instead of styles 119/head
authorTom Pansino <2768420+tpansino@users.noreply.github.com>
Wed, 2 Sep 2020 07:34:37 +0000 (00:34 -0700)
committerTom Pansino <2768420+tpansino@users.noreply.github.com>
Wed, 2 Sep 2020 07:34:37 +0000 (00:34 -0700)
docs/configuration.md
public/assets/custom.css.sample [new file with mode: 0644]
src/components/Service.vue

index a8c0619487b5869ee5dbdaae4c3033f48d3f3439..22f50fc0eecf45098174cfd9b2cbb7d3a64ec05a 100644 (file)
@@ -110,10 +110,8 @@ services:
         subtitle: "Another example"
         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
+        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:
diff --git a/public/assets/custom.css.sample b/public/assets/custom.css.sample
new file mode 100644 (file)
index 0000000..2465757
--- /dev/null
@@ -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;
+}
index 1766af648c7bdbf25c99cdf4febc341a531459ff..4e35b7dc7b9024078fe9f5c84267aef0c4cc6091 100644 (file)
@@ -4,7 +4,7 @@
       <a :href="item.url" :target="item.target" rel="noreferrer">
         <div
           class="card-content"
-          :style="(item.colors && item.colors.background) ? {backgroundColor: item.colors.background} : null"
+          :class="item.class"
         >
           <div class="media">
             <div v-if="item.logo" class="media-left">
             <div class="media-content">
               <p
                 class="title is-4"
-                :style="(item.colors && item.colors.text) ? {color: item.colors.text} : null"
+                :class="item.class"
               >{{ item.name }}</p>
               <p
                 class="subtitle is-6"
-                :style="(item.colors && item.colors.text) ? {color: item.colors.text} : null"
+                :class="item.class"
               >{{ item.subtitle }}</p>
             </div>
           </div>