Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 32 additions & 39 deletions templates/vue/tailwind/src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,60 @@
/>

<div class="mb-8 text-center">
<div class="font-light">Welcome to</div>
<h1 class="text-7xl font-heading my-0 font-medium">Vuetify</h1>
<div class="font-light -mb-1">Welcome to</div>
<h1 class="text-6xl font-bold">Vuetify</h1>
</div>

<div class="grid md:grid-cols-2 gap-4">
<v-card
class="hero-card"
color="surface-variant"
class="hero-card md:col-span-2"
image="https://cdn.vuetifyjs.com/docs/images/one/create/feature.png"
rounded="xl"
variant="tonal"
rounded="3xl"
variant="flat"
>
<template #prepend>
<v-avatar class="ml-2 mr-4" icon="mdi-rocket-launch-outline" size="60" variant="tonal" />
</template>

<template #image>
<v-img alt="Hero card supplemental image" class="hidden sm:block my-auto" height="120" position="top right" />
<v-img class="hidden md:flex" position="top right" />
</template>

<template #title>
<h2 class="text-2xl font-heading my-0 font-medium pt-1 translate-y-1">
<h2 class="text-2xl font-medium my-0">
Get started
</h2>
</template>

<template #subtitle>
<div class="mt-2">
<div class="leading-7">
Change this page by updating <v-code>components/HelloWorld.vue</v-code>.
</div>
</template>
</v-card>

<v-card
v-for="link in links"
:key="link.href"
append-icon="mdi-arrow-top-right"
class="feature-card"
color="surface-variant"
:href="link.href"
rel="noopener noreferrer"
rounded="xl"
:key="link.href"
:subtitle="link.subtitle"
target="_blank"
:title="link.title"
variant="tonal"
class="
h-full py-3 rounded-3xl transition-[border-radius] hover:rounded-lg
flex items-center [&>.v-card-item]:w-full
group"
rel="noopener noreferrer"
target="_blank"
variant="flat"
>
<template #prepend>
<v-avatar class="ml-2 mr-4" :icon="link.icon" size="60" variant="tonal" />
<v-avatar :icon="link.icon" size="60" variant="tonal" class="ml-2 mr-4" />
</template>
<template #append>
<v-icon class="ml-1 opacity-0 transition group-hover:opacity-90 group-hover:-translate-x-1" icon="mdi-open-in-new" />
</template>
<template #subtitle>
<div class="line-clamp-2 text-wrap">{{ link.subtitle }}</div>
</template>
</v-card>
</div>
Expand Down Expand Up @@ -94,31 +99,19 @@
]
</script>

<style>
<style scoped>
@reference "../styles/tailwind.css";

.v-card {
@apply rounded-xl;
}

/*
1. mixing helper classes and @apply for demonstration purposes only
2. the classes below are NOT wrapped in any CSS layer, so they "win" over everything else
*/
.hero-card {
@apply md:col-span-2 md:py-4 sm:pr-[120px] w-full bg-primary-100 dark:bg-primary-900
@apply py-3 md:pr-[120px] w-full;
}

.v-card-subtitle {
@apply text-wrap line-clamp-2 leading-[1.2];
--v-medium-emphasis-opacity: .8;
}

.feature-card {
@apply flex items-center [&>.v-card-item]:w-full bg-secondary-100;
@apply dark:bg-linear-to-r dark:from-secondary-800 dark:to-secondary-600 dark:text-white;

.v-card-item {
@apply self-stretch;
}
.v-card-item__content {
@apply self-stretch py-2;
}
:deep(.v-card) {
@apply bg-gray-200;
@apply dark:bg-black dark:bg-linear-to-r dark:from-primary/50 dark:to-primary/30 dark:text-white/80;
}
</style>
7 changes: 6 additions & 1 deletion templates/vue/tailwind/src/styles/layers.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
@layer tailwind-theme;
@layer tailwind-reset;

@layer vuetify-core;
@layer vuetify-components;
@layer vuetify-overrides;
@layer vuetify-utilities;
@layer tailwind;

@layer tailwind-utilities;

@layer vuetify-final;
83 changes: 48 additions & 35 deletions templates/vue/tailwind/src/styles/tailwind.css
Original file line number Diff line number Diff line change
@@ -1,35 +1,22 @@
@import "tailwindcss/theme" layer(tailwind.theme);
@import "tailwindcss/utilities" layer(tailwind.utilities);

@config "../../tailwind.config.ts";
@import "tailwindcss/theme" layer(tailwind-theme);
@import "tailwindcss/preflight" layer(tailwind-reset);
@import "tailwindcss/utilities" layer(tailwind-utilities);

@theme {
--font-heading: "Roboto", sans-serif;
--font-body: "Roboto", sans-serif;
--font-mono: "Roboto Mono", monospace;

--radius-sm: 2px;
--radius-lg: 8px;
--radius-xl: 24px;

--color-background: rgb(var(--v-theme-background));
--color-surface: rgb(var(--v-theme-surface));
--color-on-surface: rgb(var(--v-theme-on-surface));

--color-primary: rgb(var(--v-theme-primary));
--color-success: rgb(var(--v-theme-success));
--color-info: rgb(var(--v-theme-info));
--color-warning: rgb(var(--v-theme-warning));
--color-error: rgb(var(--v-theme-error));

--color-primary-100: #a7e0ff;
--color-primary-900: #003256;
--color-secondary-100: #92f7ff;
--color-secondary-200: #57f0ff;
--color-secondary-300: #10e3fb;
--color-secondary-400: #00c1da;
--color-secondary-500: #009fbd;
--color-secondary-600: #0087a4;
--color-secondary-700: #097088;
--color-secondary-800: #0d5d73;

--breakpoint-*: initial;
--breakpoint-xs: 0px;
--breakpoint-sm: 600px;
Expand All @@ -42,23 +29,49 @@
@custom-variant light (&:where(.v-theme--light, .v-theme--light *));
@custom-variant dark (&:where(.v-theme--dark, .v-theme--dark *));

@utility rounded-0 { border-radius: 0 }
@utility rounded-sm { border-radius: var(--radius-sm) }
@utility rounded-lg { border-radius: var(--radius-lg) }
@utility rounded-xl { border-radius: var(--radius-xl) }
/* safelist to ensure variables are always available */
@source inline('font-heading');
@source inline('font-body');
@source inline('font-mono');

@utility rounded-t-sm { border-top-left-radius: var(--radius-sm); border-top-right-radius: var(--radius-sm) }
@utility rounded-t-lg { border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg) }
@utility rounded-t-xl { border-top-left-radius: var(--radius-xl); border-top-right-radius: var(--radius-xl) }
/*
note: adopt and extend values from TailwindCSS
*/
@utility rounded-pill { border-radius: 9999px }
@utility rounded-circle { border-radius: 50% }
@utility rounded-shaped { border-radius: 24px 0 }

@utility rounded-b-sm { border-bottom-left-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm) }
@utility rounded-b-lg { border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg) }
@utility rounded-b-xl { border-bottom-left-radius: var(--radius-xl); border-bottom-right-radius: var(--radius-xl) }
@source inline('rounded'); /* .25rem */
@source inline('rounded-{none,sm,md,lg,xl,2xl,3xl,full,pill,circle,shaped}');

@utility rounded-s-sm { border-start-start-radius: var(--radius-sm); border-end-start-radius: var(--radius-sm) }
@utility rounded-s-lg { border-start-start-radius: var(--radius-lg); border-end-start-radius: var(--radius-lg) }
@utility rounded-s-xl { border-start-start-radius: var(--radius-xl); border-end-start-radius: var(--radius-xl) }
/* MD3 elevation */
@utility elevation-0 {
box-shadow: 0px 0px 0px 0px rgba(var(--v-shadow-color), var(--v-shadow-key-opacity, 0.3)), 0px 0px 0px 0px rgba(var(--v-shadow-color), var(--v-shadow-ambient-opacity, 0.15));
--v-elevation-overlay: color-mix(in srgb, var(--v-elevation-overlay-color) 0%, transparent);
}
@utility elevation-1 {
box-shadow: 0px 1px 2px 0px rgba(var(--v-shadow-color), var(--v-shadow-key-opacity, 0.3)), 0px 1px 3px 1px rgba(var(--v-shadow-color), var(--v-shadow-ambient-opacity, 0.15));
--v-elevation-overlay: color-mix(in srgb, var(--v-elevation-overlay-color) 2%, transparent);
}
@utility elevation-2 {
box-shadow: 0px 1px 2px 0px rgba(var(--v-shadow-color), var(--v-shadow-key-opacity, 0.3)), 0px 2px 6px 2px rgba(var(--v-shadow-color), var(--v-shadow-ambient-opacity, 0.15));
--v-elevation-overlay: color-mix(in srgb, var(--v-elevation-overlay-color) 4%, transparent);
}
@utility elevation-3 {
box-shadow: 0px 1px 3px 0px rgba(var(--v-shadow-color), var(--v-shadow-key-opacity, 0.3)), 0px 4px 8px 3px rgba(var(--v-shadow-color), var(--v-shadow-ambient-opacity, 0.15));
--v-elevation-overlay: color-mix(in srgb, var(--v-elevation-overlay-color) 6%, transparent);
}
@utility elevation-4 {
box-shadow: 0px 2px 3px 0px rgba(var(--v-shadow-color), var(--v-shadow-key-opacity, 0.3)), 0px 6px 10px 4px rgba(var(--v-shadow-color), var(--v-shadow-ambient-opacity, 0.15));
--v-elevation-overlay: color-mix(in srgb, var(--v-elevation-overlay-color) 8%, transparent);
}
@utility elevation-5 {
box-shadow: 0px 4px 4px 0px rgba(var(--v-shadow-color), var(--v-shadow-key-opacity, 0.3)), 0px 8px 12px 6px rgba(var(--v-shadow-color), var(--v-shadow-ambient-opacity, 0.15));
--v-elevation-overlay: color-mix(in srgb, var(--v-elevation-overlay-color) 10%, transparent);
}
@utility elevation-overlay {
background-image: linear-gradient(var(--v-elevation-overlay), var(--v-elevation-overlay));
}

@utility rounded-e-sm { border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm) }
@utility rounded-e-lg { border-start-end-radius: var(--radius-lg); border-end-end-radius: var(--radius-lg) }
@utility rounded-e-xl { border-start-end-radius: var(--radius-xl); border-end-end-radius: var(--radius-xl) }
/* safelist for elevation="..." props */
@source inline('elevation-{0,1,2,3,4,5}');
15 changes: 0 additions & 15 deletions templates/vue/tailwind/tailwind.config.ts

This file was deleted.