-
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 #5124
base: master
Are you sure you want to change the base?
Develop #5124
Changes from all commits
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,59 @@ | |
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" | ||
crossorigin="anonymous" | ||
/> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
href="./styles/index.scss" | ||
/> | ||
</head> | ||
<body> | ||
<h1>Product cards</h1> | ||
<div | ||
class="product-card" | ||
data-qa="card" | ||
> | ||
<img | ||
class="product-card__image" | ||
src="./images/imac.jpeg" | ||
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. The image path should be relative to the |
||
alt="apple" | ||
/> | ||
<h2 class="product-card__title"> | ||
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) | ||
</h2> | ||
<div class="product-card__code">Product code: 195434</div> | ||
<div class="product-card__mark"> | ||
<div class="stars"> | ||
<span class="stars__star"></span> | ||
<span class="stars__star"></span> | ||
<span class="stars__star"></span> | ||
<span class="stars__star"></span> | ||
<span class="stars__star"></span> | ||
</div> | ||
<div class="reviews">Reviews: 5</div> | ||
</div> | ||
<div class="product-card__price"> | ||
<span class="product-card__price-label">Price:</span> | ||
<span class="product-card__price-value">$2,199</span> | ||
</div> | ||
<a | ||
href="#" | ||
class="product-card__button" | ||
data-qa="hover" | ||
> | ||
BUY | ||
</a> | ||
</div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
.product-card { | ||
width: 200px; | ||
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 main values such as colors, font sizes, and dimensions. This will make your code more maintainable and easier to update. |
||
|
||
border: 1px solid #f3f3f3; | ||
border-radius: 5px; | ||
background-color: #fff; | ||
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. The background color should be defined using a SCSS variable. Ensure that all main values are stored in a separate variables file as per the task requirements. |
||
|
||
display: flex; | ||
flex-direction: column; | ||
padding: 32px 16px 16px; | ||
|
||
&__image { | ||
width: 160px; | ||
height: 134px; | ||
display: block; | ||
margin: 0 auto 40px; | ||
} | ||
|
||
&__title { | ||
margin: 0; | ||
padding: 0; | ||
font-size: 12px; | ||
line-height: 18px; | ||
font-weight: 500; | ||
color: #060b35; | ||
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. The color value should be defined using a SCSS variable. Ensure that all main values are stored in a separate variables file as per the task requirements. |
||
|
||
width: 100%; | ||
} | ||
&__code { | ||
font-size: 10px; | ||
color: #616070; | ||
text-align: left; | ||
margin-top: 4px; | ||
line-height: 14px; | ||
} | ||
|
||
&__price { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
width: 100%; | ||
margin-top: 24px; | ||
} | ||
|
||
&__price-label { | ||
font-size: 12px; | ||
color: #616070; | ||
} | ||
|
||
&__price-value { | ||
font-size: 16px; | ||
line-height: 18px; | ||
font-weight: 700; | ||
color: #060b35; | ||
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. The color value should be defined using a SCSS variable. Ensure that all main values are stored in a separate variables file as per the task requirements. |
||
text-align: right; | ||
} | ||
|
||
&__button { | ||
text-decoration: none; | ||
width: 100%; | ||
height: 40px; | ||
margin-top: 16px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: #00acdc; | ||
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. The background color should be defined using a SCSS variable. Ensure that all main values are stored in a separate variables file as per the task requirements. |
||
color: #fff; | ||
font-weight: 700; | ||
border-radius: 5px; | ||
border: 1px solid; | ||
border-color: #00acdc; | ||
font-size: 14px; | ||
line-height: 16px; | ||
} | ||
|
||
&__button:hover { | ||
background-color: #fff; | ||
color: #00acdc; | ||
border-radius: 5px; | ||
border: 1px solid; | ||
border-color: #00acdc; | ||
} | ||
|
||
&__mark { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
height: 16px; | ||
margin-top: 16px; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
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 an SCSS variable for the font family. This will make it easier to update the font across the entire project if needed. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.stars { | ||
display: flex; | ||
&__star { | ||
width: 16px; | ||
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 an SCSS variable for the width and height values. This will make it easier to update these values across the project if needed. |
||
height: 16px; | ||
background-image: url(../images/star.svg); | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
margin-right: 4px; | ||
border-radius: 0.5px; | ||
} | ||
|
||
&__star:nth-child(-n + 4) { | ||
background-image: url(../images/star-active.svg); | ||
} | ||
} | ||
|
||
.reviews { | ||
font-size: 10px; | ||
font-weight: 400; | ||
line-height: 14px; | ||
text-align: right; | ||
color: #060b35; | ||
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. The color value should be defined using an SCSS variable. Ensure that all main values are stored in a separate variables file as per the task requirements. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
body { | ||
margin: 0; | ||
} | ||
@import 'blocks/main'; | ||
@import 'blocks/card'; | ||
@import 'blocks/star'; |
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.
Ensure that the SCSS file
index.scss
includes the separated BEM blocks forcard
andstars
as required by the task. They should be in separate SCSS files.