Skip to content

Commit

Permalink
deps: added tailwindcss
Browse files Browse the repository at this point in the history
  • Loading branch information
k-tten committed Nov 22, 2021
1 parent 259f621 commit 7a088c9
Show file tree
Hide file tree
Showing 11 changed files with 423 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"plugin:import/electron",
"plugin:import/typescript"
],
"parser": "@typescript-eslint/parser"
"parser": "@typescript-eslint/parser",
"ignorePatterns": "/*.js"
}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,17 @@
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"@vercel/webpack-asset-relocator-loader": "1.7.0",
"autoprefixer": "^10.4.0",
"css-loader": "^6.0.0",
"electron": "16.0.1",
"eslint": "^7.6.0",
"eslint-plugin-import": "^2.20.0",
"fork-ts-checker-webpack-plugin": "^6.0.1",
"node-loader": "^2.0.0",
"postcss": "^8.3.11",
"postcss-loader": "^6.2.0",
"style-loader": "^3.0.0",
"tailwindcss": "^2.2.19",
"ts-loader": "^9.2.2",
"typescript": "^4.0.2"
},
Expand Down
3 changes: 3 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: [require("tailwindcss"), require("autoprefixer")],
};
4 changes: 4 additions & 0 deletions src/index.css → src/app.global.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
Arial, sans-serif;
Expand Down
5 changes: 3 additions & 2 deletions src/renderers/main_window.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "../index.css";
import "../windows/MainWIndow";
import "tailwindcss/tailwind.css";
import "../app.global.css";
import "../windows/MainWindow";

/**
* This file will automatically be loaded by webpack and run in the "renderer" context.
Expand Down
3 changes: 2 additions & 1 deletion src/renderers/new_instance_window.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import "../index.css";
import "tailwindcss/tailwind.css";
import "../app.global.css";
import "../windows/NewInstanceWIndow";
3 changes: 3 additions & 0 deletions src/windows/MainWIndow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const MainWindow = () => {
<h1>Welcome to MultiServer</h1>
{/* TODO: add instances view */}
<button onClick={instances.newInstanceWindow}>New Instance</button>
<div className="absolute inset-0 bg-white text-center h-full flex flex-col justify justify-center">
ERB + TAILWIND = ❤
</div>
</div>
);
};
Expand Down
18 changes: 18 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const colors = require("tailwindcss/colors");

module.exports = {
purge: [],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {
colors: {
sky: colors.sky,
cyan: colors.cyan,
},
},
},
variants: {
extend: {},
},
plugins: [],
};
5 changes: 0 additions & 5 deletions webpack.renderer.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
const rules = require("./webpack.rules");
const plugins = require("./webpack.plugins");

rules.push({
test: /\.css$/,
use: [{ loader: "style-loader" }, { loader: "css-loader" }],
});

module.exports = {
module: {
rules,
Expand Down
40 changes: 40 additions & 0 deletions webpack.rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,44 @@ module.exports = [
},
},
},
{
test: /\.global\.css$/,
use: [
{
loader: "style-loader",
},
{
loader: "css-loader",
options: {
sourceMap: true,
},
},
{
loader: "postcss-loader",
options: {
postcssOptions: {
plugins: [require("tailwindcss"), require("autoprefixer")],
},
},
},
],
},
{
test: /^((?!\.global).)*\.css$/,
use: [
{
loader: "style-loader",
},
{
loader: "css-loader",
options: {
modules: {
localIdentName: "[name]__[local]__[hash:base64:5]",
},
sourceMap: true,
importLoaders: 1,
},
},
],
},
];
Loading

0 comments on commit 7a088c9

Please # to comment.