Skip to content

Commit 056480f

Browse files
committed
Tailwind added
1 parent 24bee5c commit 056480f

File tree

7 files changed

+48
-3
lines changed

7 files changed

+48
-3
lines changed

.prettierrc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
"singleQuote": true,
44
"trailingComma": "none",
55
"printWidth": 100,
6-
"plugins": ["prettier-plugin-svelte"],
7-
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
6+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
7+
"overrides": [
8+
{
9+
"files": "*.svelte",
10+
"options": {
11+
"parser": "svelte"
12+
}
13+
}
14+
]
815
}

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,19 @@
3838
"@types/eslint": "^8.56.0",
3939
"@typescript-eslint/eslint-plugin": "^7.0.0",
4040
"@typescript-eslint/parser": "^7.0.0",
41+
"autoprefixer": "^10.4.16",
4142
"eslint": "^8.56.0",
4243
"eslint-config-prettier": "^9.1.0",
4344
"eslint-plugin-svelte": "^2.36.0-next.4",
45+
"postcss": "^8.4.32",
46+
"postcss-load-config": "^5.0.2",
4447
"prettier": "^3.1.1",
4548
"prettier-plugin-svelte": "^3.1.2",
49+
"prettier-plugin-tailwindcss": "^0.5.9",
4650
"publint": "^0.1.9",
4751
"svelte": "^5.0.0-next.1",
4852
"svelte-check": "^3.6.0",
53+
"tailwindcss": "^3.3.6",
4954
"tslib": "^2.4.1",
5055
"typescript": "^5.0.0",
5156
"vite": "^5.0.11",

postcss.config.cjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const tailwindcss = require('tailwindcss');
2+
const autoprefixer = require('autoprefixer');
3+
4+
const config = {
5+
plugins: [
6+
//Some plugins, like tailwindcss/nesting, need to run before Tailwind,
7+
tailwindcss(),
8+
//But others, like autoprefixer, need to run after,
9+
autoprefixer
10+
]
11+
};
12+
13+
module.exports = config;

src/app.pcss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* Write your global styles here, in PostCSS syntax */
2+
@tailwind base;
3+
@tailwind components;
4+
@tailwind utilities;

src/routes/+layout.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script>
2+
import '../app.pcss';
3+
</script>
4+
5+
<slot></slot>

svelte.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
55
const config = {
66
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
77
// for more information about preprocessors
8-
preprocess: vitePreprocess(),
8+
preprocess: [vitePreprocess({})],
99

1010
kit: {
1111
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.

tailwind.config.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** @type {import('tailwindcss').Config}*/
2+
const config = {
3+
darkMode: 'selector',
4+
content: ['./src/**/*.{html,js,svelte,ts}'],
5+
theme: {
6+
extend: {}
7+
},
8+
plugins: []
9+
};
10+
11+
module.exports = config;

0 commit comments

Comments
 (0)