-
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
add task solution #5069
base: master
Are you sure you want to change the base?
add task solution #5069
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 |
---|---|---|
|
@@ -7,12 +7,60 @@ | |
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 | ||
/> | ||
<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" | ||
/> | ||
Comment on lines
23
to
26
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 stylesheet link is pointing to an SCSS file ( |
||
</head> | ||
<body> | ||
<h1>Product cards</h1> | ||
<div | ||
class="card" | ||
data-qa="card" | ||
> | ||
<div class="card__image"></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. Use img tag to display card image instead of doing it with background property 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. fixed |
||
<p class="card__title"> | ||
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) | ||
</p> | ||
<div class="card__code"> | ||
<span>Product code:</span> | ||
<span>195434</span> | ||
</div> | ||
|
||
<div class="card__rating"> | ||
<div class="stars stars--4"> | ||
<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="card__rating-reviews">Reviews: 5</div> | ||
</div> | ||
|
||
<div class="card__price"> | ||
<span>Price:</span> | ||
<strong>$2,199</strong> | ||
</div> | ||
<a | ||
href="#" | ||
class="card__button" | ||
data-qa="hover" | ||
> | ||
Buy | ||
</a> | ||
</div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
.card { | ||
font-family: Roboto, sans-serif; | ||
box-sizing: border-box; | ||
padding: 32px 16px 16px; | ||
background: $white; | ||
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 variable 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. Ensure that the SCSS variable |
||
border: 1px solid $gray-elements; | ||
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 variable 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. Ensure that the SCSS variable |
||
border-radius: 5px; | ||
max-width: 200px; | ||
&__image { | ||
width: 100%; | ||
height: 134px; | ||
background-image: url(../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. Verify that the image |
||
background-position: center; | ||
background-size: cover; | ||
margin: 0 auto 40px; | ||
} | ||
&__title { | ||
font-weight: 500; | ||
font-size: 12px; | ||
line-height: 18px; | ||
color: $main-accent; | ||
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 variable 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. Ensure that the SCSS variable |
||
margin-bottom: 4px; | ||
} | ||
&__code { | ||
font-weight: 400; | ||
font-size: 10px; | ||
line-height: 1.4; | ||
color: $secondary; | ||
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 variable 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. Ensure that the SCSS variable |
||
} | ||
&__rating { | ||
display: flex; | ||
justify-content: space-between; | ||
flex-wrap: wrap; | ||
align-items: center; | ||
margin-top: 16px; | ||
margin-bottom: 24px; | ||
&-reviews { | ||
font-size: 10px; | ||
line-height: 14px; | ||
color: $main-accent; | ||
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 variable 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. Ensure that the SCSS variable |
||
font-weight: 400; | ||
text-align: right; | ||
} | ||
} | ||
&__price { | ||
display: flex; | ||
justify-content: space-between; | ||
flex-wrap: wrap; | ||
align-items: center; | ||
font-weight: 400; | ||
font-size: 12px; | ||
color: $secondary; | ||
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 variable 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. Ensure that the SCSS variable |
||
strong { | ||
font-weight: 700; | ||
font-size: 16px; | ||
line-height: 1.13; | ||
color: $main-accent; | ||
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 variable 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. Ensure that the SCSS variable |
||
} | ||
|
||
margin-bottom: 16px; | ||
} | ||
&__button { | ||
box-sizing: border-box; | ||
border-radius: 5px; | ||
background: $blue-accent; | ||
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 variable 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. Ensure that the SCSS variable |
||
width: 166px; | ||
height: 40px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
text-transform: uppercase; | ||
text-decoration: none; | ||
font-weight: 700; | ||
font-size: 14px; | ||
line-height: 16px; | ||
color: $white; | ||
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 variable 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. Ensure that the SCSS variable |
||
transition: 0.2s ease-in-out; | ||
border: 1px solid $blue-accent; | ||
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 variable 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. Ensure that the SCSS variable |
||
&:hover { | ||
color: $blue-accent; | ||
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 variable 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. Ensure that the SCSS variable |
||
background: $white; | ||
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 variable 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. Ensure that the SCSS variable |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
@import 'variables'; | ||
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. Ensure that the |
||
@import 'card'; | ||
@import 'stars'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.stars { | ||
display: flex; | ||
&__star { | ||
width: 16px; | ||
height: 16px; | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
background-image: url(../images/star.svg); | ||
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. Ensure that the 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. Verify that the image |
||
margin-right: 4px; | ||
&:last-child { | ||
margin-right: 0; | ||
} | ||
} | ||
|
||
@for $i from 1 through 5 { | ||
&--#{$i} .stars__star:nth-child(-n + #{$i}) { | ||
background-image: url(../images/star-active.svg); | ||
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. Ensure that the 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. Verify that the image |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
$main-accent: #060b35; | ||
$secondary: #616070; | ||
$white: #fff; | ||
$blue-accent: #00acdc; | ||
$gray-elements: #f3f3f3; | ||
$yellow-stars: #ffde6a; |
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 HTML file is linking to an SCSS file (
index.scss
). Browsers cannot interpret SCSS directly. You need to compile your SCSS into CSS and link the resulting CSS file here.