style(course-teaser): make more responsive

This commit is contained in:
Felix Hamann 2019-08-17 02:00:36 +02:00
parent 873c0f249a
commit 0329232145
2 changed files with 80 additions and 13 deletions

View File

@ -25,6 +25,36 @@
+ [uw-course-teaser] { + [uw-course-teaser] {
border-top: 1px solid var(--course-border-color); 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 { .course-teaser__not-expandable {
@ -61,6 +91,21 @@
&:hover::before { &:hover::before {
transform: scale(1.4) rotate(45deg); 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 */ /* semester */
@ -70,15 +115,27 @@
a { a {
color: var(--color-fontsec); color: var(--color-fontsec);
} }
@media (max-width: 768px) {
justify-self: initial;
}
} }
/* shorthand */ /* shorthand */
.course-teaser__shorthand { .course-teaser__shorthand {
position: absolute; position: absolute;
grid-area: shrthnd; grid-area: shrthnd;
font-size: 2rem;
font-weight: bold; > a {
color: var(--color-grey-medium); font-size: 2rem;
font-weight: bold;
color: var(--color-grey-medium);
text-decoration: none !important; /* sry. */
}
@media (max-width: 768px) {
position: initial;
}
} }
/* title */ /* title */
@ -141,22 +198,24 @@
justify-self: end; justify-self: end;
color: var(--color-fontsec); color: var(--color-fontsec);
font-style: italic; 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 */ /* hidden in closed state */
.course-teaser__description, .course-teaser__description,
.course-teaser__description-label, .course-teaser__description-label {
.course-teaser__registration {
display: none; display: none;
} }
/* registered courses */
.course-teaser__registered {
.course-teaser__registration {
display: block;
}
}
/* expanded courses */ /* expanded courses */
.course-teaser__expanded { .course-teaser__expanded {
cursor: initial; cursor: initial;
@ -169,6 +228,12 @@
&:hover::before { &:hover::before {
transform: scale(1.4) rotate(135deg); transform: scale(1.4) rotate(135deg);
} }
@media (max-width: 426px) {
&::before {
transform: rotate(225deg);
}
}
} }
.course-teaser__school-label, .course-teaser__school-label,

View File

@ -3,7 +3,9 @@
<a href=@{TermCourseListR courseTerm}>_{courseSemester} <a href=@{TermCourseListR courseTerm}>_{courseSemester}
<div .course-teaser__school> <div .course-teaser__school>
<a href=@{TermSchoolCourseListR courseTerm courseSchool}>_{courseSchoolName} <a href=@{TermSchoolCourseListR courseTerm courseSchool}>_{courseSchoolName}
<div .course-teaser__shorthand>_{courseShorthand} <div .course-teaser__shorthand>
<a href=@{CourseR courseTerm courseSchool courseShorthand CShowR}>
_{courseShorthand}
<div .course-teaser__title> <div .course-teaser__title>
<a href=@{CourseR courseTerm courseSchool courseShorthand CShowR}> <a href=@{CourseR courseTerm courseSchool courseShorthand CShowR}>
_{courseName} _{courseName}