Skip to content

Commit

Permalink
Merge pull request #20 from vim/implement-style-guide
Browse files Browse the repository at this point in the history
Implement style guide
  • Loading branch information
manuel-pross authored Mar 24, 2024
2 parents 6a50b44 + e097049 commit b1bfbbd
Show file tree
Hide file tree
Showing 10 changed files with 147 additions and 117 deletions.
6 changes: 3 additions & 3 deletions web/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Inter } from "next/font/google";
import { Fira_Code } from "next/font/google";
import type { Metadata } from "next";
import "../styles/globals.scss";
import qs from "qs";
Expand All @@ -15,7 +15,7 @@ const params = {
},
};

const inter = Inter({ subsets: ["latin"] });
const firaCode = Fira_Code({ subsets: ["latin"], display: "swap", variable: "--font-fira" });

export const metadata: Metadata = {
title: "Vim Landing Page",
Expand Down Expand Up @@ -43,7 +43,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo

return (
<html lang="en">
<body className={inter.className}>{pageProps && <Layout pages={pageProps}>{children}</Layout>}</body>
<body className={firaCode.className}>{pageProps && <Layout pages={pageProps}>{children}</Layout>}</body>
</html>
);
}
36 changes: 33 additions & 3 deletions web/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,39 @@

export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<h1>Vim Landing Page</h1>
<button className="btn inverted">Download</button>
<main>
<h1 className="h1">Vim Landing Page</h1>
<h1 className="h1-prefix">Vim Landing Page</h1>
<h2 className="h2">Vim Landing Page</h2>
<h2 className="h2-prefix">Vim Landing Page</h2>
<p className="paragraph">
Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet.
Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident.
Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat
officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur
duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis. Lorem ipsum dolor sit amet, officia
excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia.
Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit
irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing
id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint
cupidatat ullamco ut ea consectetur et est culpa et culpa duis.
</p>
<a className="link" href="#">
asdf
</a>
<br></br>
<ul className="list">
<li>
<span>test</span>
</li>
<li>
<span>test</span>
</li>
<li>
<span>test</span>
</li>
</ul>
<button className="btn-primary">test</button>
</main>
);
}
13 changes: 9 additions & 4 deletions web/src/components/Layout/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import React from "react";
import Link from "next/link";

export default function Footer() {
return (
<footer className="w-full flex justify-center items-center pb-3">
<a href="/impressum">Impressum</a>
<span className="border-x-2 border-primary h-9 mx-3 w-0" />
<a href="/copyright">Copyright</a>
<footer className="w-full flex justify-center items-center">
<Link className="link" href="/impressum">
Impressum
</Link>
<span className="border-x-2 border-primary h-16 mx-12" />
<Link className="link" href="/copyright">
Copyright
</Link>
</footer>
);
}
14 changes: 9 additions & 5 deletions web/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ type LayoutProps = {

export default function Layout({ children, pages }: PropsWithChildren<LayoutProps>) {
return (
<div className="bg-slate-700">
<Navigation menu={pages} />
<div className="ml-52">
{children}
<Footer />
<div className="relative grid grid-cols-[1fr,3fr] gap-x-5 px-5 xl:grid-cols-[300px,auto]">
<div className="sticky top-0 h-screen py-4">
<Navigation menu={pages} />
</div>
<div className="pt-4">
<div className="rounded p-12 bg-gray-5">
{children}
<Footer />
</div>
</div>
</div>
);
Expand Down
29 changes: 19 additions & 10 deletions web/src/components/Layout/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"use client";
import Link from "next/link";
import Image from "next/image";
import { IconUserCircle } from "@tabler/icons-react";

type NavigationProps = {
Expand All @@ -16,12 +18,19 @@ export type Page = {

export default function Navigation({ menu }: NavigationProps) {
return (
<header className="sidebar">
<nav className="flex flex-col items-center justify-between h-full">
<a className="w-3/4" href="/">
<img src="/vim.svg" alt="Vim Logo" />
</a>
<ul className="w-full flex flex-col gap-2">
<header className="h-full rounded pt-8 bg-gray-5">
<nav className="flex flex-col items-center h-full">
<Link className="mb-8" href="/">
<Image src="/vim.svg" width={64} height={64} alt="Vim Logo" />
</Link>
<ul className="w-full flex flex-col gap-2 px-8">
<li className="block rounded-sm py-2 px-4 text-white hover:bg-gray-4 hover:cursor-pointer">
<Link href="#">Downloads</Link>
</li>
<li className="block rounded-sm py-2 px-4 text-white hover:bg-gray-4 hover:cursor-pointer">
<Link href="#">Downloads</Link>
</li>

{menu.map(menuItem => {
return (
<li className="nav-link" key={menuItem.id}>
Expand All @@ -31,11 +40,11 @@ export default function Navigation({ menu }: NavigationProps) {
})}
</ul>

<div>
<a className="flex flex-row gap-2" href="/my-account">
<IconUserCircle size={24} />
<div className="group mt-auto mb-8 hover:text-gray-2">
<Link className="flex items-center gap-2 text-white group-hover:text-gray-2" href="/my-account">
<IconUserCircle className="text-white group-hover:text-gray-2" size={40} />
My Account
</a>
</Link>
</div>
</nav>
</header>
Expand Down
2 changes: 1 addition & 1 deletion web/src/styles/_btns.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.btn-primary {
@apply border-solid border-[1px] rounded-xl border-secondary text-secondary py-3 px-6 transition-all hover:bg-secondary hover:text-white;
@apply border-solid border-[1px] rounded border-primary font-normal text-primary text-md py-2 px-6 lg:py-4 lg:px-12 transition-colors hover:bg-primary-opacity;
}
80 changes: 42 additions & 38 deletions web/src/styles/_text.scss
Original file line number Diff line number Diff line change
@@ -1,57 +1,61 @@
.heading {
@apply font-[400] text-secondary;
.h1 {
@apply font-fira font-semibold text-primary text-xl mb-8;
}

.h2 {
@apply font-fira font-semibold text-primary text-lg mb-6;
}

.h1-prefix {
@extend .h1;

&::before {
content: ">_ ";
}
}

@screen sm {
@apply mb-5;
}
.h2-prefix {
@extend .h2;

@screen md {
@apply mb-6;
&::before {
content: "> ";
}
}

@screen lg {
@apply mb-7;
}
p.paragraph {
@apply font-fira font-normal text-base text-white;
}

@screen xl {
@apply mb-8;
a.link {
&:link {
@apply font-normal font-semibold text-base text-white underline;
}
}

.h1 {
@extend .heading;
font-size: clamp(3rem, 5vw, 5rem);
}
&:visited {
@apply text-gray-1;
}

.h2 {
@extend .heading;
font-size: clamp(2rem, 4vw, 4rem);
}
&:hover {
@apply text-primary;
}

.h3 {
@extend .heading;
font-size: clamp(1.75rem, 3.5vw, 3rem);
}
&:focus {
@apply text-red-600;
}

.h4 {
@extend .heading;
font-size: clamp(1.5rem, 3vw, 2.5rem);
&:active {
@apply text-primary;
}
}

.h5 {
@extend .heading;
font-size: clamp(1.5rem, 2.5vw, 1.75rem);
}
ul.list {
@apply ml-2;

.h6 {
@extend .heading;
font-size: clamp(1.5rem, 2vw, 1.25rem);
}
> li {
@apply list-['>'] text-white;

ul.list li {
list-style-type: "> ";
> span {
@apply block text-base ml-2;
}
}
}
20 changes: 0 additions & 20 deletions web/src/styles/components.scss

This file was deleted.

33 changes: 9 additions & 24 deletions web/src/styles/globals.scss
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
@import "./components.scss";
@import "./text.scss";
@import "./btns.scss";
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
--color-primary: #79fb2a;
--color-secondary: #45ff02;
--color-tertiary: #e74c3c;
--c-gray-1: #313131;
--c-gray-2: #222222;
--c-gray-3: #1b1b1b;
--primary-text: #333;
--secondary-text: #555;
--c-primary: #45ff02;
--c-primary-opacity: #45ff0215;
--c-gray-1: #c7c7c620;
--c-gray-2: #7f7f7f25;
--c-gray-3: #cccccc;
--c-gray-4: #313131;
--c-gray-5: #222222;
}

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

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb));
html {
@apply h-full bg-gray-4;
}
31 changes: 22 additions & 9 deletions web/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,35 @@ const config: Config = {
content: ["./src/pages/**/*.{js,ts,jsx,tsx,mdx}", "./src/components/**/*.{js,ts,jsx,tsx,mdx}", "./src/app/**/*.{js,ts,jsx,tsx,mdx}"],
theme: {
extend: {
backgroundImage: {
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
"gradient-conic": "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
fontFamily: {
fira: ["var(--font-fira)"],
},
colors: {
primary: "var(--color-primary)",
secondary: "var(--color-secondary)",
tertiary: "var(--color-tertiary)",
"primary-text": "var(--color-primary-text)",
"secondary-text": "var(--color-secondary-text)",
"accent-text": "var(--color-primary)",
primary: "var(--c-primary)",
"primary-opacity": "var(--c-primary-opacity)",
"gray-1": "var(--c-gray-1)",
"gray-2": "var(--c-gray-2)",
"gray-3": "var(--c-gray-3)",
"gray-4": "var(--c-gray-4)",
"gray-5": "var(--c-gray-5)",
},
},
fontSize: {
xs: "12px",
sm: "clamp(0.5rem, 0.75vw, 16px)",
base: "clamp(1rem, 1vw, 18px)",
md: "clamp(1.25rem, 2vw, 24px)",
lg: "clamp(1.75rem, 3vw, 32px)",
xl: "clamp(2rem, 4vw, 42px)",
},
borderRadius: {
none: "0px",
xs: "15px",
sm: "25px",
DEFAULT: "35px",
md: "45px",
lg: "55px",
},
},
plugins: [],
};
Expand Down

0 comments on commit b1bfbbd

Please sign in to comment.