Skip to content

Commit fb4fc9c

Browse files
feat: allow external css loaded in auth app
1 parent 1c6ab4a commit fb4fc9c

27 files changed

+445
-267
lines changed

apps/auth/public/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,22 @@
1313
</noscript>
1414
<div id="app"></div>
1515
<!-- built files will be auto injected -->
16+
<script type="application/javascript">
17+
((global, doc) => {
18+
const query = new Map(global.location.search.substring(1).split('&').map(str => str.split('=')));
19+
const cssQuery = query.has('css') ? global.decodeURIComponent(query.get('css')) : undefined;
20+
21+
if (!cssQuery) { return; }
22+
23+
const cssId = global.btoa(cssQuery);
24+
if (!doc.getElementById(cssId)) {
25+
// console.log("cssQuery", cssQuery, cssId);
26+
const file = doc.createElement("link");
27+
file.rel = "stylesheet";
28+
file.href = cssQuery;
29+
doc.body.appendChild(file);
30+
}
31+
})(window, document);
32+
</script>
1633
</body>
1734
</html>

apps/auth/src/App.vue

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,13 @@
3131
</template>
3232

3333
<script setup lang="ts">
34-
import { AuthAppHeaderBar } from "hackathon-demo/libs/components";
35-
import {
36-
useSolidProfile,
37-
useSolidSession,
38-
} from "hackathon-demo/libs/composables";
34+
import appLogo from "@/assets/logo.svg";
35+
import {AuthAppHeaderBar} from "hackathon-demo/libs/components";
36+
import {useSolidProfile, useSolidSession,} from "hackathon-demo/libs/composables";
3937
import Card from "primevue/card";
4038
import Toast from "primevue/toast";
41-
import { computed } from "vue";
39+
import {computed} from "vue";
4240
import router from "./router";
43-
import appLogo from "@/assets/logo.svg";
4441
4542
const { session, restoreSession } = useSolidSession();
4643
const { memberOf } = useSolidProfile();
@@ -51,10 +48,8 @@ const isLoggedIn = computed(() => {
5148
);
5249
});
5350
54-
console.log(appLogo);
55-
5651
// re-use Solid session
57-
router.isReady().then(restoreSession);
52+
router.isReady().then(() => restoreSession());
5853
</script>
5954

6055
<style>

apps/tom/public/auth.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:root {
2+
--shared-auth-app-header-bar-background-color-from: #ff0;
3+
--shared-auth-app-header-bar-background-color-to: #ff0;
4+
}

libs/components/dist/AuthAppHeaderBar.common.js

Lines changed: 81 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/components/dist/AuthAppHeaderBar.common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)