rmcg.dev/FrontendMentor/article-preview-component/css/style.css

182 lines
3.3 KiB
CSS

/*
* Challenge resolutions:
* 375x667 & 1440x800
* 327x512 - 730x280
*/
@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 {
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;
width: 87%;
margin: 0 auto;
box-shadow: 0px 40px 40px -10px rgba(201, 213, 225, 0.503415);
}
.previewImage {
flex: 1 45%;
overflow: hidden;
border-radius: var(--cornerRadius) var(--cornerRadius) 0 0;
}
/*
* image size is: 660x528
* sketch: 327x200
* currently: 326.25x200.5
*/
.previewImage > img {
width: 100%;
margin:-4% 0 -15% 0%;
}
.previewBody {
flex: 1 60%;
margin-top: 0.85rem;
padding: 1rem 1.75rem 1rem 1.5rem;
}
.articleSummary {
}
.articleTitle {
color: var(--veryDarkGrayishBlue);
font-size: 16px;
line-height: 24px;
font-weight: 700;
letter-spacing: 0.2px;
}
.articleSell {
margin-top: 0.5rem;
color: var(--desaturatedDarkBlue);
font-size: 13px;
font-weight: 500;
letter-spacing: 0.12px;
line-height: 20px;
}
.articleAuthor {
margin-top: 1.5rem;
display: flex;
flex-direction: row;
justify-content: flex-start;
}
.authorImage {
border-radius: 50%;
width: 2rem;
height: 2rem;
}
.nameAndDate {
margin-left: 0.8rem;
margin-top: auto;
margin-bottom: auto;
}
.authorName {
color: var(--veryDarkGrayishBlue);
font-weight: 700;
}
.articleDate {
margin-top: 0.3rem;
color: var(--desaturatedDarkBlue);
font-weight: 500;
}
.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 {
width: 100%;
border-radius: var(--cornerRadius) 0 0 var(--cornerRadius);
}
/*
* 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%; */
}
.previewBody {
margin-top: 0.5rem;
padding: 1.2rem 2.3rem 1.6rem 0rem;
margin-left: 2.45rem;
}
.articleTitle {
font-size: 20px;
letter-spacing: 0.25px;
line-height: 28px;
}
.articleSell {
margin-top: 0.5rem;
}
.articleAuthor {
margin-top: 1rem;
}
}