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/newbie/article-preview-component/css/style.css

242 lines
4.4 KiB
CSS
Raw Permalink 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;
}
.articlePreview {
display: flex;
flex-direction: column;
border-radius: var(--cornerRadius);
overflow: hidden;
background-color: white;
2020-10-01 15:53:16 +02:00
width: 87%;
margin: 0 auto;
2020-10-03 14:05:43 +02:00
box-shadow: 0px 40px 40px -10px rgba(201, 213, 225, 0.503415);
}
2020-10-01 15:53:16 +02:00
.previewImage {
2020-10-04 01:57:50 +02:00
flex: 1 40%;
2020-10-01 15:53:16 +02:00
overflow: hidden;
}
2020-10-01 15:53:16 +02:00
.previewImage > img {
width: 100%;
2020-10-04 02:15:04 +02:00
margin:-5% 0 -14.5% 0%;
2020-10-01 15:53:16 +02:00
}
.previewBody {
2020-10-01 15:53:16 +02:00
flex: 1 60%;
2020-10-03 14:05:43 +02:00
margin-top: 0.85rem;
}
2020-10-01 15:53:16 +02:00
.articleSummary {
padding: 1rem 1.75rem 1rem 1.5rem;
}
2020-10-03 14:05:43 +02:00
.articleTitle {
color: var(--veryDarkGrayishBlue);
2020-10-03 14:05:43 +02:00
font-size: 16px;
line-height: 24px;
font-weight: 700;
letter-spacing: 0.2px;
}
2020-10-03 14:05:43 +02:00
.articleSell {
margin-top: 0.5rem;
color: var(--desaturatedDarkBlue);
2020-10-03 14:05:43 +02:00
font-size: 13px;
font-weight: 500;
letter-spacing: 0.12px;
line-height: 20px;
}
2020-10-03 14:05:43 +02:00
.articleFooter {
display: flex;
flex-direction: row;
justify-content: flex-start;
padding: 1rem 1.5rem 1rem 1.5rem;
transition: 250ms ease-in-out;
position: relative;
}
.authorImage {
border-radius: 50%;
2020-10-03 14:05:43 +02:00
width: 2rem;
height: 2rem;
}
2020-10-01 15:53:16 +02:00
.nameAndDate {
2020-10-03 14:05:43 +02:00
margin-left: 0.8rem;
margin-top: auto;
margin-bottom: auto;
}
2020-10-01 15:53:16 +02:00
.authorName {
2020-10-03 14:05:43 +02:00
color: var(--veryDarkGrayishBlue);
font-weight: 700;
}
2020-10-01 15:53:16 +02:00
.articleDate {
margin-top: 0.3rem;
color: var(--desaturatedDarkBlue);
2020-10-03 14:05:43 +02:00
font-weight: 500;
}
2020-10-01 15:53:16 +02:00
.articleShareButton {
background-color: var(--lightGrayishBlue);
color: #6E8098;
width: 30px;
height: 30px;
border: none;
border-radius: 50%;
cursor: pointer;
margin-left: auto;
margin-top: auto;
margin-bottom: auto;
transition: 250ms ease-in-out;
}
.buttonDark {
background-color: var(--desaturatedDarkBlue);
color: var(--lightGrayishBlue);
}
.articleShareButtonTooltip {
display: none;
position: absolute;
justify-content: space-between;
align-items: center;
border-radius: 0.5rem;
background: var(--veryDarkGrayishBlue);
box-shadow: 0px 10px 10px rgba(201, 213, 225, 0.503415);
width: 170px;
padding: 0.75rem 1rem;
top: -60px;
right: -47px;
}
.articleShareButtonTooltip::before {
content: "";
width: 0px;
height: 0px;
border: 0.8rem solid transparent;
position: absolute;
left: 45%;
bottom: -25px;
border-top: 10px solid var(--veryDarkGrayishBlue);
}
.articleShareSection {
display: none;
align-items: center;
justify-content: space-around;
width: 80%;
height: 2rem;
}
.backgroundDark {
background: var(--veryDarkGrayishBlue);
}
.articleShareButtonTooltip > p, .articleShareSection > p {
letter-spacing: 5px;
color: var(--grayishBlue);
font-weight: 500;
font-size: 13px;
}
@media screen and (min-width: 650px) {
body {
align-content: center;
align-items: center;
}
.articlePreview {
flex-direction: row;
width: 50%;
2020-10-04 01:57:50 +02:00
min-width: 600px;
overflow: visible;
}
.previewImage {
2020-10-01 15:53:16 +02:00
width: 100%;
border-radius: var(--cornerRadius) 0 0px var(--cornerRadius);
2020-10-01 15:53:16 +02:00
}
.previewImage > img {
2020-10-04 01:57:50 +02:00
margin:0;
2020-10-01 15:53:16 +02:00
height: 105%;
object-fit: cover;
object-position: left;
}
2020-10-03 14:05:43 +02:00
.previewBody {
margin-top: 0.65rem;
margin-left: 0.25rem;
}
.articleSummary {
padding: 1rem 1.75rem 1rem 1.5rem;
2020-10-03 14:05:43 +02:00
}
.articleTitle {
font-size: 20px;
letter-spacing: 0.25px;
line-height: 28px;
}
.articleSell {
margin-top: 0.5rem;
}
.articleFooter {
padding: 0rem 1.75rem 1.5rem 1.5rem;
2020-10-03 14:05:43 +02:00
}
}
.attribution { position: absolute; bottom: 0; font-size: 11px; text-align: center; }
.attribution a { color: hsl(228, 45%, 44%); }