Skip to content
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 #5088

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Develop #5088

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- #region head -->
<!doctype html>
<html lang="en">
<head>
Expand All @@ -7,12 +8,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="anonymous"
/>
<link
href="https://fonts.googleapis.com/css2?family=Manrope:[email protected]&family=Roboto:wght@400;500;700&family=Sen:[email protected]&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./styles/index.scss"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task requires that the card and stars BEM blocks be separated into their own SCSS files. Currently, the HTML file links to a single index.scss file. Please separate the SCSS files for each BEM block and update the link references accordingly.

/>
</head>
<!-- #endregion -->
<body>
<h1>Product cards</h1>
<div
class="card"
data-qa="card"
>
<img
class="card__image"
src="images/imac.jpeg"
alt="imac image"
/>
<div class="card__name">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</div>
<div class="card__code">Product code: 195434</div>
<div class="card__review">
<div class="stars card__review-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="card__review-text">Reviews: 5</div>
</div>
<div class="card__price">
<div class="card__price-text">Price:</div>
<div class="card__price-numbers">$2,199</div>
</div>
<a
class="card__buy"
href="#Buy"
data-qa="hover"
>
Buy
</a>
</div>
</body>
</html>
24 changes: 24 additions & 0 deletions src/styles/_body.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// #region fonts
.roboto-regular {
font-family: Roboto, sans-serif;
font-weight: 400;
font-style: normal;
}

.roboto-medium {
font-family: Roboto, sans-serif;
font-weight: 500;
font-style: normal;
}

.roboto-bold {
font-family: Roboto, sans-serif;
font-weight: 700;
font-style: normal;
}

// #endregion

body {
margin: 0;
}
117 changes: 117 additions & 0 deletions src/styles/_card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
@use 'variables';

.card {
font-family: Roboto, sans-serif;
font-size: 12px;
font-weight: 500;
line-height: 18px;
color: variables.$mainAccentColor;

box-sizing: border-box;
width: 200px;
height: 408px;
padding-inline: 16px;
padding-block: 32px 16px;

border: 1px solid #f3f3f3;

border-radius: 5px;

&__image {
display: block;
width: 160px;
height: 134px;

margin-inline: 3px;
}

&__name {
margin-top: 40px;
}

&__code {
margin-top: 4px;

font-family: Roboto, sans-serif;
font-size: 10px;
font-weight: 400;
line-height: 14px;
color: variables.$secondaryColor;
}

// #region review
&__review {
margin-top: 16px;

height: 16px;
display: flex;
justify-content: space-between;
align-items: center;
}

&__review-stars {
width: 96px;
display: flex;
justify-content: space-between;
}

&__review-text {
width: 56px;

font-size: 10px;
font-weight: 400;
line-height: 14px;
text-align: right;
}

// #endregion

// #region price
&__price {
margin-top: 24px;

display: flex;
justify-content: space-between;
align-items: center;
}

&__price-text {
font-family: Roboto, sans-serif;
font-weight: 400;
text-align: left;
color: variables.$secondaryColor;
}

&__price-numbers {
font-family: Roboto, sans-serif;
font-weight: 700;
font-size: 16px;
text-align: right;
}

// #endregion

&__buy {
box-sizing: border-box;
display: block;
margin-top: 16px;
width: 166px;
height: variables.$buyButtonHeight;

line-height: variables.$buyButtonHeight;
font-size: 14px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
color: variables.$buyTextColor;

background-color: variables.$buyBackgroundColor;
border-radius: 5px;
border: 1px solid variables.$buyBackgroundColor;

&:hover {
background-color: variables.$buyTextColor;
color: variables.$buyBackgroundColor;
}
}
}
14 changes: 14 additions & 0 deletions src/styles/_stars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.stars {
&__star {
background-image: url(../images/star.svg);
width: 16px;
height: 16px;
background-size: 80%;
background-position: center;
background-repeat: no-repeat;
}

&__star:nth-child(-n + 4) {
background-image: url(../images/star-active.svg);
}
}
5 changes: 5 additions & 0 deletions src/styles/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$mainAccentColor: #060b35;
$secondaryColor: #616070;
$buyButtonHeight: 40px;
$buyBackgroundColor: #00acdc;
$buyTextColor: #fff;
7 changes: 4 additions & 3 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
body {
margin: 0;
}
@use 'variables';
@use 'body';
@use 'stars';
@use 'card';
Loading