Skip to content

Commit

Permalink
feat: add additional css to theme (#3413)
Browse files Browse the repository at this point in the history
* feat: add additional css to theme
  • Loading branch information
MaxPostema authored Feb 27, 2024
1 parent d5d1b55 commit 069ff17
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 47 deletions.
45 changes: 0 additions & 45 deletions apps/directory/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,48 +83,3 @@ export default {
},
};
</script>

<style>
/* removing the built-in nav because it conflicts */
nav[aria-label="breadcrumb"]:not(.directory-nav) {
display: none;
}
ol.breadcrumb {
margin-top: 0.25rem !important;
margin-bottom: 0.25rem !important;
}
/* emx2 style override */
#app > div {
background-color: white !important;
}
nav.navbar {
background-color: #e9ecef !important;
}
nav.navbar a.nav-link,
nav.navbar button.btn {
color: #495057 !important;
background-color: transparent;
}
nav.navbar a.nav-link:hover,
nav.navbar button.btn:hover {
color: #ec6707 !important;
}
nav.navbar button.btn.btn-outline-light:not(.border-0) {
border-color: #495057 !important;
}
nav.navbar button.btn.btn-outline-light:not(.border-0):hover {
border-color: #ec6707 !important;
background-color: #ec6707 !important;
color: #dbedff !important;
}
.filterbar > details.dropdown-button > summary {
color: #08205c !important;
}
.filterbar > details.dropdown-button[open] > summary,
.filterbar > details.dropdown-button:hover > summary,
.filterbar > details.text-white > summary {
color: white !important;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
:locales="locales"
/>
</div>
<component is="style">
{{ session.settings.additionalCss }}
</component>
</div>
</template>

Expand All @@ -65,7 +68,7 @@ import { ISetting } from "meta-data-utils";
const { cookies } = useCookies();
const query = `{
_session { email, roles, schemas, token, settings{key,value} },
_settings (keys: ["menu", "page.", "cssURL", "logoURL", "isOidcEnabled","locales"]){ key, value },
_settings (keys: ["menu", "page.", "cssURL", "logoURL", "isOidcEnabled","locales", "additionalCss"]){ key, value },
_manifest { ImplementationVersion,SpecificationVersion,DatabaseVersion }
}`;
const defaultSession = { locale: "en", settings: {} };
Expand Down
23 changes: 22 additions & 1 deletion apps/settings/src/components/Theme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,25 @@
/>
{{ primaryColor }}
<InputString
class="mt-3"
id="theme-url-input"
label="Set logo url"
v-model="logoURL"
/>
<InputText
id="additional-css-input"
label="Additional Css"
v-model="additionalCss"
/>

<ButtonAction @click="saveSettings">Save theme</ButtonAction>
<br /><br />
<a :href="this.session.settings.cssURL">view theme css</a>
<a
v-if="this.session.settings.cssURL"
:href="this.session.settings.cssURL"
>
view theme css
</a>
</div>
</div>
</template>
Expand All @@ -30,6 +42,7 @@
import {
ButtonAction,
InputString,
InputText,
MessageError,
MessageSuccess,
Spinner,
Expand All @@ -41,6 +54,7 @@ import { request } from "graphql-request";
export default {
components: {
InputString,
InputText,
ButtonAction,
MessageError,
MessageSuccess,
Expand All @@ -58,6 +72,7 @@ export default {
loading: false,
graphqlError: null,
success: null,
additionalCss: null,
};
},
created() {
Expand All @@ -70,6 +85,7 @@ export default {
},
methods: {
loadSettings() {
this.additionalCss = this.session?.settings?.additionalCss;
if (this.session?.settings?.cssURL) {
this.logoURL = this.session.settings.logoURL;
const urlParams = new URL(
Expand Down Expand Up @@ -103,6 +119,11 @@ export default {
} else {
settingsDrop.push({ key: "logoURL" });
}
if (this.additionalCss) {
settingsAlter.push({ key: "additionalCss", value: this.additionalCss });
} else {
settingsDrop.push({ key: "additionalCss" });
}
this.$emit("reload");
this.loading = true;
this.loading = true;
Expand Down

0 comments on commit 069ff17

Please sign in to comment.