Skip to content

Commit

Permalink
chore: setup tailwindcss
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinWilkinson committed May 6, 2024
1 parent 0588c4a commit 8e707e6
Show file tree
Hide file tree
Showing 6 changed files with 369 additions and 26 deletions.
49 changes: 24 additions & 25 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { themes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import tailwindPlugin from './plugins/tailwind-config.cjs';

const config: Config = {
title: "Kinson Digital",
Expand Down Expand Up @@ -48,31 +49,6 @@ const config: Config = {
} satisfies Preset.Options,
],
],

// ...
plugins: [
[
"@docusaurus/plugin-content-blog",
{
/**
* Required for any multi-instance plugin
*/
id: "news",

/**
* URL route for the blog section of your site.
* *DO NOT* include a trailing slash.
*/
routeBasePath: "news",

/**
* Path to data on filesystem relative to site dir.
*/
path: "./news",
},
],
],

themeConfig:
{
// Replace with your project's social card
Expand Down Expand Up @@ -209,6 +185,29 @@ const config: Config = {
darkTheme: themes.dracula,
},
} satisfies Preset.ThemeConfig,
plugins: [
[
"@docusaurus/plugin-content-blog",
{
/**
* Required for any multi-instance plugin
*/
id: "news",

/**
* URL route for the blog section of your site.
* *DO NOT* include a trailing slash.
*/
routeBasePath: "news",

/**
* Path to data on filesystem relative to site dir.
*/
path: "./news",
},
],
tailwindPlugin,
],
};

module.exports = config;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@docusaurus/tsconfig": "3.3.2",
"@docusaurus/types": "3.3.2",
"@types/react": "^18.2.29",
"tailwindcss": "^3.4.3",
"typescript": "~5.4.0"
},
"browserslist": {
Expand Down
16 changes: 16 additions & 0 deletions plugins/tailwind-config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function tailwindPlugin(context, options) {
return {
name: "tailwind-plugin",
configurePostCss(postcssOptions) {
postcssOptions.plugins = [
require("postcss-import"),
require("tailwindcss"),
require("autoprefixer"),
];
return postcssOptions;
},
};
}

module.exports = tailwindPlugin;

Loading

0 comments on commit 8e707e6

Please sign in to comment.