Skip to content

Commit

Permalink
release: migrate from windicss to tailwindcss
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrlv committed Dec 11, 2021
1 parent 4717afb commit d9a9eae
Show file tree
Hide file tree
Showing 11 changed files with 1,571 additions and 394 deletions.
1,876 changes: 1,519 additions & 357 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
"build": "rm -f src/.lock && vite build"
},
"devDependencies": {
"sass": "^1.43.3",
"vite": "^2.6.10",
"vite-plugin-live-reload": "^2.1.0",
"vite-plugin-windicss": "^1.4.12",
"windicss": "^3.1.9"
"autoprefixer": "^10.4.0",
"postcss": "^8.4.4",
"tailwindcss": "^3.0.1",
"vite": "^2.7.1",
"vite-plugin-live-reload": "^2.1.0"
},
"prettier": {
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
}
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
2 changes: 2 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import './css/index.css'
import './js/index.js'
3 changes: 3 additions & 0 deletions src/css/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 0 additions & 1 deletion src/index.js

This file was deleted.

Empty file added src/js/index.js
Empty file.
11 changes: 11 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
content: [
'www/app/templates/**/*.php',
'www/app/snippets/**/*.php',
'src/js/**/*.{js,jsx}',
],
theme: {
extend: {},
},
plugins: [],
}
25 changes: 6 additions & 19 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,38 @@
import liveReload from 'vite-plugin-live-reload'
import { resolve } from 'path'
import WindiCSS from 'vite-plugin-windicss'

// Docs: https://vitejs.dev/config/

const cwd = process.cwd()

// Docs: https://vitejs.dev/config/
export default ({ mode }) => ({
root: 'src',
base: mode === 'development' ? '/' : '/assets/',
resolve: {
alias: [
{ find: '@utils', replacement: resolve(cwd, 'src/js/utils') },
{ find: '@components', replacement: resolve(cwd, 'src/js/components') },
{ find: '@vendors', replacement: resolve(cwd, 'src/js/vendors') }
{ find: '@vendors', replacement: resolve(cwd, 'src/js/vendors') },
],
},
server: {
port: 3000,
strictPort: true,
cors: true
cors: true,
},
build: {
target: 'es2017',
assetsDir: '.',
outDir: resolve(cwd, 'www/public/assets'),
rollupOptions: {
input: resolve(cwd, 'src/index.js')
input: resolve(cwd, 'src/app.js'),
},
manifest: true,
emptyOutDir: true,
},
plugins: [
liveReload([
resolve(cwd, 'www/app/(templates|snippets|controllers|models)/**/*.php'),
resolve(cwd, 'www/storage/content/**/*')
resolve(cwd, 'www/storage/content/**/*'),
]),
WindiCSS({
config: resolve(cwd, 'windi.config.js'),
scan: {
dirs: [
resolve(cwd, 'www/app/templates'),
resolve(cwd, 'www/app/snippets'),
resolve(cwd, 'src')
],
fileExtensions: ['php', 'js'],
}
})
]
],
})
2 changes: 1 addition & 1 deletion www/app/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
return [
# core values
'arnoson.kirby-vite.rootDir' => '/../src/',
'arnoson.kirby-vite.outDir' => '/../public/assets/',
'arnoson.kirby-vite.outDir' => '/assets/',

# optional values
'debug' => true,
Expand Down
23 changes: 12 additions & 11 deletions www/app/templates/home.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?= snippet('site/header') ?>

<div class="flex items-center justify-center h-screen antialiased appearance-none bg-black text-true-gray-500">
<div class="-mt-10px text-center">
<div class="bg-opacity-10 py-15px inline-flex items-center px-20px mb-10px space-x-10px bg-white rounded-full">
<div class="flex items-center justify-center h-screen antialiased appearance-none bg-black text-white">
<div class="-mt-[10px] text-center">
<a
class="bg-opacity-10 py-[15px] inline-flex items-center px-[20px] mb-[10px] space-x-[10px] bg-white rounded-full" href="https://whiterussian.studio"
rel="noopener noreferrer"
target="_blank">
<span>Start your next project with</span>
<a href="https://whiterussian.studio" rel="noopener noreferrer" target="_blank">
<svg width="24" height="24" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 34.3636C27.0374 34.3636 34.3636 27.0374 34.3636 18C34.3636 8.96261 27.0374 1.63636 18 1.63636C8.96261 1.63636 1.63636 8.96261 1.63636 18C1.63636 27.0374 8.96261 34.3636 18 34.3636ZM36 18C36 27.9411 27.9411 36 18 36C8.05887 36 0 27.9411 0 18C0 8.05887 8.05887 0 18 0C27.9411 0 36 8.05887 36 18Z" fill="currentColor"/>
<path d="M18.076 21.088H12.3876L11.7545 20.3133L13.1072 14.2209C11.3508 14.9214 9.26508 14.55 7.87662 13.1822L8.89382 12.1792C10.0735 13.3406 11.9678 13.4782 13.3009 12.4994L13.7007 12.2056L14.8642 12.9412L13.3707 19.6701H18.076V21.088ZM24.8659 13.9822C23.5785 13.9822 22.3676 13.4875 21.457 12.5896L22.4748 11.5866C23.1135 12.2166 23.9632 12.5638 24.8659 12.5638C25.7681 12.5638 26.6178 12.2166 27.2571 11.5866L28.2748 12.5896C27.3637 13.4875 26.1528 13.9822 24.8659 13.9822Z" fill="currentColor"/>
<path d="M12.0907 27.3852C13.7644 28.6507 15.8491 29.4012 18.1091 29.4012C23.6257 29.4012 28.0977 24.9292 28.0977 19.4126H26.4884C26.4884 24.0404 22.7369 27.7919 18.1091 27.7919C16.2941 27.7919 14.6138 27.2148 13.2418 26.2341L12.0907 27.3852Z" fill="currentColor"/>
</svg>
</a>
</div>
<svg width="24" height="24" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 34.3636C27.0374 34.3636 34.3636 27.0374 34.3636 18C34.3636 8.96261 27.0374 1.63636 18 1.63636C8.96261 1.63636 1.63636 8.96261 1.63636 18C1.63636 27.0374 8.96261 34.3636 18 34.3636ZM36 18C36 27.9411 27.9411 36 18 36C8.05887 36 0 27.9411 0 18C0 8.05887 8.05887 0 18 0C27.9411 0 36 8.05887 36 18Z" fill="currentColor"/>
<path d="M18.076 21.088H12.3876L11.7545 20.3133L13.1072 14.2209C11.3508 14.9214 9.26508 14.55 7.87662 13.1822L8.89382 12.1792C10.0735 13.3406 11.9678 13.4782 13.3009 12.4994L13.7007 12.2056L14.8642 12.9412L13.3707 19.6701H18.076V21.088ZM24.8659 13.9822C23.5785 13.9822 22.3676 13.4875 21.457 12.5896L22.4748 11.5866C23.1135 12.2166 23.9632 12.5638 24.8659 12.5638C25.7681 12.5638 26.6178 12.2166 27.2571 11.5866L28.2748 12.5896C27.3637 13.4875 26.1528 13.9822 24.8659 13.9822Z" fill="currentColor"/>
<path d="M12.0907 27.3852C13.7644 28.6507 15.8491 29.4012 18.1091 29.4012C23.6257 29.4012 28.0977 24.9292 28.0977 19.4126H26.4884C26.4884 24.0404 22.7369 27.7919 18.1091 27.7919C16.2941 27.7919 14.6138 27.2148 13.2418 26.2341L12.0907 27.3852Z" fill="currentColor"/>
</svg>
</a>
<div class="text-xs opacity-50">in <?= date('Y') ?></div>
</div>
</div>
Expand Down

0 comments on commit d9a9eae

Please sign in to comment.