From 18652c6ff5e10208298bea67ffce6b4ed327c97d Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 18 Apr 2021 11:30:10 +0200 Subject: search page without inline css --- components/ui.tsx | 19 +++--------------- pages/_app.tsx | 1 + pages/index.tsx | 6 +++--- pages/search.tsx | 56 +++++++++++------------------------------------------- styles/global.css | 18 ++++++++++-------- styles/search.css | 12 ++++++++++++ styles/utility.css | 11 ++++++++++- 7 files changed, 50 insertions(+), 73 deletions(-) create mode 100644 styles/search.css diff --git a/components/ui.tsx b/components/ui.tsx index e2d19ad..60b80f4 100644 --- a/components/ui.tsx +++ b/components/ui.tsx @@ -12,14 +12,11 @@ export function Vierkant(props: { children?: ReactNode; className?: string; id?: string; - fullwidth?: boolean; onclick?: () => void; }) { return @@ -98,6 +95,7 @@ export function Input(props: { dark?: boolean; autocomplete?: string; autofocus?: boolean; + className?: string; }) { return ; } diff --git a/pages/_app.tsx b/pages/_app.tsx index 290e687..3f66711 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -12,6 +12,7 @@ import '../styles/ui.css'; import '../styles/utility.css'; import '../styles/index.css'; +import '../styles/search.css'; export default function VierOpEenRijWebsite({ Component, pageProps }) { return
diff --git a/pages/index.tsx b/pages/index.tsx index 3d9da21..b5f4b50 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -107,17 +107,17 @@ export default function HomePage() { Tegen computer } - + {loggedIn ? : }
{loggedIn - && + && } - +

Nieuws ofzo

Chess.com heeft heel veel troep waar niemand naar kijkt

diff --git a/pages/search.tsx b/pages/search.tsx index 2b8668a..90f1f67 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -24,32 +24,21 @@ function search(callback: (results: Array) => void) { } function SearchResults(props: { userList: Array; }) { - return
+ return
{props.userList?.map(user => )}
; } function SearchResult(props: { user: userInfo; }) { return -
+
-
- {props.user.username} -

{props.user.status}

+
+ {props.user.username} +

{props.user.status}

; @@ -58,40 +47,22 @@ function SearchResult(props: { user: userInfo; }) { function SearchBar(props: { searchFunction: (event?: FormEvent) => void; }) { - return + return
- +
; } @@ -112,12 +83,7 @@ export default function HomePage() { {searched && results.length == 0 &&

Geen zoekresultaten gevonden

} diff --git a/styles/global.css b/styles/global.css index 3c28cfc..b6ed028 100644 --- a/styles/global.css +++ b/styles/global.css @@ -116,14 +116,20 @@ h1, h2, h3, p, b, i, span, td, th { table { table-layout: fixed; } /* table styles */ -td, th { - padding: 4px; - font-size: 15px; +td, th { padding: 4px; } + +input { + color: var(--foreground); + background-color: transparent; + font-family: inherit; + border: 0; + font-size: 1rem; /* why? */ } input::placeholder { font-style: italic; - opacity: .8; + opacity: 1; + color: var(--gray-600); } /* remove chrome's ugly :focus outline */ @@ -135,10 +141,6 @@ input::placeholder { /* material-ui default state */ svg.MuiSvgIcon-root { transition: none !important; } -input::placeholder { opacity: .75; } -input.dark::placeholder { color: var(--text); } -input.light::placeholder { color: var(--text-alt); } - /* editable field status */ *[contenteditable] { border-color: var(--background-alt); } *[contenteditable="true"]:focus { border-color: var(--disk-a); } diff --git a/styles/search.css b/styles/search.css new file mode 100644 index 0000000..06a3918 --- /dev/null +++ b/styles/search.css @@ -0,0 +1,12 @@ +.searchBar input { + width: calc(100% - 2 * var(--spacing-medium) - 48px); + margin: 2px 0; +} + +.results .result .inner .userInfo { + left: calc(48px + var(--spacing-medium)); +} + +h1.noresults { + margin: 24px 32px; +} diff --git a/styles/utility.css b/styles/utility.css index 4331d3a..783b168 100644 --- a/styles/utility.css +++ b/styles/utility.css @@ -28,8 +28,17 @@ .a0 { top: 0; bottom: 0; left: 0; right: 0; } +.dispnone { display: none; } +.dispinbl { display: inline-block; } +.dispbl { display: block; } + +.valigntop { vertical-align: top; } +.valignsup { vertical-align: super; } + +.center { text-align: center; } + .subtile { - color: var(--gray-300); + color: var(--gray-600); font-style: italic; } -- cgit v1.2.3