From 032923214557dd1a8782b1726d58c30d974cd330 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sat, 17 Aug 2019 02:00:36 +0200 Subject: [PATCH] style(course-teaser): make more responsive --- .../utils/course-teaser/course-teaser.scss | 89 ++++++++++++++++--- templates/table/course/course-teaser.hamlet | 4 +- 2 files changed, 80 insertions(+), 13 deletions(-) diff --git a/frontend/src/utils/course-teaser/course-teaser.scss b/frontend/src/utils/course-teaser/course-teaser.scss index 69e8bac35..79a6a9503 100644 --- a/frontend/src/utils/course-teaser/course-teaser.scss +++ b/frontend/src/utils/course-teaser/course-teaser.scss @@ -25,6 +25,36 @@ + [uw-course-teaser] { border-top: 1px solid var(--course-border-color); } + + @media (max-width: 768px) { + grid-template-columns: 140px 1fr; + grid-template-areas: + 'shrthnd chevron' + 'title title' + 'smstr school' + '. rgstrd' + 'tutor name' + 'duedate date' + 'dscrptnlbl .' + 'dscrptn dscrptn'; + } + + @media (max-width: 426px) { + grid-template-columns: 1fr; + grid-template-areas: + 'shrthnd' + 'title' + 'smstr' + 'school' + 'rgstrd' + 'tutor' + 'name' + 'duedate' + 'date' + 'dscrptnlbl' + 'dscrptn' + 'chevron'; + } } .course-teaser__not-expandable { @@ -61,6 +91,21 @@ &:hover::before { transform: scale(1.4) rotate(45deg); } + + @media (max-width: 768px) { + justify-self: end; + width: auto; + + &::before { + position: initial; + } + } + + @media (max-width: 426px) { + &::before { + transform: rotate(45deg); + } + } } /* semester */ @@ -70,15 +115,27 @@ a { color: var(--color-fontsec); } + + @media (max-width: 768px) { + justify-self: initial; + } } /* shorthand */ .course-teaser__shorthand { position: absolute; grid-area: shrthnd; - font-size: 2rem; - font-weight: bold; - color: var(--color-grey-medium); + + > a { + font-size: 2rem; + font-weight: bold; + color: var(--color-grey-medium); + text-decoration: none !important; /* sry. */ + } + + @media (max-width: 768px) { + position: initial; + } } /* title */ @@ -141,22 +198,24 @@ justify-self: end; color: var(--color-fontsec); font-style: italic; + + @media (max-width: 768px) { + justify-self: initial; + } + + @media (max-width: 426px) { + margin-top: 7px; + font-weight: bold; + font-style: initial; + } } /* hidden in closed state */ .course-teaser__description, -.course-teaser__description-label, -.course-teaser__registration { +.course-teaser__description-label { display: none; } -/* registered courses */ -.course-teaser__registered { - .course-teaser__registration { - display: block; - } - } - /* expanded courses */ .course-teaser__expanded { cursor: initial; @@ -169,6 +228,12 @@ &:hover::before { transform: scale(1.4) rotate(135deg); } + + @media (max-width: 426px) { + &::before { + transform: rotate(225deg); + } + } } .course-teaser__school-label, diff --git a/templates/table/course/course-teaser.hamlet b/templates/table/course/course-teaser.hamlet index c77666361..0857132ab 100644 --- a/templates/table/course/course-teaser.hamlet +++ b/templates/table/course/course-teaser.hamlet @@ -3,7 +3,9 @@ _{courseSemester}
_{courseSchoolName} -
_{courseShorthand} +
+ + _{courseShorthand}
_{courseName}