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 #4957

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

Develop #4957

Show file tree
Hide file tree
Changes from 3 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
17 changes: 9 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Stars block

Implement the [Stars Block](https://www.figma.com/file/ojkArVazq7vsX0nbpn9CxZ/Moyo-%2F-Catalog-(ENG)?node-id=11325%3A2960) used in a card and catalog.
Implement the [Stars Block](<https://www.figma.com/file/ojkArVazq7vsX0nbpn9CxZ/Moyo-%2F-Catalog-(ENG)?node-id=11325%3A2960>) used in a card and catalog.

Hold `Alt` key (`Option` on MacOS) to measure distances in Figma.
Hold `Alt` key (`Option` on MacOS) to measure distances in Figma.

> Here are the [Layout Tasks Instructions](https://mate-academy.github.io/layout_task-guideline)

## Requirements:

- Reset browser's default `margin`
- Add 6 `stars` blocks with 5 `stars__star` elements each.
- Add `stars--0`, `stars--1`, `stars--2` ... `stars--5` modifiers to the blocks one per each
Expand All @@ -22,12 +23,12 @@ Hold `Alt` key (`Option` on MacOS) to measure distances in Figma.

❗️ Replace `<your_account>` with your Github username and copy the links to `Pull Request` description:

- [DEMO LINK](https://<your_account>.github.io/layout_stars/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_stars/report/html_report/)
- [DEMO LINK](https://VitaliiShc.github.io/layout_stars/)
- [TEST REPORT LINK](https://VitaliiShc.github.io/layout_stars/report/html_report/)

❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it.

- [ ] Yellow stars are added with container modifier + pseudo-selector (NO extra classes)
- [ ] Each BEM block has its own separate file
- [ ] All `Typical Mistakes` from `BEM` lesson theory are checked.
- [ ] Code follows all the [Code Style Rules ❗️](./checklist.md)
- [x] Yellow stars are added with container modifier + pseudo-selector (NO extra classes)
- [x] Each BEM block has its own separate file
- [x] All `Typical Mistakes` from `BEM` lesson theory are checked.
- [x] Code follows all the [Code Style Rules ❗️](./checklist.md)
4 changes: 4 additions & 0 deletions src/body.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body {

Choose a reason for hiding this comment

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

change the name of the file - reset.css, instead body.css
This file will reset the properties and nothing more

margin: 0;
padding: 0;
}
49 changes: 48 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,54 @@
href="./style.css"
/>
</head>

<body>
<h1>Stars</h1>
<ul class="stars stars--0">
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
</ul>

<ul class="stars stars--1">
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
</ul>

<ul class="stars stars--2">
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
</ul>

<ul class="stars stars--3">
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
</ul>

<ul class="stars stars--4">
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
</ul>

<ul class="stars stars--5">
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
<li class="stars__star"></li>
</ul>
</body>
</html>
43 changes: 43 additions & 0 deletions src/stars.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.stars {
display: flex;
margin: 0;
padding-left: 0;

Choose a reason for hiding this comment

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

u can make it above, for example:

body,
ul {
  margin: 0;
  padding: 0;
}
Suggested change
margin: 0;
padding-left: 0;

But up to u)

list-style-type: none;
justify-content: flex-start;
width: fit-content;
}

.stars__star {
display: flex;
background: url(./images/star.svg) center no-repeat;
height: 16px;
width: 16px;
}

.stars__star:not(:last-child) {
margin-right: 4px;
}

.stars--0 :nth-child(-n + 0) {
background-image: url(./images/star-active.svg);
}

.stars--1 :nth-child(-n + 1) {
background-image: url(./images/star-active.svg);
}

.stars--2 :nth-child(-n + 2) {
background-image: url(./images/star-active.svg);
}

.stars--3 :nth-child(-n + 3) {
background-image: url(./images/star-active.svg);
}

.stars--4 :nth-child(-n + 4) {
background-image: url(./images/star-active.svg);
}

.stars--5 :nth-child(-n + 5) {
background-image: url(./images/star-active.svg);
}

Choose a reason for hiding this comment

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

u can make it easier

Suggested change
.stars__star:not(:last-child) {
margin-right: 4px;
}
.stars--0 :nth-child(-n + 0) {
background-image: url(./images/star-active.svg);
}
.stars--1 :nth-child(-n + 1) {
background-image: url(./images/star-active.svg);
}
.stars--2 :nth-child(-n + 2) {
background-image: url(./images/star-active.svg);
}
.stars--3 :nth-child(-n + 3) {
background-image: url(./images/star-active.svg);
}
.stars--4 :nth-child(-n + 4) {
background-image: url(./images/star-active.svg);
}
.stars--5 :nth-child(-n + 5) {
background-image: url(./images/star-active.svg);
}
.stars--1 :nth-child(1),
.stars--2 :nth-child(-n + 2),
.stars--3 :nth-child(-n + 3),
.stars--4 :nth-child(-n + 4),
.stars--5 :nth-child(-n + 5) {
background-image: url(images/star-active.svg);
}

3 changes: 2 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/* add styles here */
@import 'body.css';
@import 'stars.css';
Loading