Skip to content

Add Tailwind and PostCSS support #200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@types/chrome": "^0.0.202",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"autoprefixer": "^10.4.17",
"babel-eslint": "^10.1.0",
"babel-loader": "^9.1.2",
"babel-preset-react-app": "^10.0.1",
Expand All @@ -42,13 +43,16 @@
"fs-extra": "^11.1.0",
"html-loader": "^4.2.0",
"html-webpack-plugin": "^5.5.0",
"postcss": "^8.4.35",
"postcss-loader": "^8.1.0",
"prettier": "^2.8.3",
"react-refresh": "^0.14.0",
"react-refresh-typescript": "^2.0.7",
"sass": "^1.57.1",
"sass-loader": "^13.2.0",
"source-map-loader": "^3.0.1",
"style-loader": "^3.3.1",
"tailwindcss": "^3.4.1",
"terser-webpack-plugin": "^5.3.6",
"ts-loader": "^9.4.2",
"type-fest": "^3.5.2",
Expand Down
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
}
}
35 changes: 29 additions & 6 deletions src/pages/Options/Options.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
import React from 'react';
import './Options.css';
import React from 'react'
import './Options.css'

interface Props {
title: string;
title: string
}

const Options: React.FC<Props> = ({ title }: Props) => {
return <div className="OptionsContainer">{title} Page</div>;
};
return (
<>
<section className='bg-gray-900 text-white'>
<div className='mx-auto max-w-screen-xl px-4 py-32 lg:flex lg:h-screen lg:items-center'>
<div className='mx-auto max-w-3xl text-center'>
<h1 className='my-auto p-4 bg-gradient-to-r from-green-300 via-blue-500 to-purple-600 bg-clip-text text-3xl font-extrabold text-transparent sm:text-5xl'>
Welcome to
<span className='sm:block'>the Settings page</span>
</h1>

export default Options;
<p className='mx-auto max-w-xl sm:text-xl/relaxed'>
Edit src/pages/Options/Options.tsx and save to reload.
</p>

<div className='mt-8 flex flex-wrap justify-center gap-4'>
<p className='text-4xl text-blue-400'>
This page was styled with Tailwindcss
</p>
</div>
</div>
</div>
</section>
</>
)
}

export default Options
3 changes: 3 additions & 0 deletions src/pages/Options/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
8 changes: 8 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/**/*.{html,js,jsx,tsx}"],
theme: {
extend: {},
},
plugins: [],
}
4 changes: 3 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ var options = {
options: {
sourceMap: true,
},
},
}, {
loader: 'postcss-loader'
}
],
},
{
Expand Down