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

262 lines
4.5 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);
overflow: hidden;
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;
}
/*
* 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;
}
.articleSummary {
padding: 1rem 1.75rem 1rem 1.5rem;
}
.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;
}
.articleFooter {
/* margin-top: 1.5rem; */
display: flex;
flex-direction: row;
justify-content: flex-start;
padding: 1rem 1.5rem 1rem 1.5rem;
transition: 250ms ease-in-out;
}
.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;
}
.articleShareButton {
background-color: var(--lightGrayishBlue);
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;
}
.articleShareButton > .articleShareIcon {
}
.buttonDark {
background-color: var(--veryDarkGrayishBlue);
}
.buttonDark img svg path {
background-color: white;
}
.articleShareButtonTooltip {
display: none;
position: relative;
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;
bottom: 80px;
left: -104px;
overflow: visible;
}
.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;
}
.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;
margin-left: 0.25rem;
}
.articleSummary {
padding: 1rem 1.5rem 1rem 1.5rem;
}
.articleTitle {
font-size: 20px;
letter-spacing: 0.25px;
line-height: 28px;
}
.articleSell {
margin-top: 0.5rem;
}
.articleFooter {
padding: 0rem 1.5rem 1.5rem 1.5rem;
}
}