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

tailwind css integration #65

Merged
merged 5 commits into from
Nov 10, 2024
Merged
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
1,120 changes: 1,091 additions & 29 deletions peerprep/frontend/package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions peerprep/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"autoprefixer": "^10.4.20",
"eslint": "^9.9.0",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.9",
"globals": "^15.9.0",
"jest": "^29.7.0",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.14",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.5.3",
Expand Down
6 changes: 6 additions & 0 deletions peerprep/frontend/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
1 change: 0 additions & 1 deletion peerprep/frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import './styles/App.css';
/*
const App: React.FC = () => {
return (
Expand Down
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion peerprep/frontend/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createRoot } from 'react-dom/client'
import App from './App.tsx'
import './styles/index.css'
import './styles/index.css';
import './styles/App.css';

createRoot(document.getElementById('root')!).render(
Expand Down
78 changes: 75 additions & 3 deletions peerprep/frontend/src/styles/App.css
Original file line number Diff line number Diff line change
@@ -1,32 +1,104 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 5rem;
text-align: center;
background-color: white;
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
color-scheme: light dark;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

/* Global Styling */
body {
background-color: white;
color: black;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
color: white;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}

h1 {
font-size: 32px;
color: black;
line-height: 1.1;
}

h2 {
font-size: 24px;
color: black;
}

/* Container uses flexbox for split layout */
/* Container uses flexbox for split layout
.container {
display: flex;
justify-content: space-between;
gap: 20px; /* Add a gap between the left and right panels */
gap: 20px;
} */

.question-container {
display: flex;
justify-content: space-between;
gap: 20px;
}

.login-container {
display: flex;
justify-content: space-between;
gap: 20px;
}

.signup-container {
display: flex;
justify-content: space-between;
gap: 20px;
}

/* Left panel for form and question list, using grid */
Expand Down
71 changes: 3 additions & 68 deletions peerprep/frontend/src/styles/index.css
Original file line number Diff line number Diff line change
@@ -1,68 +1,3 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}
@tailwind base;
@tailwind components;
@tailwind utilities;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { UnControlled as CodeMirror } from 'react-codemirror2';
import { useParams, useNavigate } from 'react-router-dom';
import axios from 'axios';
import * as Y from 'yjs';
import Chat from '../../components/Chat.tsx';
import Chat from './components/Chat.tsx';

import 'codemirror/lib/codemirror.css';
import 'codemirror/theme/material.css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const QuestionManagement: React.FC = () => {
};

return (
<div className="container">
<div className="question-container">
{/* Add a link to the login page at the top or in a suitable location */}
<div className="nav">
<Link to="/" className="top-left-link">Go to Login</Link>
Expand Down
2 changes: 1 addition & 1 deletion peerprep/frontend/src/views/UserServiceViews/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Login = () => {
};

return (
<div className="container">
<div className="login-container">
<div className="login-form">
<h2>Login</h2>
<div className="form-section">
Expand Down
2 changes: 1 addition & 1 deletion peerprep/frontend/src/views/UserServiceViews/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const SignUp = () => {
};

return (
<div className="container">
<div className="signup-container">
<div className="login-form">
<h2>Sign Up</h2>

Expand Down
11 changes: 11 additions & 0 deletions peerprep/frontend/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
Loading
Loading