From 5259f1e499f9a615600df0a7e0e51bbea6cd1cba Mon Sep 17 00:00:00 2001 From: markpernia <134836290+markpernia@users.noreply.github.com> Date: Wed, 7 Feb 2024 22:55:38 +0100 Subject: [PATCH] SMA-44: Unify CSS & declare CSS variables (#26) --- frontend/sportsmatch-app/src/App.css | 70 ++++++++++--------- .../src/styles/LoginComponent.css | 18 ----- frontend/sportsmatch-app/src/styles/Match.css | 23 ++---- .../sportsmatch-app/src/styles/SportEvent.css | 15 +--- 4 files changed, 44 insertions(+), 82 deletions(-) diff --git a/frontend/sportsmatch-app/src/App.css b/frontend/sportsmatch-app/src/App.css index 3296982d..f55329bf 100644 --- a/frontend/sportsmatch-app/src/App.css +++ b/frontend/sportsmatch-app/src/App.css @@ -1,42 +1,46 @@ -body{ - font-family: 'Inter', sans-serif; -} +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;900&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@700&display=swap'); -.App { - text-align: center; -} +:root { + --sm-primary-font: 'Inter', sans-serif; + --sm-secondary-font: 'Manrope', sans-serif; -.App-logo { - height: 40vmin; - pointer-events: none; -} + --sm-primary-bg: #f9f8f5; + --sm-orange: #e85f29; + --sm-dark: #4a494f; + --sm-white: #ffffff; + --sm-txt-dark: #393939; + --sm-secondary-orange: #fc4c02; + --sm-orange-overlay: rgba(232, 95, 41, 0.25); -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} + --sm-border-shadow: 0px 0px 5px rgba(0, 0, 0, 0.05); + --sm-border-radius: 2px; -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; + --sm-btn-size-regular: 3.125em; + --sm-btn-size-small: 1.875em; + + --sm-h1-size: 3em; + --sm-h2-size: 1em; + --sm-text-size: 1em; } -.App-link { - color: #61dafb; +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Inter', sans-serif; } -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } +svg { + color: var(--sm-white); } + +body { + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; + background: var(--sm-primary-bg); + background-size: cover; + background-position: center; +} \ No newline at end of file diff --git a/frontend/sportsmatch-app/src/styles/LoginComponent.css b/frontend/sportsmatch-app/src/styles/LoginComponent.css index b9e5e6f2..884fc984 100644 --- a/frontend/sportsmatch-app/src/styles/LoginComponent.css +++ b/frontend/sportsmatch-app/src/styles/LoginComponent.css @@ -1,11 +1,3 @@ -@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;900&display=swap"); - -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - .wrapper { width: 330px; background: #fff; @@ -110,16 +102,6 @@ text-decoration: underline; } -body { - display: flex; - justify-content: center; - align-items: center; - min-height: 100vh; - background: #e9e6e6; - background-size: cover; - background-position: center; -} - .alt-login { width: 100%; height: 3em; diff --git a/frontend/sportsmatch-app/src/styles/Match.css b/frontend/sportsmatch-app/src/styles/Match.css index 254d9305..f4bdd183 100644 --- a/frontend/sportsmatch-app/src/styles/Match.css +++ b/frontend/sportsmatch-app/src/styles/Match.css @@ -1,25 +1,14 @@ -@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@700&display=swap'); - -svg { - color: #fff; -} - .match { margin-top: 4em; } .match .row { margin: 0.75em 0; - box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.05); - background: linear-gradient( - 0deg, - rgba(232, 95, 41, 0.25), - rgba(232, 95, 41, 0.25) - ), - url(./assets/InProgress.png); + box-shadow: var(--sm-border-shadow); + background: linear-gradient(0deg,var(--sm-orange-overlay),var(--sm-orange-overlay)),url(./assets/InProgress.png); background-clip: content-box; background-size: cover; - border-radius: 2px; + border-radius: var(--sm-border-radius); min-height: 395px; } @@ -42,12 +31,10 @@ svg { } .match h1 { - font-family: 'Manrope', sans-serif; + font-family: var(--sm-secondary-font); font-size: 2.5em !important; font-weight: 900; - font-size: 1em; - - color: #fff; + color: var(--sm-white); } .match .overlap { diff --git a/frontend/sportsmatch-app/src/styles/SportEvent.css b/frontend/sportsmatch-app/src/styles/SportEvent.css index 6da6f508..2e0a338f 100644 --- a/frontend/sportsmatch-app/src/styles/SportEvent.css +++ b/frontend/sportsmatch-app/src/styles/SportEvent.css @@ -1,14 +1,3 @@ -@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;900&display=swap'); -@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@700&display=swap'); - -* { - font-family: 'Inter', sans-serif; -} - -body { - background-color: #F9F8F5; -} - .event .row { padding: 0.75em; min-height: 6.625em; @@ -29,8 +18,8 @@ body { text-align: right; background: linear-gradient( 0deg, - rgba(232, 95, 41, 0.25), - rgba(232, 95, 41, 0.25) + var(--sm-orange-overlay), + var(--sm-orange-overlay) ), url('/assets/img-event-card-badminton.png'); background-size: cover;