Skip to content

Commit

Permalink
move some common styling and formkit plugin naming (#73)
Browse files Browse the repository at this point in the history
* move common styling, add wishlist to errorlayout, add naming to formkitplugins

* adjust indent
  • Loading branch information
m-borgmann authored Oct 11, 2024
1 parent eac79f8 commit ce1ca06
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 28 deletions.
6 changes: 5 additions & 1 deletion assets/css/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ h3 {

h4, h5 {
@apply text-lg;
}
}

#__nuxt {
@apply grid min-h-screen grid-rows-[auto_1fr_auto];
}
4 changes: 4 additions & 0 deletions components/Error/ErrorLayout.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<script setup lang="ts">
const customerStore = useCustomerStore();
const { loading } = storeToRefs(customerStore);
const { refreshCart } = useCart();
const { getWishlistProducts } = useWishlist();
customerStore.refreshContext();
refreshCart();
getWishlistProducts();
</script>

<template>
Expand Down
38 changes: 22 additions & 16 deletions formkit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@ import { de } from '@formkit/i18n';
import { createAutoAnimatePlugin, createFloatingLabelsPlugin } from '@formkit/addons';
import '@formkit/addons/css/floatingLabels';

export const plugins = {
'autoAnimate': createAutoAnimatePlugin
(
{
duration: 250,
easing: 'ease-in-out',
},
{
global: ['outer', 'inner'],
form: ['form'],
repeater: ['items'],
}
),
'floatingLabels': createFloatingLabelsPlugin
(
{
useAsDefault: true,
}
),
};

export default {
iconLoader: (iconName: string) => {
const getIcon = async (iconkey: string) => {
Expand Down Expand Up @@ -63,22 +84,7 @@ export default {
config: {
rootClasses,
},
plugins: [
createAutoAnimatePlugin(
{
duration: 250,
easing: 'ease-in-out',
},
{
global: ['outer', 'inner'],
form: ['form'],
repeater: ['items'],
},
),
createFloatingLabelsPlugin({
useAsDefault: true, // defaults to false
}),
],
plugins: Object.values(plugins),
props: {
decoratorIcon: 'check',
},
Expand Down
12 changes: 1 addition & 11 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (route.path !== '/wishlist' && wishlistEnabled) {
</script>

<template>
<NuxtLoadingIndicator />
<NuxtLoadingIndicator class="!bg-brand-primary !bg-none" />
<NuxtRouteAnnouncer />
<UtilityLoadingSpinner v-if="loading" />

Expand All @@ -44,13 +44,3 @@ if (route.path !== '/wishlist' && wishlistEnabled) {
<LayoutFooter v-show="!loading" />
<CookieBanner />
</template>

<style>
#__nuxt {
@apply grid min-h-screen grid-rows-[auto_1fr_auto];
}
.nuxt-loading-indicator {
@apply !bg-brand-primary !bg-none;
}
</style>

0 comments on commit ce1ca06

Please sign in to comment.