-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
add task solution #4820
base: master
Are you sure you want to change the base?
add task solution #4820
Changes from 1 commit
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 |
---|---|---|
|
@@ -11,8 +11,59 @@ | |
rel="stylesheet" | ||
href="./styles/index.scss" | ||
/> | ||
<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,400;0,500;0,700;1,400&display=swap" | ||
rel="stylesheet" | ||
/> | ||
</head> | ||
<body> | ||
<h1>Product cards</h1> | ||
<div | ||
class="product-card" | ||
id="product-card" | ||
data-qa="card" | ||
> | ||
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 use of both |
||
<div class="product-card__image"></div> | ||
|
||
<div class="product-content"> | ||
<div class="product-content__name"> | ||
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) | ||
</div> | ||
|
||
<div class="product-content__code">Product code: 195434</div> | ||
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 class naming convention seems to be BEM, but |
||
|
||
<div class="product-content__rating"> | ||
<div class="stars"> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
<div class="stars__star"></div> | ||
</div> | ||
|
||
<div class="product-reviews">Reviews: 5</div> | ||
</div> | ||
|
||
<div class="product-content__price"> | ||
<div class="text-price text-price--text">Price:</div> | ||
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 class |
||
<div class="text-price text-price--value">$2,199</div> | ||
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 class |
||
</div> | ||
|
||
<a | ||
href="#product-card" | ||
class="buy-button" | ||
data-qa="hover" | ||
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 |
||
> | ||
Buy | ||
</a> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,139 @@ | ||
$border-color: #f3f3f3; | ||
$product-card-width: 200px; | ||
$main-fonts: 'Roboto'; | ||
$main-text-color: #060b35; | ||
$second-text-color: #616070; | ||
$button-color: #00acdc; | ||
$border-radius: 5px; | ||
|
||
body { | ||
margin: 0; | ||
} | ||
|
||
.product-card { | ||
display: flex; | ||
flex-direction: column; | ||
box-sizing: border-box; | ||
width: $product-card-width; | ||
border: 1px solid $border-color; | ||
border-radius: $border-radius; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
&__image { | ||
background-image: url(../images/imac.jpeg); | ||
background-repeat: no-repeat; | ||
background-size: 100% 100%; | ||
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 image URL should be quoted ( |
||
width: 160px; | ||
height: 134px; | ||
margin: 32px 19px 0; | ||
box-sizing: border-box; | ||
} | ||
} | ||
|
||
.product-content { | ||
margin: 40px 16px 16px; | ||
font-family: $main-fonts, 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. You have declared the font-family for '.product-content' and its elements multiple times (lines 36, 39, 47, 90, 98). You should define it once globally for the body or a common parent class unless they differ. |
||
|
||
&__name { | ||
font-family: $main-fonts, sans-serif; | ||
font-weight: 500; | ||
font-size: 12px; | ||
line-height: 18px; | ||
color: $main-text-color; | ||
} | ||
|
||
&__code { | ||
font-family: $main-fonts, sans-serif; | ||
font-weight: 400; | ||
font-size: 10px; | ||
line-height: 14px; | ||
color: $second-text-color; | ||
margin: 4px 0 0; | ||
} | ||
|
||
&__rating { | ||
margin: 16px 0 0; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: flex-end; | ||
} | ||
|
||
&__price { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
margin: 24px 0 0; | ||
} | ||
} | ||
|
||
.stars { | ||
flex-direction: row; | ||
display: flex; | ||
gap: 4px; | ||
|
||
&__star { | ||
background-image: url(../images/star-active.svg); | ||
width: 16px; | ||
height: 16px; | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
|
||
&:last-of-type { | ||
background-image: url(../images/star.svg); | ||
} | ||
} | ||
} | ||
|
||
.product-reviews { | ||
font-family: $main-fonts, sans-serif; | ||
font-weight: 400; | ||
font-size: 10px; | ||
line-height: 14px; | ||
color: $main-text-color; | ||
} | ||
|
||
.text-price { | ||
font-family: $main-fonts, sans-serif; | ||
line-height: 18px; | ||
|
||
&--text { | ||
font-weight: 400; | ||
font-size: 12px; | ||
color: $second-text-color; | ||
} | ||
|
||
&--value { | ||
font-weight: 700; | ||
font-size: 16px; | ||
color: $main-text-color; | ||
} | ||
} | ||
|
||
.buy-button { | ||
box-sizing: border-box; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: $button-color; | ||
text-decoration: none; | ||
color: #ffff; | ||
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 written in lowercase to maintain consistency as per the code style rules. |
||
font-weight: 700; | ||
font-size: 14px; | ||
line-height: 16px; | ||
margin: 16px 0 0; | ||
border-radius: $border-radius; | ||
border: none; | ||
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 |
||
border: 1px solid $button-color; | ||
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 |
||
width: 166px; | ||
height: 40px; | ||
text-transform: uppercase; | ||
|
||
&:hover { | ||
color: $button-color; | ||
background-color: #ffff; | ||
border: 1px solid $button-color; | ||
box-sizing: border-box; | ||
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 |
||
} | ||
} |
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.
According to the Code Style Rules, SCSS files should be linked in HTML as CSS files after they have been compiled. You should include the compiled CSS file instead of the SCSS file directly.