Skip to content
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

Add tailwind #43

Merged
merged 4 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion .erb/configs/webpack.config.renderer.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ const configuration: webpack.Configuration = {
],
include: /\.module\.s?(c|a)ss$/,
},
// Tailwind
{
test: /\.s?css$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
use: ['style-loader', 'css-loader', 'sass-loader', 'postcss-loader'],
exclude: /\.module\.s?(c|a)ss$/,
},
// Fonts
Expand Down
7 changes: 6 additions & 1 deletion .erb/configs/webpack.config.renderer.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ const configuration: webpack.Configuration = {
},
{
test: /\.s?(a|c)ss$/,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader',
'postcss-loader', // added for tailwind
],
exclude: /\.module\.s?(c|a)ss$/,
},
// Fonts
Expand Down
5 changes: 5 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* eslint global-require: off, import/no-extraneous-dependencies: off */

module.exports = {
plugins: [require('tailwindcss'), require('autoprefixer')],
};
65 changes: 3 additions & 62 deletions src/renderer/App.css
Original file line number Diff line number Diff line change
@@ -1,62 +1,3 @@
/*
* @NOTE: Prepend a `~` to css file paths that are in your node_modules
* See https://github.com/webpack-contrib/sass-loader#imports
*/
body {
position: relative;
color: white;
height: 100vh;
background: linear-gradient(
200.96deg,
#fedc2a -29.09%,
#dd5789 51.77%,
#7a2c9e 129.35%
);
font-family: sans-serif;
overflow-y: hidden;
display: flex;
justify-content: center;
align-items: center;
}

button {
background-color: white;
padding: 10px 20px;
border-radius: 10px;
border: none;
appearance: none;
font-size: 1.3rem;
box-shadow: 0px 8px 28px -6px rgba(24, 39, 75, 0.12),
0px 18px 88px -4px rgba(24, 39, 75, 0.14);
transition: all ease-in 0.1s;
cursor: pointer;
opacity: 0.9;
}

button:hover {
transform: scale(1.05);
opacity: 1;
}

li {
list-style: none;
}

a {
text-decoration: none;
height: fit-content;
width: fit-content;
margin: 10px;
}

a:hover {
opacity: 1;
text-decoration: none;
}

.Hello {
display: flex;
justify-content: center;
align-items: center;
margin: 20px 0;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
31 changes: 1 addition & 30 deletions src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,7 @@ import './App.css';
function Hello() {
return (
<div>
<div className="Hello">
<img width="200" alt="icon" src={icon} />
</div>
<h1>electron-react-boilerplate</h1>
<div className="Hello">
<a
href="https://electron-react-boilerplate.js.org/"
target="_blank"
rel="noreferrer"
>
<button type="button">
<span role="img" aria-label="books">
📚
</span>
Read our docs
</button>
</a>
<a
href="https://github.com/sponsors/electron-react-boilerplate"
target="_blank"
rel="noreferrer"
>
<button type="button">
<span role="img" aria-label="folded hands">
🙏
</span>
Donate
</button>
</a>
</div>
<div className="bg-gray-500 p-5 text-center">Tailwind</div>
</div>
);
}
Expand Down
6 changes: 6 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
content: ['./src/renderer/**/*.{js,jsx,ts,tsx}'],
theme: {},
variants: {},
plugins: [],
};
Loading