Skip to content

Commit

Permalink
chore: fix tailwind config reference for vitePreprocess (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianGonz97 authored Apr 26, 2024
1 parent f416f01 commit d9e24d2
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 37 deletions.
57 changes: 28 additions & 29 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
{
"useTabs": true,
"tabWidth": 4,
"singleQuote": false,
"trailingComma": "es5",
"semi": true,
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
},
{
"files": "*.md",
"options": {
"parser": "markdown",
"printWidth": 100,
"proseWrap": "always",
"tabWidth": 2,
"useTabs": true,
"semi": true,
"trailingComma": "none",
"bracketSameLine": true
"useTabs": true,
"tabWidth": 4,
"singleQuote": false,
"trailingComma": "es5",
"semi": true,
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
},
{
"files": "*.md",
"options": {
"parser": "markdown",
"printWidth": 100,
"proseWrap": "always",
"tabWidth": 2,
"useTabs": true,
"trailingComma": "none",
"bracketSameLine": true
}
}
}
],
"tailwindConfig": "./sites/docs/tailwind.config.js",
"tailwindFunctions": ["clsx", "cn", "tv"]
],
"tailwindConfig": "./sites/docs/tailwind.config.js",
"tailwindFunctions": ["clsx", "cn", "tv"]
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
// Enable the ESlint flat config support
"eslint.useFlatConfig": true,
"eslint.experimental.useFlatConfig": true,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
Expand Down
19 changes: 13 additions & 6 deletions sites/docs/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
module.exports = {
plugins: {
"tailwindcss/nesting": {},
tailwindcss: {},
autoprefixer: {},
},
const path = require("node:path");
const tailwindcss = require("tailwindcss");
const tailwindcssNesting = require("tailwindcss/nesting");
const autoprefixer = require("autoprefixer");

const config = {
plugins: [
tailwindcssNesting,
tailwindcss(path.resolve(__dirname, "tailwind.config.js")),
autoprefixer,
],
};

module.exports = config;
15 changes: 14 additions & 1 deletion sites/docs/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";
import { mdsx } from "mdsx";
import adapter from "@sveltejs/adapter-cloudflare";
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
import { mdsxConfig } from "./mdsx.config.js";

const __dirname = dirname(fileURLToPath(import.meta.url));

/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: [mdsx(mdsxConfig), vitePreprocess({})],
preprocess: [
mdsx(mdsxConfig),
vitePreprocess({
style: {
css: {
postcss: join(__dirname, "postcss.config.cjs"),
},
},
}),
],
extensions: [".svelte", ".md"],

kit: {
Expand Down
1 change: 1 addition & 0 deletions sites/docs/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-check
import { fontFamily } from "tailwindcss/defaultTheme";
import typography from "@tailwindcss/typography";

Expand Down

0 comments on commit d9e24d2

Please sign in to comment.