-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #5086
base: master
Are you sure you want to change the base?
Develop #5086
Changes from all commits
d593530
70e444d
934e70e
5a36ac6
fff6406
0880ff1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,12 +7,62 @@ | |||||
content="width=device-width, initial-scale=1.0" | ||||||
/> | ||||||
<title>Product cards</title> | ||||||
<link | ||||||
rel="preconnect" | ||||||
href="https://fonts.googleapis.com" | ||||||
/> | ||||||
<link | ||||||
rel="preconnect" | ||||||
href="https://fonts.gstatic.com" | ||||||
/> | ||||||
<link | ||||||
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" | ||||||
rel="stylesheet" | ||||||
/> | ||||||
<link | ||||||
rel="stylesheet" | ||||||
href="./styles/index.scss" | ||||||
/> | ||||||
</head> | ||||||
<body> | ||||||
<h1>Product cards</h1> | ||||||
<div class="product-cards"> | ||||||
<div | ||||||
class="product-card" | ||||||
data-qa="card" | ||||||
> | ||||||
<img | ||||||
src="./images/imac.jpeg" | ||||||
alt="imac" | ||||||
class="product-card__image" | ||||||
/> | ||||||
<div class="content"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<h2 class="content__title"> | ||||||
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) | ||||||
</h2> | ||||||
<p class="content__description">Product code: 195434</p> | ||||||
<div class="mark"> | ||||||
<div class="mark__stars"> | ||||||
<span class="star"></span> | ||||||
<span class="star"></span> | ||||||
<span class="star"></span> | ||||||
<span class="star"></span> | ||||||
<span class="star"></span> | ||||||
</div> | ||||||
Comment on lines
+44
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just reuse styles for stars from the stars task |
||||||
<div class="mark__reviews">Reviews: 5</div> | ||||||
</div> | ||||||
<div class="price"> | ||||||
<div class="price__word">Price:</div> | ||||||
<div class="price__numeric">$2,199</div> | ||||||
</div> | ||||||
<a | ||||||
href="#" | ||||||
data-qa="hover" | ||||||
class="bottom" | ||||||
> | ||||||
Comment on lines
+28
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you need to follow the BEM in this task |
||||||
BUY | ||||||
</a> | ||||||
</div> | ||||||
</div> | ||||||
</div> | ||||||
</body> | ||||||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,140 @@ | ||
body { | ||
margin: 0; | ||
font-family: Roboto, sans-serif; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using SCSS variables for properties like |
||
|
||
@mixin bottom-color { | ||
background-color: #00acdc; | ||
} | ||
|
||
@mixin text-color { | ||
color: #060b35; | ||
} | ||
|
||
.product-card { | ||
width: 200px; | ||
box-sizing: border-box; | ||
background-color: #fff; | ||
border-radius: 5px; | ||
border: 1px solid #f3f3f3; | ||
padding: 32px 16px 16px; | ||
|
||
&__image { | ||
display: block; | ||
margin: 0 auto 40px; | ||
width: 160px; | ||
height: 134px; | ||
background-size: cover; | ||
background-position: center; | ||
} | ||
} | ||
|
||
.content { | ||
background-position: center; | ||
|
||
&__title { | ||
display: flex; | ||
font-size: 12px; | ||
line-height: 18px; | ||
font-weight: 500; | ||
margin-bottom: 4px; | ||
|
||
@include text-color; | ||
} | ||
|
||
&__description { | ||
font-size: 10px; | ||
line-height: 14px; | ||
color: #616070; | ||
margin: 0 0 16px; | ||
} | ||
} | ||
|
||
.mark { | ||
display: flex; | ||
height: 16px; | ||
margin-bottom: 24px; | ||
justify-content: space-between; | ||
align-items: center; | ||
|
||
&__stars { | ||
display: flex; | ||
} | ||
|
||
&__reviews { | ||
font-size: 10px; | ||
line-height: 14px; | ||
text-align: right; | ||
font-weight: 400; | ||
|
||
@include text-color; | ||
} | ||
} | ||
|
||
.star { | ||
background-image: url(../images/star.svg); | ||
background-position: 50%; | ||
background-repeat: no-repeat; | ||
width: 16px; | ||
height: 16px; | ||
border-radius: 0.5px; | ||
gap: 4px; | ||
margin-right: 4px; | ||
|
||
&:nth-child(-n + 4) { | ||
background-image: url(../images/star-active.svg); | ||
} | ||
} | ||
|
||
.price { | ||
display: flex; | ||
justify-content: space-between; | ||
margin-bottom: 16px; | ||
|
||
&__word { | ||
font-size: 12px; | ||
font-weight: 400; | ||
line-height: 18px; | ||
text-align: left; | ||
color: #616070; | ||
} | ||
|
||
&__numeric { | ||
font-size: 16px; | ||
font-weight: 700; | ||
line-height: 18px; | ||
text-align: right; | ||
|
||
@include text-color; | ||
} | ||
} | ||
|
||
.bottom { | ||
display: block; | ||
text-align: center; | ||
padding: 12px; | ||
font-size: 14px; | ||
line-height: 16px; | ||
color: #fff; | ||
text-decoration: none; | ||
border-radius: 5px; | ||
font-weight: 700; | ||
|
||
@include bottom-color; | ||
|
||
&:hover { | ||
display: block; | ||
text-align: center; | ||
padding: 12px; | ||
font-size: 14px; | ||
line-height: 16px; | ||
text-decoration: none; | ||
border-radius: 5px; | ||
font-weight: 700; | ||
position: relative; | ||
background-color: #fff; | ||
color: #00acdc; | ||
box-sizing: border-box; | ||
border: 1px solid #00acdc; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The task requires SCSS variables to be defined in a separate file. Ensure that you have a separate SCSS file for variables and that it is imported correctly in your SCSS files. The Parcel bundler should handle the compilation of SCSS to CSS.