Compare commits

..

5 Commits

Author SHA1 Message Date
Filip Krumpe
aab713de3a Add thanks for the work done by others 2022-01-13 07:13:10 +01:00
Filip Krumpe
3d01f06936 fix wrong width of auto 2022-01-12 16:22:55 +01:00
Filip Krumpe
5b26406011 Remove unused 2022-01-12 16:22:37 +01:00
Filip Krumpe
6eb95435ce Fix broken tailwind import 2022-01-12 16:14:49 +01:00
Filip Krumpe
eaf6d18bc7 Add tailwind css to the setup 2022-01-12 15:06:44 +01:00
10 changed files with 59 additions and 12 deletions

View File

@ -32,3 +32,11 @@ In the project folder do:
```
Navigate to [http://127.0.0.1:5000/index.html](http://127.0.0.1:5000/index.html) to see the result
# Thanks
Special thanks go to
* [Joshua Nussbaum](https://dev.to/joshnuss/creating-a-sidebar-menu-in-svelte-ih2) for providing this beautiful slider menu
* [Linus Benkner](https://linu.us/sveltekit-with-tailwindcss-v3) for providing the blueprint for the tailwind integration
* [The SvelteKit project](https://kit.svelte.dev/) for providing the Framework

View File

@ -11,16 +11,19 @@
},
"devDependencies": {
"@sveltejs/adapter-auto": "next",
"@sveltejs/adapter-static": "^1.0.0-next.26",
"@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": {
"@sveltejs/adapter-static": "^1.0.0-next.25"
}
"type": "module"
}

19
webapp/postcss.config.cjs Normal file
View 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
View File

@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@ -5,7 +5,6 @@
<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"/>
%svelte.head%
</head>
<body>

View File

@ -1,6 +1,7 @@
<script>
import Navbar from "./menu/_Navbar.svelte";
import Sidebar from "./menu/_Sidebar.svelte";
import "../app.css";
let open = false;
</script>

View File

@ -1,12 +1,10 @@
<script>
import Main from "./_Main.svelte";
export let name = "Test 2";
</script>
<main 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/>
</main>

View File

@ -1,4 +1,4 @@
<svg width=auto height=30>
<svg width=100% height=30>
<text x=0 y=20>ACME</text>
</svg>

Before

Width:  |  Height:  |  Size: 111 B

After

Width:  |  Height:  |  Size: 111 B

View File

@ -1,7 +1,13 @@
import adapter from '@sveltejs/adapter-static';
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(),

View File

@ -0,0 +1,10 @@
const config = {
mode: "jit",
content: ["./src/**/*.{html,js,svelte,ts}"],
theme: {
extend: {},
},
plugins: [],
}
module.exports = config