Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
chore: add nuxt demo
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed Dec 20, 2023
1 parent 0c04c71 commit babfd20
Show file tree
Hide file tree
Showing 9 changed files with 4,578 additions and 186 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ yarn-error.log*
.yarn/cache
.yarn/install-state.gz

server
build

*.mts.timestamp-*
*.mts.timestamp-*

.nuxt
3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ packageExtensions:
},
"vite-imagetools@*": { dependencies: { "sharp": "0.32.6" } },
"@remix-run/dev@*": { dependencies: { "isbot": "^3.6.8" } },
"unplugin-vue-router@*":
{ dependencies: { "@vue/compiler-sfc": "^3.3.13" } },
"@nuxt/vite-builder@*": { dependencies: { "ofetch": "^1.3.3" } },
}
4 changes: 4 additions & 0 deletions examples/nuxt-demo/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<template>
<btn1 />
<btn2 />
</template>
22 changes: 22 additions & 0 deletions examples/nuxt-demo/components/btn1.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<template>
<button :class="stylex(btns.button, isPressed && btns.pressed)" @click="isPressed = !isPressed">click me</button>
</template>

<script lang="ts">
import stylex from '@stylexjs/stylex'
const btns = stylex.create({
button: {
transition: '.150s all',
border: '3px solid blue',
backgroundColor: 'CornflowerBlue'
},
pressed: {
backgroundColor: 'aquamarine'
}
})
</script>

<script setup lang="ts">
const isPressed = ref(false)
</script>
23 changes: 23 additions & 0 deletions examples/nuxt-demo/components/btn2.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<button :class="stylex(btns.button, isPressed && btns.pressed)" @click="isPressed = !isPressed">click me</button>
</template>

<script lang="ts">
import stylex from '@stylexjs/stylex'
const btns = stylex.create({
button: {
transition: '.150s all',
border: '3px solid red',
backgroundColor: 'HotPink'
},
pressed: {
backgroundColor: 'pink'
}
})
</script>

<script setup lang="ts">
const isPressed = ref(false)
</script>
8 changes: 8 additions & 0 deletions examples/nuxt-demo/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { stylexPlugin } from 'vite-plugin-stylex-dev'

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
vite: {
plugins: [stylexPlugin()]
}
})
18 changes: 18 additions & 0 deletions examples/nuxt-demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "nuxt-demo",
"type": "module",
"scripts": {
"dev": "nuxt dev"
},
"devDependencies": {
"@nuxt/kit": "^3.8.2",
"@stylexjs/stylex": "^0.3.0",
"@unhead/shared": "^1.8.9",
"nuxt": "^3.8.2",
"ufo": "^1.3.2",
"unhead": "^1.8.9",
"vite-plugin-stylex-dev": "workspace:*",
"vue": "^3.3.12",
"vue-router": "^4.2.5"
}
}
3 changes: 3 additions & 0 deletions examples/nuxt-demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends":"./.nuxt/tsconfig.json"
}
Loading

0 comments on commit babfd20

Please sign in to comment.