Skip to content

Commit

Permalink
refactor(site): 馃帶 Extracted explicit styles
Browse files Browse the repository at this point in the history
  • Loading branch information
oyedejioyewole committed Feb 10, 2024
1 parent bb5d038 commit ec82852
Show file tree
Hide file tree
Showing 22 changed files with 782 additions and 352 deletions.
2 changes: 1 addition & 1 deletion docs/app.vue
Expand Up @@ -15,6 +15,6 @@ useHead({

<style lang="scss">
body {
@apply bg-primary-100 text-primary-900 transition selection:bg-primary-200 dark:bg-primary-900 dark:text-primary-100 dark:selection:bg-primary-800;
@apply bg-primary-100 text-primary-900 transition-colors selection:bg-black/20 dark:bg-primary-900 dark:text-primary-100 dark:selection:bg-white/20;
}
</style>
95 changes: 60 additions & 35 deletions docs/components/Footer.client.vue
@@ -1,4 +1,6 @@
<script setup lang="ts">
defineEmits<{ (name: "toggle-cursor-fx"): void }>();
const theme = useColorMode();
const toggleTheme = () => {
Expand All @@ -10,47 +12,70 @@ const toggleTheme = () => {

<template>
<footer
class="mx-auto flex flex-col items-center justify-center gap-y-4 py-10 md:flex-row lg:w-1/2"
class="mx-auto flex w-[90%] flex-col items-center justify-center gap-y-4 py-10 md:flex-row lg:w-1/2"
>
<h1 class="basis-1/2 text-lg tracking-wide">
Made with 馃 路 Hosted on Vercel
</h1>

<div class="flex basis-1/2 items-center justify-end gap-x-5 text-2xl">
<!-- Bootstrap Icons -->
<NuxtLink target="_blank" to="https://icons.getbootstrap.com">
<BootstrapIcon name="bootstrap-fill" />
</NuxtLink>

<!-- Repository -->
<NuxtLink
target="_blank"
to="https://github.com/OyewoleOyedeji/nuxt-bootstrap-icons"
>
<BootstrapIcon name="github" />
</NuxtLink>

<!-- Nuxt -->
<NuxtLink target="_blank" to="https://nuxt.com">
<svg
class="fill-primary-900 transition dark:fill-primary-100"
height="25"
width="25"
viewBox="0 0 512 512"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M281.44 397.667H438.32C443.326 397.667 448.118 395.908 452.453 393.427C456.789 390.946 461.258 387.831 463.76 383.533C466.262 379.236 468.002 374.36 468 369.399C467.998 364.437 466.266 359.563 463.76 355.268L357.76 172.947C355.258 168.65 352.201 165.534 347.867 163.053C343.532 160.573 337.325 158.813 332.32 158.813C327.315 158.813 322.521 160.573 318.187 163.053C313.852 165.534 310.795 168.65 308.293 172.947L281.44 219.587L227.733 129.13C225.229 124.834 222.176 120.307 217.84 117.827C213.504 115.346 208.713 115 203.707 115C198.701 115 193.909 115.346 189.573 117.827C185.238 120.307 180.771 124.834 178.267 129.13L46.8267 355.268C44.3208 359.563 44.0022 364.437 44 369.399C43.9978 374.36 44.3246 379.235 46.8267 383.533C49.3288 387.83 53.7979 390.946 58.1333 393.427C62.4688 395.908 67.2603 397.667 72.2667 397.667H171.2C210.401 397.667 238.934 380.082 258.827 346.787L306.88 263.4L332.32 219.587L410.053 352.44H306.88L281.44 397.667ZM169.787 352.44H100.533L203.707 174.36L256 263.4L221.361 323.784C208.151 345.387 193.089 352.44 169.787 352.44Z"
/>
</svg>
</NuxtLink>
<ul class="flex basis-1/2 items-center justify-end gap-x-5 text-2xl">
<li class="contents">
<ul class="contents">
<!-- Bootstrap Icons -->
<li>
<NuxtLink target="_blank" to="https://icons.getbootstrap.com">
<BootstrapIcon name="bootstrap-fill" />
</NuxtLink>
</li>

<!-- Repository -->
<li>
<NuxtLink
target="_blank"
to="https://github.com/OyewoleOyedeji/nuxt-bootstrap-icons"
>
<BootstrapIcon name="github" />
</NuxtLink>
</li>

<!-- Nuxt -->
<li>
<NuxtLink target="_blank" to="https://nuxt.com">
<svg
class="fill-primary-900 dark:fill-primary-100"
height="25"
width="25"
viewBox="0 0 512 512"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M281.44 397.667H438.32C443.326 397.667 448.118 395.908 452.453 393.427C456.789 390.946 461.258 387.831 463.76 383.533C466.262 379.236 468.002 374.36 468 369.399C467.998 364.437 466.266 359.563 463.76 355.268L357.76 172.947C355.258 168.65 352.201 165.534 347.867 163.053C343.532 160.573 337.325 158.813 332.32 158.813C327.315 158.813 322.521 160.573 318.187 163.053C313.852 165.534 310.795 168.65 308.293 172.947L281.44 219.587L227.733 129.13C225.229 124.834 222.176 120.307 217.84 117.827C213.504 115.346 208.713 115 203.707 115C198.701 115 193.909 115.346 189.573 117.827C185.238 120.307 180.771 124.834 178.267 129.13L46.8267 355.268C44.3208 359.563 44.0022 364.437 44 369.399C43.9978 374.36 44.3246 379.235 46.8267 383.533C49.3288 387.83 53.7979 390.946 58.1333 393.427C62.4688 395.908 67.2603 397.667 72.2667 397.667H171.2C210.401 397.667 238.934 380.082 258.827 346.787L306.88 263.4L332.32 219.587L410.053 352.44H306.88L281.44 397.667ZM169.787 352.44H100.533L203.707 174.36L256 263.4L221.361 323.784C208.151 345.387 193.089 352.44 169.787 352.44Z"
/>
</svg>
</NuxtLink>
</li>
</ul>
</li>

<li>
<hr class="w-8 border border-primary-900 dark:border-primary-100" />
</li>

<!-- Toggle cursor effects -->
<li>
<button type="button" @click="$emit('toggle-cursor-fx')">
<BootstrapIcon name="stars" />
</button>
</li>

<!-- Theme switcher -->
<button type="button" @click="toggleTheme">
<BootstrapIcon
:name="$colorMode.value === 'light' ? 'moon-stars' : 'sun'"
/>
</button>
</div>
<li>
<button type="button" @click="toggleTheme">
<BootstrapIcon
:name="$colorMode.value === 'light' ? 'moon-stars' : 'sun'"
/>
</button>
</li>
</ul>
</footer>
</template>
7 changes: 3 additions & 4 deletions docs/components/Hero.vue
@@ -1,4 +1,3 @@
github
<script lang="ts" setup>
import iconList from "#build/nuxt-bootstrap-icons.json";
Expand Down Expand Up @@ -33,7 +32,7 @@ function generateIcons() {
</script>

<template>
<header class="grid h-screen place-content-center gap-y-20">
<header class="grid min-h-screen place-content-center gap-y-20">
<h1 class="text-center font-serif text-5xl lg:text-7xl">
Bootstrap Icons meets Nuxt
</h1>
Expand Down Expand Up @@ -63,12 +62,12 @@ function generateIcons() {

<!-- Go to release notes -->
<NuxtLink
class="group flex items-center justify-center gap-x-2 rounded-full border border-primary-900 bg-primary-300/50 p-3 backdrop-blur-xl transition dark:border-primary-100 dark:bg-primary-700/50 lg:w-[200px]"
class="group flex items-center justify-center gap-x-2 rounded-full border border-primary-900 bg-primary-300/50 p-3 backdrop-blur-xl dark:border-primary-100 dark:bg-primary-700/50 lg:w-[200px]"
to="/release-notes"
>
Release Notes
<BootstrapIcon
class="text-xl transition group-hover:translate-x-2"
class="text-xl transition-transform group-hover:translate-x-2"
name="arrow-right"
/>
</NuxtLink>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/OgImage/Page.vue
Expand Up @@ -8,7 +8,7 @@ const shades = getColorShades("primary");
<div class="w-full" :style="{ background: shades[200] }">
<div class="relative mx-auto h-screen w-[90%] py-20">
<h1 class="text-5xl font-extrabold">
{{ title }} 路 nuxt-bootstrap-icons
{{ title }}
</h1>
<p class="text-4xl">{{ description }}</p>

Expand Down
23 changes: 23 additions & 0 deletions docs/components/content/ProseA.vue
@@ -0,0 +1,23 @@
<template>
<NuxtLink
class="font-bold underline underline-offset-4"
:href="href"
:target="target"
>
<slot />
</NuxtLink>
</template>

<script setup lang="ts">
defineProps({
href: {
type: String,
default: "",
},
target: {
type: String,
default: undefined,
required: false,
},
});
</script>
5 changes: 5 additions & 0 deletions docs/components/content/ProseCodeInline.vue
@@ -0,0 +1,5 @@
<template>
<code class="rounded-lg bg-primary-300 px-3 py-1 text-sm text-primary-900">
<slot />
</code>
</template>
17 changes: 17 additions & 0 deletions docs/components/content/ProseH1.vue
@@ -0,0 +1,17 @@
<template>
<h1 class="font-serif text-4xl lg:text-6xl" :id="id">
<a v-if="generate" :href="`#${id}`">
<slot />
</a>
<slot v-else />
</h1>
</template>

<script setup lang="ts">
import { computed, useRuntimeConfig } from "#imports";
const props = defineProps<{ id?: string }>();
const { headings } = useRuntimeConfig().public.mdc;
const generate = computed(() => props.id && headings?.anchorLinks?.h1);
</script>
17 changes: 17 additions & 0 deletions docs/components/content/ProseH2.vue
@@ -0,0 +1,17 @@
<template>
<h2 class="font-serif text-3xl lg:text-4xl" :id="id">
<a v-if="id && generate" :href="`#${id}`">
<slot />
</a>
<slot v-else />
</h2>
</template>

<script setup lang="ts">
import { computed, useRuntimeConfig } from "#imports";
const props = defineProps<{ id?: string }>();
const { headings } = useRuntimeConfig().public.mdc;
const generate = computed(() => props.id && headings?.anchorLinks?.h2);
</script>
17 changes: 17 additions & 0 deletions docs/components/content/ProseH3.vue
@@ -0,0 +1,17 @@
<template>
<h3 class="font-serif text-2xl lg:text-3xl" :id="id">
<a v-if="id && generate" :href="`#${id}`">
<slot />
</a>
<slot v-else />
</h3>
</template>

<script setup lang="ts">
import { computed, useRuntimeConfig } from "#imports";
const props = defineProps<{ id?: string }>();
const { headings } = useRuntimeConfig().public.mdc;
const generate = computed(() => props.id && headings?.anchorLinks?.h3);
</script>
17 changes: 17 additions & 0 deletions docs/components/content/ProseH4.vue
@@ -0,0 +1,17 @@
<template>
<h4 class="font-serif text-xl font-bold lg:text-2xl" :id="id">
<a v-if="id && generate" :href="`#${id}`">
<slot />
</a>
<slot v-else />
</h4>
</template>

<script setup lang="ts">
import { computed, useRuntimeConfig } from "#imports";
const props = defineProps<{ id?: string }>();
const { headings } = useRuntimeConfig().public.mdc;
const generate = computed(() => props.id && headings?.anchorLinks?.h4);
</script>
3 changes: 3 additions & 0 deletions docs/components/content/ProseLi.vue
@@ -0,0 +1,3 @@
<template>
<li class="space-y-4"><slot /></li>
</template>
5 changes: 5 additions & 0 deletions docs/components/content/ProseOl.vue
@@ -0,0 +1,5 @@
<template>
<ol class="list-inside list-decimal space-y-8 text-lg">
<slot />
</ol>
</template>
3 changes: 3 additions & 0 deletions docs/components/content/ProseP.vue
@@ -0,0 +1,3 @@
<template>
<p class="text-pretty text-lg leading-loose tracking-wide"><slot /></p>
</template>
43 changes: 43 additions & 0 deletions docs/components/content/ProsePre.vue
@@ -0,0 +1,43 @@
<template>
<pre
class="overflow-x-auto rounded-lg border border-primary-900 bg-primary-200/50 p-5 text-sm backdrop-blur-2xl dark:border-primary-100 dark:bg-primary-800/50 lg:p-7"
:class="$props.class"
><slot /></pre>
</template>

<script setup lang="ts">
defineProps({
code: {
type: String,
default: "",
},
language: {
type: String,
default: null,
},
filename: {
type: String,
default: null,
},
highlights: {
type: Array as () => number[],
default: () => [],
},
meta: {
type: String,
default: null,
},
class: {
type: String,
default: null,
},
});
</script>

<style lang="scss">
pre code {
.line {
@apply block;
}
}
</style>
11 changes: 11 additions & 0 deletions docs/components/content/ProseUl.vue
@@ -0,0 +1,11 @@
<template>
<ul
class="list-inside list-disc text-lg"
:class="{
'space-y-8': $route.name === 'index',
'space-y-4': $route.name === 'release-notes',
}"
>
<slot />
</ul>
</template>
2 changes: 1 addition & 1 deletion docs/error.vue
Expand Up @@ -25,6 +25,6 @@ useHead({

<style>
body {
@apply bg-primary-100 text-primary-900 transition selection:bg-primary-200 dark:bg-primary-900 dark:text-primary-100 dark:selection:bg-primary-800;
@apply bg-primary-100 text-primary-900 transition-colors selection:bg-black/20 dark:bg-primary-900 dark:text-primary-100 dark:selection:bg-white/20;
}
</style>
11 changes: 9 additions & 2 deletions docs/layouts/default.vue
@@ -1,17 +1,24 @@
<script lang="ts" setup>
const shades = getColorShades("primary");
const { width: browserWidth } = useWindowSize();
const enableCursorFx = ref(true);
const showCursorFx = computed(() =>
browserWidth.value > 1024 && enableCursorFx.value ? true : false,
);
</script>

<template>
<NuxtLoadingIndicator :color="shades[500]" />

<div class="relative overflow-hidden">
<CursorFx />
<CursorFx v-if="showCursorFx" />

<main class="mx-auto w-[90%]">
<slot />
</main>

<Footer />
<Footer @toggle-cursor-fx="enableCursorFx = !enableCursorFx" />
</div>
</template>
6 changes: 1 addition & 5 deletions docs/nuxt.config.ts
Expand Up @@ -7,11 +7,10 @@ export default defineNuxtConfig({
content: {
defaultLocale: "en-US",
highlight: {
theme: "one-dark-pro",
theme: { dark: "github-dark", default: "github-light" },
preload: ["bash", "ts"],
},
},
css: ["notivue/animations.css", "notivue/notifications.css"],
devtools: { enabled: true },
googleFonts: {
families: {
Expand All @@ -33,9 +32,6 @@ export default defineNuxtConfig({
notivue: {
position: "bottom-center",
},
routeRules: {
"/**": { isr: true },
},
site: {
url: "https://nuxt-bootstrap-icons.vercel.app",
},
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Expand Up @@ -25,7 +25,7 @@
"locomotive-scroll": "5.0.0-beta.11",
"notivue": "^2.2.1",
"nuxt": "^3.10.1",
"vue": "^3.4.16",
"vue": "^3.4.18",
"vue-router": "^4.2.5"
},
"optionalDependencies": {
Expand Down

0 comments on commit ec82852

Please sign in to comment.