Add tailwind css to the setup
This commit is contained in:
parent
d86ac40602
commit
eaf6d18bc7
@ -12,12 +12,17 @@
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-auto": "next",
|
||||
"@sveltejs/kit": "next",
|
||||
"autoprefixer": "^10.4.2",
|
||||
"cssnano": "^5.0.15",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-svelte3": "^3.2.1",
|
||||
"postcss": "^8.4.5",
|
||||
"prettier": "^2.4.1",
|
||||
"prettier-plugin-svelte": "^2.4.0",
|
||||
"svelte": "^3.44.0"
|
||||
"svelte": "^3.44.0",
|
||||
"svelte-preprocess": "^4.10.1",
|
||||
"tailwindcss": "^3.0.13"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
|
||||
19
webapp/postcss.config.cjs
Normal file
19
webapp/postcss.config.cjs
Normal file
@ -0,0 +1,19 @@
|
||||
const tailwindcss = require("tailwindcss")
|
||||
const autoprefixer = require("autoprefixer")
|
||||
const cssnano = require("cssnano")
|
||||
|
||||
const mode = process.env.NODE_ENV
|
||||
const dev = mode === "development"
|
||||
|
||||
const config = {
|
||||
plugins: [
|
||||
tailwindcss(),
|
||||
autoprefixer(),
|
||||
!dev &&
|
||||
cssnano({
|
||||
preset: "default",
|
||||
})
|
||||
]
|
||||
}
|
||||
|
||||
module.exports = config
|
||||
3
webapp/src/app.css
Normal file
3
webapp/src/app.css
Normal file
@ -0,0 +1,3 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
@ -5,7 +5,7 @@
|
||||
<meta name="description" content="" />
|
||||
<link rel="icon" href="%svelte.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet"/>
|
||||
<!--<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet"/>-->
|
||||
%svelte.head%
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<script>
|
||||
import Navbar from "./menu/_Navbar.svelte";
|
||||
import Sidebar from "./menu/_Sidebar.svelte";
|
||||
import "../app.css";
|
||||
|
||||
let open = false;
|
||||
</script>
|
||||
|
||||
@ -4,9 +4,9 @@
|
||||
export let name = "Test 2";
|
||||
</script>
|
||||
|
||||
<main class="w-full h-full">
|
||||
<div class="w-full h-full">
|
||||
<h1>Welcome to SvelteKit</h1>
|
||||
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
|
||||
|
||||
<Main name={name} />
|
||||
</main>
|
||||
</div>
|
||||
@ -1,7 +1,13 @@
|
||||
import adapter from '@sveltejs/adapter-static';
|
||||
import preprocess from 'svelte-preprocess'
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
preprocess: [
|
||||
preprocess({
|
||||
postcss: true,
|
||||
}),
|
||||
],
|
||||
kit: {
|
||||
adapter: adapter(),
|
||||
|
||||
|
||||
10
webapp/tailwind.config.js
Normal file
10
webapp/tailwind.config.js
Normal file
@ -0,0 +1,10 @@
|
||||
const config = {
|
||||
mode: "jit",
|
||||
content: ["./src/**/*.{html,js,svelte,ts}"],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
|
||||
module.exports = config
|
||||
Loading…
x
Reference in New Issue
Block a user