initial commit, base styles

This commit is contained in:
James Acklin 2021-09-30 09:23:38 -04:00
parent 74999189f9
commit fc865f752e
11 changed files with 291 additions and 119 deletions

View File

@ -1,29 +1,8 @@
# Next.js + Tailwind CSS Example
# Urbit Developers Portal
This example shows how to use [Tailwind CSS](https://tailwindcss.com/) [(v2.2)](https://blog.tailwindcss.com/tailwindcss-2-2) with Next.js. It follows the steps outlined in the official [Tailwind docs](https://tailwindcss.com/docs/guides/nextjs).
To develop locally:
It uses the new [`Just-in-Time Mode`](https://tailwindcss.com/docs/just-in-time-mode) for Tailwind CSS.
## Preview
Preview the example live on [StackBlitz](http://stackblitz.com/):
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/with-tailwindcss)
## Deploy your own
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example):
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss&project-name=with-tailwindcss&repository-name=with-tailwindcss)
## How to use
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
```bash
npx create-next-app --example with-tailwindcss with-tailwindcss-app
# or
yarn create next-app --example with-tailwindcss with-tailwindcss-app
```
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
yarn install
yarn dev
```

6
package-lock.json generated
View File

@ -10,9 +10,9 @@
"react-dom": "^17.0.2"
},
"devDependencies": {
"autoprefixer": "^10.2.6",
"postcss": "^8.3.5",
"tailwindcss": "^2.2.4"
"autoprefixer": "^10.3.6",
"postcss": "^8.3.8",
"tailwindcss": "^2.2.16"
}
},
"node_modules/@babel/code-frame": {

View File

@ -11,8 +11,8 @@
"react-dom": "^17.0.2"
},
"devDependencies": {
"autoprefixer": "^10.2.6",
"postcss": "^8.3.5",
"tailwindcss": "^2.2.4"
"autoprefixer": "^10.3.6",
"postcss": "^8.3.8",
"tailwindcss": "^2.2.16"
}
}

View File

@ -1,7 +1,7 @@
import 'tailwindcss/tailwind.css'
import "../styles/globals.css";
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
return <Component {...pageProps} />;
}
export default MyApp
export default MyApp;

View File

@ -1,5 +0,0 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
export default function helloAPI(req, res) {
res.status(200).json({ name: 'John Doe' })
}

View File

@ -1,82 +1,16 @@
import Head from 'next/head'
import Head from "next/head";
export default function Home() {
return (
<div className="flex flex-col items-center justify-center min-h-screen py-2">
<Head>
<title>Create Next App</title>
<title>Urbit Developers</title>
<link rel="icon" href="/favicon.ico" />
</Head>
<main className="flex flex-col items-center justify-center w-full flex-1 px-20 text-center">
<h1 className="text-6xl font-bold">
Welcome to{' '}
<a className="text-blue-600" href="https://nextjs.org">
Next.js!
</a>
</h1>
<p className="mt-3 text-2xl">
Get started by editing{' '}
<code className="p-3 font-mono text-lg bg-gray-100 rounded-md">
pages/index.js
</code>
</p>
<div className="flex flex-wrap items-center justify-around max-w-4xl mt-6 sm:w-full">
<a
href="https://nextjs.org/docs"
className="p-6 mt-6 text-left border w-96 rounded-xl hover:text-blue-600 focus:text-blue-600"
>
<h3 className="text-2xl font-bold">Documentation &rarr;</h3>
<p className="mt-4 text-xl">
Find in-depth information about Next.js features and API.
</p>
</a>
<a
href="https://nextjs.org/learn"
className="p-6 mt-6 text-left border w-96 rounded-xl hover:text-blue-600 focus:text-blue-600"
>
<h3 className="text-2xl font-bold">Learn &rarr;</h3>
<p className="mt-4 text-xl">
Learn about Next.js in an interactive course with quizzes!
</p>
</a>
<a
href="https://github.com/vercel/next.js/tree/master/examples"
className="p-6 mt-6 text-left border w-96 rounded-xl hover:text-blue-600 focus:text-blue-600"
>
<h3 className="text-2xl font-bold">Examples &rarr;</h3>
<p className="mt-4 text-xl">
Discover and deploy boilerplate example Next.js projects.
</p>
</a>
<a
href="https://vercel.com/import?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className="p-6 mt-6 text-left border w-96 rounded-xl hover:text-blue-600 focus:text-blue-600"
>
<h3 className="text-2xl font-bold">Deploy &rarr;</h3>
<p className="mt-4 text-xl">
Instantly deploy your Next.js site to a public URL with Vercel.
</p>
</a>
</div>
<p>Hello world!</p>
</main>
<footer className="flex items-center justify-center w-full h-24 border-t">
<a
className="flex items-center justify-center"
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Powered by{' '}
<img src="/vercel.svg" alt="Vercel Logo" className="h-4 ml-2" />
</a>
</footer>
</div>
)
);
}

View File

@ -5,4 +5,4 @@ module.exports = {
tailwindcss: {},
autoprefixer: {},
},
}
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -1,4 +0,0 @@
<svg width="283" height="64" viewBox="0 0 283 64" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M141.04 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.46 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM248.72 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.45 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM200.24 34c0 6 3.92 10 10 10 4.12 0 7.21-1.87 8.8-4.92l7.68 4.43c-3.18 5.3-9.14 8.49-16.48 8.49-11.05 0-19-7.2-19-18s7.96-18 19-18c7.34 0 13.29 3.19 16.48 8.49l-7.68 4.43c-1.59-3.05-4.68-4.92-8.8-4.92-6.07 0-10 4-10 10zm82.48-29v46h-9V5h9zM36.95 0L73.9 64H0L36.95 0zm92.38 5l-27.71 48L73.91 5H84.3l17.32 30 17.32-30h10.39zm58.91 12v9.69c-1-.29-2.06-.49-3.2-.49-5.81 0-10 4-10 10V51h-9V17h9v9.2c0-5.08 5.91-9.2 13.2-9.2z" fill="#000"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

211
styles/globals.css Normal file
View File

@ -0,0 +1,211 @@
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Source+Code+Pro:wght@400;500;600;700;800&display=swap");
@tailwind base;
@tailwind components;
@tailwind utilities;
:root {
--tray-time: 0ms;
}
html,
body {
padding: 0;
margin: 0;
/* Make all text wall-600 by default */
@apply text-wall-600;
}
/* Reset a tags */
a {
color: inherit;
text-decoration: none;
cursor: pointer;
}
/* Links in p tags should be green */
p a {
@apply text-green-400 font-semibold;
}
/* Reduce b and strong tag weight default */
b,
strong {
@apply font-semibold;
}
/* Typography */
h1,
.type-h1 {
@apply text-4xl lg:text-5xl font-extrabold leading-tight text-wall-600;
}
h2,
.type-h2 {
@apply text-3xl lg:text-4xl font-bold leading-tight;
}
h3,
.type-h3 {
@apply text-xl font-semibold;
}
h4,
.type-ui {
@apply text-lg font-semibold;
}
h5,
.type-h5,
.type-bold {
@apply text-base font-semibold leading-relaxed;
}
p,
.type-p {
@apply text-base leading-relaxed;
}
.type-sub {
@apply text-sm;
}
.type-sub-bold {
@apply text-sm font-semibold;
}
code .type-code {
@apply bg-wall-100 p-4 font-mono;
}
/* Utils */
.layout-narrow {
@apply w-full md:w-8/12 lg:w-6/12;
}
.layout {
@apply w-full md:w-10/12 lg:w-8/12;
}
.measure {
max-width: 34em;
}
.flex-center {
display: flex;
align-items: center;
justify-content: center;
}
.bg-img {
background-repeat: no-repeat;
background-position: center center;
@apply bg-wall-100;
}
.button-sm {
@apply flex-center px-3 h-10 rounded-lg type-ui;
}
.button-lg {
@apply flex-center px-6 py-1 rounded-xl h-14 type-ui;
}
.badge-sm {
@apply flex-center text-base font-medium px-3 h-8 rounded-full;
}
.badge-lg {
@apply flex-center type-ui px-5 h-12 rounded-full;
}
.button-sm:hover,
.button-text:hover,
.button-lg:hover,
a:hover {
opacity: 0.66;
}
/* BEM Classes - Use sparingly */
.port-hero-card-height {
height: 36em;
}
.port-hero-image-height {
height: 32em;
}
.port-hero-image {
transform: translateX(8%);
background-image: linear-gradient(
to right,
rgba(255, 255, 255, 0) 85%,
rgba(255, 255, 255, 1) 100%
),
url("https://media.urbit.org/port.svg");
background-size: cover;
}
.tray-menu-open {
transform: translateX(0);
transition: transform var(--tray-time);
}
.tray-menu-closed {
transform: translateX(-110vw);
transition: transform var(--tray-time);
}
.tray-menu-width {
width: calc(100vw - 4rem - 1rem - 1rem);
}
.mobile-search-button-width {
width: calc(100vw - 4rem - 1rem - 1rem - 1rem - 1rem);
}
.tray-overlay-open {
opacity: 1;
transition: opacity var(--tray-time);
}
.tray-overlay-closed {
opacity: 0;
transition: opacity var(--tray-time);
}
.menu-open {
left: 0;
visibility: visible;
display: block;
}
.menu-closed {
left: -100vw;
visibility: hidden;
display: none;
}
.dot::before {
width: 0.5rem;
height: 0.5rem;
border-radius: 99px;
content: "";
position: absolute;
left: -0.75rem;
top: 0.4rem;
@apply bg-green-400;
}
.sidebar figure,
.sidebar img {
width: auto !important;
margin: 0 auto !important;
left: 0 !important;
display: block !important;
position: static !important;
border-radius: 0 !important;
}

View File

@ -1,12 +1,69 @@
module.exports = {
mode: 'jit',
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
purge: ["./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}"],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {},
colors: {
// Wall
"wall-100": "#F3F2F0", // Primary
"wall-200": "#E3E0DB",
"wall-300": "#C8C4BD",
"wall-400": "#918C84",
"wall-500": "#5A564F",
"wall-600": "#24221E",
washedWall: "rgba(240, 239, 236, .8)", // for overlays
// Greens (Theme Primary Color)
"green-100": "#E5F7F1",
"green-200": "#BFEBDB",
"green-300": "#80D8B8",
"green-400": "#00B171", // Primary
"green-500": "#006842",
"green-600": "#001F13",
// Yellows
"yellow-100": "#FFFCF1",
"yellow-200": "#FEEBAA",
"yellow-300": "#FCDB63", // Primary
"yellow-400": "#CE9645",
"yellow-500": "#A15A2D",
"yellow-600": "#602010",
// Blues
"blue-100": "#F1F9FF",
"blue-200": "#BAE9FF",
"blue-300": "#7ED8FF",
"blue-400": "#219DFF", // Primary
"blue-500": "#193C90",
"blue-600": "#070821",
// Util
black: "#000",
white: "#FFF",
transparent: "rgba(0,0,0,0)",
// Syntax highlighting
purple: "rgba(157,82,255,0.8)",
red: "#ff4136",
// White semi-opaques
washedWhite: "rgba(255,255,255, 0.5)",
midWhite: "rgba(255,255,255, 0.8)",
},
fontFamily: {
sans: ["Inter", "-apple-system", "sans-serif"],
mono: ["Source Code Pro", "monospace"],
},
extend: {
fontSize: {
xs: "0.75rem",
sm: "0.875rem",
base: "1rem",
lg: "1.125rem",
xl: "1.25rem",
"2xl": "1.5rem",
"3xl": "1.875rem",
"4xl": "2.25rem",
"5xl": "3rem",
"6xl": "4rem",
},
},
},
variants: {
extend: {},
},
plugins: [],
}
};