Skip to content

Commit

Permalink
feat: add daisyui tailwind component plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
phaicomm committed Feb 5, 2022
1 parent 96c2eee commit 34641b2
Show file tree
Hide file tree
Showing 11 changed files with 348 additions and 31 deletions.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,24 @@
"@commitlint/cli": "^16.1.0",
"@commitlint/config-conventional": "^16.0.0",
"@types/node": "^17.0.14",
"autoprefixer": "^10.4.2",
"cross-env": "^7.0.3",
"eslint": "^8.8.0",
"husky": "^7.0.4",
"lint-staged": "^12.3.3",
"pnpm": "^6.29.1",
"postcss": "^8.4.6",
"rimraf": "^3.0.2",
"tailwindcss": "^3.0.18",
"typescript": "^4.5.5",
"unbuild": "^0.6.9",
"vite": "^2.7.13",
"vitest": "^0.2.7"
},
"engines": {
"node": ">=16.0.0"
},
"dependencies": {
"daisyui": "^1.25.4"
}
}
6 changes: 6 additions & 0 deletions packages/vue3/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
23 changes: 7 additions & 16 deletions packages/vue3/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import HelloWorld from './components/HelloWorld.vue'
</script>

<template>
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />
<h1 class="font-bold text-3xl underline">
Hello world!
</h1>
<button class="btn btn-primary">
daisyUI Button
</button>
</template>

<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
3 changes: 3 additions & 0 deletions packages/vue3/src/assets/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 1 addition & 0 deletions packages/vue3/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createApp } from 'vue'
import App from './App.vue'
import '@/assets/index.css'

createApp(App).mount('#app')
17 changes: 17 additions & 0 deletions packages/vue3/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
content: [
'./index.html',
'./src/**/*.{vue,js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
plugins: [
require('daisyui'),
],
daisyui: {
themes: [
'light',
],
},
}
37 changes: 37 additions & 0 deletions packages/vue3/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"lib": [
"DOM",
"esnext"
],
"sourceMap": true,
"useDefineForClassFields": true,
"jsx": "preserve",
"paths": {
"@/*": [
"src/*"
],
},
"typeRoots": [
"./node_modules/@types/",
],
"types": [
"vite/client",
]
},
"include": [
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.vue",
"vite.config.ts",
"components.d.ts"
],
"exclude": [
"dist",
"node_modules",
"public",
"tests"
]
}
6 changes: 6 additions & 0 deletions packages/vue3/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import path from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
plugins: [vue()],
})
Loading

0 comments on commit 34641b2

Please sign in to comment.