This repository has been archived on 2023-01-17. You can view files and clone it, but cannot push or open issues or pull requests.
old_tarasis.net/FrontendMentor/article-preview-component/css/style.css

149 lines
2.7 KiB
CSS
Raw Normal View History

/*
* Challenge resolutions:
* 375x667 & 1440x800
2020-10-01 15:53:16 +02:00
* 327x512 - 730x280
*/
2020-10-01 15:53:16 +02:00
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700&display=swap');
:root {
/* font stuff */
font-size: 20px;
/* colors */
--veryDarkGrayishBlue: hsl(217, 19%, 35%);
--desaturatedDarkBlue: hsl(214, 17%, 51%);
--grayishBlue: hsl(212, 23%, 69%);
--lightGrayishBlue: hsl(210, 46%, 95%);
/* corner radius */
--cornerRadius: 10px;
}
/* Base styling */
body {
2020-10-01 15:53:16 +02:00
font-family: 'Manrope', sans-serif;
background-color: var(--lightGrayishBlue);
display: flex;
flex-direction: column;
font-size: 13px;
justify-content: center;
height: 100vh;
}
.container {
}
.articlePreview {
display: flex;
flex-direction: column;
border-radius: var(--cornerRadius);
background-color: white;
2020-10-01 15:53:16 +02:00
width: 87%;
margin: 0 auto;
}
2020-10-01 15:53:16 +02:00
.previewImage {
2020-10-01 15:53:16 +02:00
flex: 1 45%;
overflow: hidden;
border-radius: var(--cornerRadius) var(--cornerRadius) 0 0;
}
2020-10-01 15:53:16 +02:00
/*
* image size is: 660x528
* sketch: 327x200
* currently: 326.25x200.5
*/
.previewImage > img {
width: 100%;
margin:-4% 0 -15% 0% ;
}
.previewBody {
2020-10-01 15:53:16 +02:00
flex: 1 60%;
margin-top: 1.5rem;
2020-10-01 15:53:16 +02:00
padding: 1rem 1.5rem;
}
2020-10-01 15:53:16 +02:00
.articleSummary {
}
.articleTitle {
color: var(--veryDarkGrayishBlue);
font-size: 18px;
line-height: 1.3em;
}
.articleSell {
margin-top: 0.5rem;
color: var(--desaturatedDarkBlue);
font-size: 16px;
line-height: 1.3em;
}
.articleAuthor {
margin-top: 1.5rem;
display: flex;
flex-direction: row;
justify-content: flex-start;
}
.authorImage {
border-radius: 50%;
width: 2.5rem;
height: 2.5rem;
}
2020-10-01 15:53:16 +02:00
.nameAndDate {
margin-left: 0.5rem;
margin-top: auto;
margin-bottom: auto;
}
2020-10-01 15:53:16 +02:00
.authorName {
color: var(--veryDarkGrayishBlue)
}
2020-10-01 15:53:16 +02:00
.articleDate {
margin-top: 0.3rem;
color: var(--desaturatedDarkBlue);
}
2020-10-01 15:53:16 +02:00
.articleShareIcon {
width: 20px;
height: 20px;
background-color: var(--lightGrayishBlue);
margin-left: auto;
margin-top: auto;
margin-bottom: auto;
/* not the right way to put a circle around the icon */
border-radius: 50%;
}
.attribution {
}
@media screen and (min-width: 500px) {
body {
align-content: center;
align-items: center;
}
.articlePreview {
flex-direction: row;
width: 50%;
}
.previewImage {
2020-10-01 15:53:16 +02:00
width: 100%;
border-radius: var(--cornerRadius) 0 0 var(--cornerRadius);
2020-10-01 15:53:16 +02:00
}
/*
* sketch: 285x280
* at present: 237x269
* 201x290 using it as a background image
*/
.previewImage > img {
height: 105%;
object-fit: cover;
object-position: left;
/* margin-bottom: 10%; */
}
}