Skip to content

Commit

Permalink
refactored styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Julia committed Oct 22, 2024
1 parent 80c2217 commit 08575f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/>
</head>
<body>
<div class="stars starts--0">
<div class="stars stars--0">
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
Expand Down
16 changes: 8 additions & 8 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ body {
height: 16px;
background-position: center;
background-repeat: no-repeat;
background-image: url('images/star.svg');
background-image: url(./images/star.svg);
}

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

.stars--0:nth-child(1),
.stars--1:nth-child(-n + 2),
.stars--2:nth-child(-n + 3),
.stars--3:nth-child(-n + 4),
.stars--4:nth-child(-n + 5),
.stars--5:nth-child(-n + 6) {
background-image: url(images/star-active.svg);
.stars--0 .stars__star:nth-child(-n + 0),
.stars--1 .stars__star:nth-child(-n + 1),
.stars--2 .stars__star:nth-child(-n + 2),
.stars--3 .stars__star:nth-child(-n + 3),
.stars--4 .stars__star:nth-child(-n + 4),
.stars--5 .stars__star:nth-child(-n + 5) {
background-image: url(./images/star-active.svg); /* Активная звезда */
}

0 comments on commit 08575f4

Please sign in to comment.