Skip to content

Commit

Permalink
setup tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
sebald committed Jan 10, 2023
1 parent 395a010 commit c092db2
Show file tree
Hide file tree
Showing 8 changed files with 390 additions and 153 deletions.
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"arrowParens": "avoid",
"singleQuote": true,
"trailingComma": "es5",
"useTabs": false
}
"useTabs": false,
"plugins": ["prettier-plugin-tailwindcss"]
}
23 changes: 14 additions & 9 deletions app/[event]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Title } from 'components/title';

const YASB_REGEXP = /https:\/\/yasb\.app\/\?f(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)/;

const getXWS = async (url: string) => {
Expand Down Expand Up @@ -72,15 +74,18 @@ const Page = async ({ params }: PageParams) => {
const data = await getListsFromEvent(params.event);

return (
<ul>
{data.map(item => (
<li key={item.id}>
{item.id}: {item.url}
<br />
{item.xws && JSON.stringify(item.xws)}
</li>
))}
</ul>
<main>
<Title>Event #{params.event}</Title>
<ul>
{data.map(item => (
<li key={item.id}>
{item.id}: {item.url}
<br />
{item.xws && JSON.stringify(item.xws)}
</li>
))}
</ul>
</main>
);
};

Expand Down
114 changes: 3 additions & 111 deletions app/globals.css
Original file line number Diff line number Diff line change
@@ -1,111 +1,3 @@
:root {
--max-width: 1100px;
--border-radius: 12px;
--font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono',
'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro',
'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace;

--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;

--primary-glow: conic-gradient(
from 180deg at 50% 50%,
#16abff33 0deg,
#0885ff33 55deg,
#54d6ff33 120deg,
#0071ff33 160deg,
transparent 360deg
);
--secondary-glow: radial-gradient(
rgba(255, 255, 255, 1),
rgba(255, 255, 255, 0)
);

--tile-start-rgb: 239, 245, 249;
--tile-end-rgb: 228, 232, 233;
--tile-border: conic-gradient(
#00000080,
#00000040,
#00000030,
#00000020,
#00000010,
#00000010,
#00000080
);

--callout-rgb: 238, 240, 241;
--callout-border-rgb: 172, 175, 176;
--card-rgb: 180, 185, 188;
--card-border-rgb: 131, 134, 135;
}

@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;

--primary-glow: radial-gradient(rgba(1, 65, 255, 0.4), rgba(1, 65, 255, 0));
--secondary-glow: linear-gradient(
to bottom right,
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0.3)
);

--tile-start-rgb: 2, 13, 46;
--tile-end-rgb: 2, 5, 19;
--tile-border: conic-gradient(
#ffffff80,
#ffffff40,
#ffffff30,
#ffffff20,
#ffffff10,
#ffffff10,
#ffffff80
);

--callout-rgb: 20, 20, 20;
--callout-border-rgb: 108, 108, 108;
--card-rgb: 100, 100, 100;
--card-border-rgb: 200, 200, 200;
}
}

* {
box-sizing: border-box;
padding: 0;
margin: 0;
}

html,
body {
max-width: 100vw;
overflow-x: hidden;
}

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
}

a {
color: inherit;
text-decoration: none;
}

@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
}

ul {
margin-left: 24px;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
7 changes: 7 additions & 0 deletions components/title.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface TitleProps {
children: React.ReactNode;
}

export const Title = ({ children }: TitleProps) => (
<h1 className="text-4xl font-bold tracking-tight">{children}</h1>
);
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "4.9.4"
},
"devDependencies": {
"autoprefixer": "^10.4.13",
"postcss": "^8.4.21",
"prettier": "^2.8.2",
"prettier-plugin-tailwindcss": "^0.2.1",
"tailwindcss": "^3.2.4"
}
}
Loading

0 comments on commit c092db2

Please sign in to comment.