Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

✨ Adds icon-only color option

Alicia Sykesa78f38b9821a
diff --git a/src/components/LinkItems/Item.vue b/src/components/LinkItems/Item.vue
index 41ff37b5..0e538cfc 100644
--- a/src/components/LinkItems/Item.vue
+++ b/src/components/LinkItems/Item.vue
@@ -24,7 +24,7 @@
<p class="description">{{ item.description }}</p>
</div>
<!-- Item Icon -->
- <Icon :icon="itemIcon" :url="item.url" :size="size" :color="item.color"
+ <Icon :icon="itemIcon" :url="item.url" :size="size"
v-bind:style="customStyles" class="bounce" />
<!-- Small icon, showing opening method on hover -->
<ItemOpenMethodIcon class="opening-method-icon"
diff --git a/src/components/Workspace/SideBar.vue b/src/components/Workspace/SideBar.vue
index bb956cfc..acd3be11 100644
--- a/src/components/Workspace/SideBar.vue
+++ b/src/components/Workspace/SideBar.vue
@@ -145,8 +145,8 @@ export default {
const items = this.workspaceSections.flatMap((section) => section.items)
.flatMap((item) => item.subItems || [item]);
return this.openUrls.map((url) => {
- const { title, icon } = items.find((item) => sameUrl(item.url, url)) || { title: new URL(url).host };
- return { title, icon, url };
+ const { title, icon, iconColor } = items.find((item) => sameUrl(item.url, url)) || { title: new URL(url).host };
+ return { title, icon, iconColor, url };
});
},
searchEnabled() {
diff --git a/src/components/Workspace/SideBarItem.vue b/src/components/Workspace/SideBarItem.vue
index 989df78c..5c5abd3a 100644
--- a/src/components/Workspace/SideBarItem.vue
+++ b/src/components/Workspace/SideBarItem.vue
@@ -7,7 +7,8 @@
v-tooltip="{ content: item.title, disabled: !item.title, placement: 'right' }"
@click.exact="launch"
>
- <Icon v-if="item.icon" :icon="item.icon" :url="item.url" size="small" />
+ <Icon v-if="item.icon" :icon="item.icon" :url="item.url" size="small"
+ :style="{ color: item.iconColor }" />
<span v-else class="initials">{{ initials }}</span>
<span class="title">{{ item.title }}</span>
</component>
diff --git a/src/mixins/ItemMixin.js b/src/mixins/ItemMixin.js
index 6179fdbc..0f405334 100644
--- a/src/mixins/ItemMixin.js
+++ b/src/mixins/ItemMixin.js
@@ -33,10 +33,6 @@ export default {
posX: undefined,
posY: undefined,
},
- customStyles: {
- color: this.item.color,
- background: this.item.backgroundColor,
- },
};
},
computed: {
@@ -199,6 +195,12 @@ export default {
+ `color:${this.item.color};`
+ `background:${this.item.backgroundColor}`;
},
+ customStyles() {
+ return {
+ color: this.item.iconColor || this.item.color,
+ background: this.item.backgroundColor,
+ };
+ },
},
methods: {
/* Checks if a given service is currently online */
diff --git a/src/utils/config/ConfigSchema.json b/src/utils/config/ConfigSchema.json
index f2285736..44dba42a 100644
--- a/src/utils/config/ConfigSchema.json
+++ b/src/utils/config/ConfigSchema.json
@@ -1412,6 +1412,11 @@
"type": "string",
"description": "A custom fill color of the item, expressed either as hex code or color name"
},
+ "iconColor": {
+ "title": "Icon Color",
+ "type": "string",
+ "description": "A custom color for just the icon, expressed either as hex code or color name. Overrides color. Applies to font-awesome, simple-icons and mdi icons"
+ },
"backgroundColor": {
"title": "Background Color",
"type": "string",