Skip to content

Commit c02578b

Browse files
feat: add tailwind module to playground, fix layout colors and styles
1 parent ac27b68 commit c02578b

14 files changed

+805
-64
lines changed

.eslintrc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,19 @@
1313
"rules": {
1414
"no-console": "off",
1515
"no-debugger": "off",
16+
"prefer-arrow-callback": "off",
1617
"vue/script-setup-uses-vars": "error",
1718
"vue/multi-word-component-names": "off",
1819
"vue/define-macros-order": "off",
19-
"tailwindcss/no-custom-classname": [
20-
"error",
21-
{ "whitelist": ["^ninja-(.*)$"] }
22-
],
20+
"tailwindcss/no-custom-classname": "off",
2321
"tailwindcss/classnames-order": "off",
2422
"prettier-vue/prettier": [
2523
"error",
2624
{
2725
"printWidth": 80,
2826
"singleQuote": true,
2927
"semi": false,
30-
"trailingComma": "none"
28+
// "trailingComma": "none"
3129
}
3230
]
3331
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@antfu/eslint-config": "^0.27.0",
3333
"@nuxt/module-builder": "latest",
3434
"@nuxt/schema": "^3.0.0-rc.11",
35+
"@nuxtjs/tailwindcss": "^5.3.3",
3536
"eslint": "8.24.0",
3637
"eslint-config-prettier": "8.5.0",
3738
"eslint-plugin-prettier-vue": "4.2.0",

playground/assets/css/main.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

playground/components/Hero.vue

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,40 @@
11
<template>
22
<section
3-
class="min-h-screen w-full overflow-hidden bg-stone-100 dark:bg-stone-900"
3+
class="min-h-screen w-full overflow-hidden bg-muted-100 dark:bg-muted-900 ltablet:bg-red"
44
>
55
<div
66
class="relative mx-auto flex min-h-screen w-full max-w-7xl flex-col justify-between px-4 pt-24"
77
>
88
<!-- Toasts -->
9-
<div class="absolute top-40 left-20 z-10">
9+
<div
10+
class="hidden md:block absolute top-40 left-20 ptablet:translate-y-96 ltablet:left-1 lg:left-20 z-10"
11+
>
1012
<ToastIconSuccess />
1113
</div>
12-
<div class="absolute top-64 left-6 z-10">
14+
<div
15+
class="hidden md:block absolute top-64 left-6 ptablet:translate-y-96 ltablet:-left-7 lg:left-6 z-10"
16+
>
1317
<ToastLabelInfo />
1418
</div>
15-
<div class="absolute top-[350px] left-24 z-10">
19+
<div
20+
class="hidden md:block absolute top-[350px] left-24 ptablet:translate-y-96 ltablet:left-5 lg:left-24 z-10"
21+
>
1622
<ToastIconSoloDanger />
1723
</div>
1824

19-
<div class="absolute top-40 right-20 z-10">
25+
<div
26+
class="absolute bottom-64 md:top-40 right-20 ptablet:translate-y-96 ltablet:right-1 lg:right-20 z-10"
27+
>
2028
<ToastUserReplyClose />
2129
</div>
22-
<div class="absolute top-64 right-6 z-10">
30+
<div
31+
class="absolute bottom-44 md:top-64 right-6 ptablet:translate-y-96 ltablet:-right-7 lg:right-6 z-10"
32+
>
2333
<ToastLabelSuccess />
2434
</div>
25-
<div class="absolute top-[350px] right-24 z-10">
35+
<div
36+
class="absolute bottom-[95px] md:top-[350px] ptablet:translate-y-96 right-24 ltablet:right-5 lg:right-24 z-10"
37+
>
2638
<ToastActionButtons />
2739
</div>
2840

@@ -35,26 +47,32 @@
3547
>Nuxt 3 Ready</span
3648
>
3749
</p>
38-
<h1 class="font-extrabold text-5xl text-stone-800 mb-2">
50+
<h1
51+
class="font-extrabold text-5xl text-muted-800 dark:text-white mb-2"
52+
>
3953
Nuxt Toaster
4054
</h1>
41-
<p class="text-lg text-stone-500 pb-3 border-b border-stone-200">
55+
<p
56+
class="text-lg text-muted-500 pb-3 border-b border-muted-200 dark:border-muted-800"
57+
>
4258
<span class="mr-2">🔔</span> A simple toaster (notifier) handler
4359
for Nuxt.js
4460
</p>
4561
</div>
4662
<!-- Copy input -->
47-
<div class="group relative w-full max-w-md mx-auto mt-4">
63+
<div
64+
class="group relative w-full flex flex-col gap-3 ptablet:max-w-md ltablet:max-w-sm lg:max-w-md mx-auto mt-4"
65+
>
4866
<input
4967
type="text"
50-
class="w-full h-14 pl-14 pr-4 py-2 rounded-xl font-mono text-stone-600 bg-white border border-stone-200 group-hover:shadow-xl group-hover:shadow-stone-400/10 dark:group-hover:shadow-stone-800/10 transition-all duration-300"
68+
class="w-full h-14 pl-14 pr-4 py-2 rounded-xl font-mono text-muted-600 dark:text-muted-400 bg-white dark:bg-muted-1000 border border-muted-200 dark:border-muted-800 group-hover:shadow-xl group-hover:shadow-muted-400/10 dark:group-hover:shadow-muted-800/10 transition-all duration-300"
5169
value="npm i -D @cssninja/nuxt-toaster"
5270
/>
5371
<!-- Terminal icon -->
5472
<div
5573
class="absolute top-0 left-0 w-14 h-14 flex items-center justify-center"
5674
>
57-
<svg class="w-6 h-6 text-stone-400" viewBox="0 0 256 256">
75+
<svg class="w-6 h-6 text-muted-400" viewBox="0 0 256 256">
5876
<path
5977
fill="currentColor"
6078
d="m117.3 134l-72 64a8.1 8.1 0 0 1-5.3 2a8 8 0 0 1-5.3-14l65.3-58l-65.3-58a8 8 0 1 1 10.6-12l72 64a8 8 0 0 1 0 12Zm98.7 50h-96a8 8 0 0 0 0 16h96a8 8 0 0 0 0-16Z"
@@ -64,7 +82,7 @@
6482
<!-- Copy button -->
6583
<button
6684
type="button"
67-
class="absolute top-2 right-2 h-10 py-2 px-5 rounded-lg text-sm text-white bg-indigo-500"
85+
class="w-full lg:w-auto lg:absolute top-2 right-2 h-12 lg:h-10 py-2 px-5 rounded-lg text-sm text-white bg-indigo-500 hover:shadow-xl hover:shadow-indigo-500/20 dark:hover:shadow-indigo-800/10 transition-all duration-300"
6886
>
6987
Copy
7088
</button>

playground/components/Navigation.vue

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,66 @@ const isChecked = ref(false)
1414
<template>
1515
<div
1616
class="fixed top-0 left-0 w-full z-50 transition-all duration-300"
17-
:class="[isScrolled && 'bg-white dark:bg-slate-800']"
17+
:class="[
18+
isScrolled && 'bg-white dark:bg-muted-1000',
19+
mobileOpen ? 'bg-white dark:bg-muted-1000' : '',
20+
]"
1821
>
1922
<div class="mx-auto w-full max-w-7xl p-4">
20-
<div class="flex items-center justify-between gap-x-2">
21-
<div class="flex items-center gap-x-2">
23+
<div class="w-full flex items-center justify-between gap-x-2">
24+
<div class="w-full lg:w-auto flex items-center gap-x-2">
2225
<img class="w-9 h-9" src="/assets/img/logo.svg" alt="Logo" />
23-
<img class="h-5" src="/assets/img/logo-text.svg" alt="Logo text" />
26+
<img
27+
class="h-5 dark:invert"
28+
src="/assets/img/logo-text.svg"
29+
alt="Logo text"
30+
/>
31+
32+
<!-- Hamburger -->
33+
<button
34+
class="flex relative justify-center items-center ml-auto w-10 h-10 focus:outline-none lg:hidden"
35+
@click="mobileOpen = !mobileOpen"
36+
>
37+
<div
38+
class="block top-1/2 left-6 w-4 -translate-x-1/2 -translate-y-1/2"
39+
>
40+
<span
41+
class="block absolute w-7 h-0.5 text-indigo-500 bg-current transition duration-500 ease-in-out"
42+
:class="mobileOpen ? 'rotate-45' : '-translate-y-2'"
43+
/>
44+
<span
45+
class="block absolute w-5 h-0.5 text-indigo-500 bg-current transition duration-500 ease-in-out"
46+
:class="mobileOpen ? 'opacity-0' : ''"
47+
/>
48+
<span
49+
class="block absolute w-7 h-0.5 text-indigo-500 bg-current transition duration-500 ease-in-out"
50+
:class="mobileOpen ? '-rotate-45' : 'translate-y-2'"
51+
/>
52+
</div>
53+
</button>
2454
</div>
25-
<div class="flex items-center justify-end divide-x divide-stone-300">
26-
<div class="flex items-center justify-end gap-x-5 pr-4">
27-
<NuxtLink to="/">Examples</NuxtLink>
28-
<NuxtLink to="/api">API docs</NuxtLink>
55+
<div
56+
class="lg:flex flex-col lg:flex-row items-center justify-end p-6 lg:p-0 space-y-3 lg:space-y-0 lg:divide-x divide-muted-300 dark:divide-muted-700 bg-white dark:bg-muted-900 lg:bg-transparent dark:lg:bg-transparent"
57+
:class="mobileOpen ? 'fixed top-[72px] left-0 w-full flex' : 'hidden'"
58+
>
59+
<div
60+
class="flex flex-col lg:flex-row items-center justify-end gap-x-5 lg:pr-4 space-y-3 lg:space-y-0"
61+
>
62+
<NuxtLink
63+
to="/"
64+
class="text-muted-700 hover:text-muted-500 dark:text-muted-400 dark:hover:text-muted-200 transition-colors duration-300"
65+
>Examples</NuxtLink
66+
>
67+
<NuxtLink
68+
to="/api"
69+
class="text-muted-700 hover:text-muted-500 dark:text-muted-400 dark:hover:text-muted-200 transition-colors duration-300"
70+
>API docs</NuxtLink
71+
>
2972
</div>
30-
<div class="flex items-center justify-end gap-x-1 pl-4">
73+
<div class="flex items-center justify-end gap-x-1 lg:pl-4">
3174
<NuxtLink
3275
to="/"
33-
class="w-10 h-10 flex items-center justify-center rounded-full"
76+
class="w-10 h-10 flex items-center justify-center rounded-full text-muted-700 hover:text-muted-500 dark:text-muted-400 dark:hover:text-muted-200 transition-colors duration-300"
3477
>
3578
<svg class="w-5 h-5" viewBox="0 0 1536 1504">
3679
<path
@@ -41,7 +84,7 @@ const isChecked = ref(false)
4184
</NuxtLink>
4285
<NuxtLink
4386
to="/"
44-
class="w-10 h-10 flex items-center justify-center rounded-full"
87+
class="w-10 h-10 flex items-center justify-center rounded-full text-muted-700 hover:text-muted-500 dark:text-muted-400 dark:hover:text-muted-200 transition-colors duration-300"
4588
>
4689
<svg class="w-5 h-5" viewBox="0 0 1600 1280">
4790
<path
@@ -51,17 +94,15 @@ const isChecked = ref(false)
5194
</svg>
5295
</NuxtLink>
5396
<!-- Theme -->
54-
<label
55-
class="block w-9 h-9 overflow-hidden relative mx-auto mb-4 lg:m-0"
56-
>
97+
<label class="block w-9 h-9 overflow-hidden relative mx-auto">
5798
<input
5899
v-model="isChecked"
59100
type="checkbox"
60101
class="absolute top-0 left-0 z-[2] w-full h-full opacity-0 cursor-pointer"
61102
@change="() => toggleDark()"
62103
/>
63104
<span
64-
class="block relative w-9 h-9 bg-white dark:bg-slate-800 rounded-full border border-slate-300 dark:border-slate-700"
105+
class="block relative w-9 h-9 bg-white dark:bg-muted-800 rounded-full border border-muted-300 dark:border-muted-700"
65106
>
66107
<svg
67108
xmlns="http://www.w3.org/2000/svg"
@@ -72,7 +113,7 @@ const isChecked = ref(false)
72113
:class="[
73114
!isChecked
74115
? 'opacity-100 -translate-x-[45%] -translate-y-1/2'
75-
: 'opacity-0 -translate-x-[45%] -translate-y-[150%]'
116+
: 'opacity-0 -translate-x-[45%] -translate-y-[150%]',
76117
]"
77118
width="32"
78119
height="32"
@@ -106,7 +147,7 @@ const isChecked = ref(false)
106147
:class="[
107148
!isChecked
108149
? 'opacity-0 -translate-x-[45%] -translate-y-[150%]'
109-
: 'opacity-100 -translate-x-[45%] -translate-y-1/2'
150+
: 'opacity-100 -translate-x-[45%] -translate-y-1/2',
110151
]"
111152
width="32"
112153
height="32"

playground/components/toast/ActionButtons.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<template>
22
<div
3-
class="w-full flex items-center gap-2 p-3 rounded-xl bg-white dark:bg-stone-800 shadow-xl shadow-stone-300/10 dark:shadow-stone-800/10 overflow-hidden"
3+
class="w-full flex items-center gap-2 p-3 rounded-xl bg-white dark:bg-muted-800 shadow-xl shadow-muted-300/10 dark:shadow-muted-800/10 overflow-hidden"
44
>
55
<button
66
type="button"
7-
class="h-10 w-28 py-2 px-4 inline-flex items-center justify-center rounded-xl text-sm text-stone-500 bg-stone-100 hover:text-stone-600 hover:bg-stone-50 transition-colors duration-300"
7+
class="h-10 w-28 py-2 px-4 inline-flex items-center justify-center rounded-xl text-sm text-muted-500 bg-muted-100 dark:bg-muted-900 hover:text-muted-600 dark:text-muted-400 hover:bg-muted-50 dark:hover:bg-muted-1000 dark:hover:text-muted-100 transition-colors duration-300"
88
>
99
Dismiss
1010
</button>
1111
<button
1212
type="button"
13-
class="h-10 w-28 py-2 px-4 inline-flex items-center justify-center rounded-xl text-sm text-sky-500 bg-sky-100 hover:text-sky-600 hover:bg-sky-50 transition-colors duration-300"
13+
class="h-10 w-28 py-2 px-4 inline-flex items-center justify-center rounded-xl text-sm text-sky-500 dark:text-muted-100 bg-sky-100 dark:bg-sky-500 hover:text-sky-600 dark:hover:text-white hover:bg-sky-50 dark:hover:bg-sky-600 transition-colors duration-300"
1414
>
1515
Accept
1616
</button>

playground/components/toast/IconSoloDanger.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div
3-
class="w-full flex items-center gap-1 p-3 rounded-xl bg-white dark:bg-stone-800 shadow-xl shadow-stone-300/10 dark:shadow-stone-800/10 overflow-hidden"
3+
class="w-full flex items-center gap-1 p-3 rounded-xl bg-white dark:bg-muted-800 shadow-xl shadow-muted-300/10 dark:shadow-muted-800/10 overflow-hidden"
44
>
55
<div
66
class="h-11 w-11 flex items-center justify-center rounded-full text-rose-500"
@@ -18,12 +18,15 @@
1818
</svg>
1919
</div>
2020
<div class="mr-6">
21-
<span class="block font-semibold text-sm text-stone-800">Fire alert</span>
22-
<span class="block text-xs text-stone-400">Get out of here fast!</span>
21+
<span
22+
class="block font-semibold text-sm text-muted-800 dark:text-muted-100"
23+
>Fire alert</span
24+
>
25+
<span class="block text-xs text-muted-400">Get out of here fast!</span>
2326
</div>
2427
<button
2528
type="button"
26-
class="h-11 w-11 flex items-center justify-center ml-auto"
29+
class="h-11 w-11 flex items-center justify-center ml-auto text-muted-700 dark:text-muted-400"
2730
>
2831
<svg class="w-4 h-4" viewBox="0 0 24 24">
2932
<path
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<div
3-
class="w-full flex items-center gap-3 py-3 pl-3 pr-6 rounded-xl bg-white dark:bg-stone-800 shadow-xl shadow-stone-300/10 dark:shadow-stone-800/10 overflow-hidden"
3+
class="w-full flex items-center gap-3 py-3 pl-3 pr-6 rounded-xl bg-white dark:bg-muted-800 shadow-xl shadow-muted-300/10 dark:shadow-muted-800/10 overflow-hidden"
44
>
55
<div
6-
class="h-11 w-11 flex items-center justify-center rounded-full text-emerald-500 bg-emerald-100"
6+
class="h-11 w-11 flex items-center justify-center rounded-full text-emerald-500 bg-emerald-100 dark:text-white dark:bg-emerald-500"
77
>
88
<svg class="w-5 h-5" viewBox="0 0 24 24">
99
<path
@@ -12,6 +12,8 @@
1212
/>
1313
</svg>
1414
</div>
15-
<span class="text-sm text-stone-600">Your changes were saved!</span>
15+
<span class="text-sm text-muted-600 dark:text-muted-400"
16+
>Your changes were saved!</span
17+
>
1618
</div>
1719
</template>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<div
3-
class="w-full flex items-center rounded-xl bg-white dark:bg-stone-800 shadow-xl shadow-stone-300/10 dark:shadow-stone-800/10 overflow-hidden"
3+
class="w-full flex items-center rounded-xl bg-white dark:bg-muted-800 shadow-xl shadow-muted-300/10 dark:shadow-muted-800/10 overflow-hidden"
44
>
55
<div
6-
class="h-16 w-16 flex items-center justify-center text-sky-500 bg-sky-100"
6+
class="h-16 w-16 flex items-center justify-center text-sky-500 bg-sky-100 dark:text-white dark:bg-sky-500"
77
>
88
<svg class="w-5 h-5" viewBox="0 0 512 512">
99
<path
@@ -13,7 +13,9 @@
1313
</svg>
1414
</div>
1515
<div class="pr-6 pl-4">
16-
<span class="text-sm text-stone-600">Your changes were saved!</span>
16+
<span class="text-sm text-muted-600 dark:text-muted-400"
17+
>Your changes were saved!</span
18+
>
1719
</div>
1820
</div>
1921
</template>

playground/components/toast/LabelSuccess.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class="w-full flex items-center rounded-xl bg-white dark:bg-stone-800 shadow-xl shadow-stone-300/10 dark:shadow-stone-800/10 overflow-hidden"
44
>
55
<div
6-
class="h-16 w-16 flex items-center justify-center text-emerald-500 bg-emerald-100"
6+
class="h-16 w-16 flex items-center justify-center text-emerald-500 bg-emerald-100 dark:bg-emerald-500"
77
>
88
<svg class="w-6 h-6" viewBox="0 0 256 172">
99
<path
@@ -17,7 +17,9 @@
1717
</svg>
1818
</div>
1919
<div class="pr-6 pl-4">
20-
<span class="text-sm text-stone-600">Nuxt has been installed!</span>
20+
<span class="text-sm text-stone-600 dark:text-muted-400"
21+
>Nuxt has been installed!</span
22+
>
2123
</div>
2224
</div>
2325
</template>

playground/components/toast/UserReplyClose.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div
3-
class="w-full flex items-center gap-3 p-3 rounded-xl bg-white dark:bg-stone-800 shadow-xl shadow-stone-300/10 dark:shadow-stone-800/10 overflow-hidden"
3+
class="w-full flex items-center gap-3 p-3 rounded-xl bg-white dark:bg-muted-800 shadow-xl shadow-muted-300/10 dark:shadow-muted-800/10 overflow-hidden"
44
>
55
<div
66
class="inline-flex justify-center items-center relative w-10 h-10 rounded-full"
@@ -12,12 +12,15 @@
1212
/>
1313
</div>
1414
<div class="mr-6">
15-
<span class="block font-semibold text-sm text-stone-800">Clark E.</span>
16-
<span class="block text-xs text-stone-400">Replied to your post</span>
15+
<span
16+
class="block font-semibold text-sm text-muted-800 dark:text-muted-100"
17+
>Clark E.</span
18+
>
19+
<span class="block text-xs text-muted-400">Replied to your post</span>
1720
</div>
1821
<button
1922
type="button"
20-
class="h-11 w-11 flex items-center justify-center ml-auto"
23+
class="h-11 w-11 flex items-center justify-center ml-auto text-muted-400"
2124
>
2225
<svg class="w-4 h-4" viewBox="0 0 24 24">
2326
<path

0 commit comments

Comments
 (0)