💄 Style Navlink, primary buttons and headings

This commit is contained in:
nikolark committed 2022-03-06 15:16:16 +01:00
1 parent 13cc0d92a2
commit f775446224
9 files changed
+82 -23

No files matched your search

+18 -2
View File
@@ -4,6 +4,21 @@
align-items: center; align-items: center;
text-transform: uppercase; text-transform: uppercase;
} }
.navLink:after {
position: absolute;
right: 12px;
left: 14px;
display: block;
height: 1px;
background-color: rgba(243, 33, 61, 0.4);
box-shadow: 0 0 4px rgba(243, 33, 61, 0.4), 0 0 11px rgba(243, 33, 61, 0.4), 0 0 19px rgba(243, 33, 61, 0.4);
content: "";
transform: rotate(-2.5deg);
}
.navLink:hover:after {
background-color: var(--brand);
box-shadow: 0 0 4px var(--brand), 0 0 11px var(--brand), 0 0 19px var(--brand), 0 0 30px var(--brand);
}
.logoNav { .logoNav {
margin-left: 1.5rem; margin-left: 1.5rem;
@@ -17,12 +32,13 @@
list-style: none; list-style: none;
} }
.navLink { .navLink {
position: relative;
padding: 0.4rem 0.8rem; padding: 0.4rem 0.8rem;
border: 1px solid transparent; border: 1px solid transparent;
transition: color 0.1s ease-in-out;
} }
.navLink:hover { .navLink:hover {
border-color: var(--border); color: white;
border-radius: 4px;
} }
.active.active { .active.active {
color: white; color: white;
+3 -1
View File
@@ -45,7 +45,9 @@ export const Header: React.FC = () => {
</NavLink> </NavLink>
</li> </li>
<li> <li>
<a href={ADMIN_URL}>Admin</a> <a href={ADMIN_URL} className={styles.navLink}>
Admin
</a>
</li> </li>
</ul> </ul>
</nav> </nav>
@@ -21,7 +21,7 @@
left: 0; left: 0;
padding: 4px; padding: 4px;
color: white; color: white;
font-weight: bold; font-size: 1.5rem;
} }
.productImage { .productImage {
@@ -0,0 +1,5 @@
.form {
display: grid;
max-width: 500px;
gap: 1rem;
}
+16 -15
View File
@@ -3,6 +3,7 @@ import React from "react";
import { SubmitHandler, useForm } from "react-hook-form"; import { SubmitHandler, useForm } from "react-hook-form";
import { CreateUserDocument } from "../../types"; import { CreateUserDocument } from "../../types";
import styles from "./UserCreate.module.css";
type FormValues = { type FormValues = {
firstName: string; firstName: string;
@@ -30,20 +31,20 @@ export const UserCreate = () => {
}; };
return ( return (
<form onSubmit={handleSubmit(onSubmit)}> <div>
<label>Fornavn</label> <h2>Opprett ny</h2>
<input {...register("firstName", { required: true })} /> <form onSubmit={handleSubmit(onSubmit)} className={styles.form}>
{errors.firstName && <span>This field is required</span>} <label>Fornavn</label>
<br /> <input {...register("firstName", { required: true })} />
<label>Etternavn</label> {errors.firstName && <span>This field is required</span>}
<input {...register("lastName", { required: true })} /> <label>Etternavn</label>
{errors.lastName && <span>This field is required</span>} <input {...register("lastName", { required: true })} />
<br /> {errors.lastName && <span>This field is required</span>}
<label>E-post</label> <label>E-post</label>
<input type="email" {...register("email", { required: true })} /> <input type="email" {...register("email", { required: true })} />
{errors.email && <span>This field is required</span>} {errors.email && <span>This field is required</span>}
<br /> <input type="submit" disabled={creating} className="btn-primary" />
<input type="submit" disabled={creating} /> </form>
</form> </div>
); );
}; };
+1 -1
View File
@@ -55,7 +55,7 @@ export const Deposit: React.FC = () => {
<input name="amount" value={amount} onChange={(event) => setAmount(event.target.value)} placeholder="0" /> <input name="amount" value={amount} onChange={(event) => setAmount(event.target.value)} placeholder="0" />
</section> </section>
<section className={styles.checkout}> <section className={styles.checkout}>
<button type="button" onClick={onSubmit}> <button type="button" onClick={onSubmit} className="primary">
Sett inn Sett inn
</button>{" "} </button>{" "}
<button type="button" onClick={reset}> <button type="button" onClick={reset}>
+1 -1
View File
@@ -70,7 +70,7 @@ export const Register: React.FC = () => {
<span className={styles.total}> <span className={styles.total}>
Totalt: <span>{total}</span> Totalt: <span>{total}</span>
</span> </span>
<button type="button" onClick={onSubmit}> <button type="button" onClick={onSubmit} className="primary">
Kjøp Kjøp
</button>{" "} </button>{" "}
<button type="button" onClick={reset}> <button type="button" onClick={reset}>
+4 -1
View File
@@ -15,6 +15,7 @@ export const UserList = () => {
const users = showAll ? allUsers : allUsers.filter((u) => activeUserFilter(u)); const users = showAll ? allUsers : allUsers.filter((u) => activeUserFilter(u));
return ( return (
<div> <div>
<h2>Folk</h2>
<button type="button" onClick={() => setShowAll(!showAll)}> <button type="button" onClick={() => setShowAll(!showAll)}>
{showAll ? "Skjul gamliser" : "Vis alle"} {showAll ? "Skjul gamliser" : "Vis alle"}
</button> </button>
@@ -28,7 +29,9 @@ export const UserList = () => {
))} ))}
</ul> </ul>
<br /> <br />
<Link to="/users/create">Opprett ny</Link> <Link to="/users/create" className="btn-primary">
Opprett ny
</Link>
</div> </div>
); );
}; };
+33 -1
View File
@@ -33,6 +33,7 @@ body {
background-color: var(--background); background-color: var(--background);
color: var(--text); color: var(--text);
font-family: var(--font-family); font-family: var(--font-family);
text-shadow: 0 0 4px currentColor, 0 0 11px currentColor, 0 0 19px currentColor;
} }
/* Links */ /* Links */
@@ -50,7 +51,22 @@ a:active {
} }
a:hover { a:hover {
color: var(--interlace); color: var(--text);
}
h1,
h2,
h3,
h4,
h5 {
color: var(--sun);
}
a.btn-primary {
padding: 0.4rem 1rem;
border: 1px solid transparent;
background: linear-gradient(var(--sun) 30%, var(--sun-end) 100%);
border-radius: 4px;
box-shadow: 0 0 4px var(--sun), 0 0 11px var(--sun), 0 0 19px var(--sun);
color: var(--text);
} }
/* Buttons */ /* Buttons */
@@ -61,11 +77,18 @@ button {
border-radius: 4px; border-radius: 4px;
color: var(--border); color: var(--border);
font-family: var(--font-family); font-family: var(--font-family);
text-shadow: 0 0 4px currentColor, 0 0 11px currentColor, 0 0 19px currentColor;
} }
button:hover { button:hover {
color: var(--text); color: var(--text);
cursor: pointer; cursor: pointer;
} }
button.primary {
border: 1px solid transparent;
background: linear-gradient(var(--sun) 30%, var(--sun-end) 100%);
box-shadow: 0 0 4px var(--sun), 0 0 11px var(--sun), 0 0 19px var(--sun);
color: var(--text);
}
/* Inputs */ /* Inputs */
input { input {
@@ -76,11 +99,20 @@ input {
color: var(--text); color: var(--text);
font-family: var(--font-family); font-family: var(--font-family);
font-size: 1.5rem; font-size: 1.5rem;
text-shadow: 0 0 4px currentColor, 0 0 11px currentColor, 0 0 19px currentColor;
} }
input:focus { input:focus {
background: rgba(85, 109, 200, 0.1); background: rgba(85, 109, 200, 0.1);
outline: none; outline: none;
} }
input.btn-primary {
padding: 0.4rem 1rem;
border: 1px solid transparent;
background: linear-gradient(var(--sun) 30%, var(--sun-end) 100%);
border-radius: 4px;
box-shadow: 0 0 4px var(--sun), 0 0 11px var(--sun), 0 0 19px var(--sun);
color: var(--text);
}
::placeholder { ::placeholder {
color: var(--border); color: var(--border);
} }