-
Notifications
You must be signed in to change notification settings - Fork 5.2k
created a grid #6295
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
base: master
Are you sure you want to change the base?
created a grid #6295
Changes from all commits
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 |
|---|---|---|
|
|
@@ -22,6 +22,131 @@ | |
| </head> | ||
|
|
||
| <body> | ||
| <h1>Catalog</h1> | ||
| <header class="header"> | ||
| <a | ||
| href="#" | ||
| class="header__logo-link" | ||
| > | ||
| <img | ||
| src="./images/logo.png" | ||
| alt="Moyo logo" | ||
| class="header__logo-img" | ||
| /> | ||
| </a> | ||
|
|
||
| <nav class="nav"> | ||
| <ul class="nav__list"> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="#apple" | ||
| class="nav__link is-active" | ||
| > | ||
| Apple | ||
| </a> | ||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="#samsung" | ||
| class="nav__link" | ||
| > | ||
| Samsung | ||
| </a> | ||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="#smartphones" | ||
| class="nav__link" | ||
| > | ||
| Smartphones | ||
| </a> | ||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="#laptops" | ||
| class="nav__link" | ||
| data-qa="nav-hover" | ||
| > | ||
| Laptops & Computers | ||
| </a> | ||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="#gadgets" | ||
| class="nav__link" | ||
| > | ||
| Gadgets | ||
| </a> | ||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="#tablets" | ||
| class="nav__link" | ||
| > | ||
| Tablets | ||
| </a> | ||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="#photo" | ||
| class="nav__link" | ||
| > | ||
| Photo | ||
| </a> | ||
|
Comment on lines
24
to
+94
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. This violates checklist item #2: "Repeated sizes and special colors are put to variables" because header colors are still hard-coded (e.g., |
||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="#video" | ||
| class="nav__link" | ||
| > | ||
| Video | ||
| </a> | ||
| </li> | ||
| </ul> | ||
| </nav> | ||
| </header> | ||
|
|
||
| <main class="cards-container"> | ||
| <div | ||
| class="card" | ||
| data-qa="card" | ||
| > | ||
| <img | ||
| class="card__image" | ||
| src="images/imac.jpeg" | ||
| alt="iMac A1419" | ||
| /> | ||
|
|
||
| <h2 class="card__title"> | ||
| APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) | ||
| </h2> | ||
|
|
||
| <div class="card__code">Product code: 195434</div> | ||
|
|
||
| <div class="card__review-container"> | ||
| <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__review-count">Reviews: 5</div> | ||
| </div> | ||
|
|
||
| <div class="card__price-container"> | ||
| <div class="card__price-label">Price:</div> | ||
| <div class="card__price">$2,199</div> | ||
| </div> | ||
|
|
||
| <a | ||
| class="card__buy" | ||
| href="#" | ||
| data-qa="card-hover" | ||
| > | ||
| Buy | ||
| </a> | ||
| </div> | ||
| </main> | ||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| @use 'variables' as *; | ||
|
|
||
| .card { | ||
| box-sizing: border-box; | ||
| width: $card-width; | ||
| border: 1px solid $color-border; | ||
| border-radius: 5px; | ||
| padding: 32px 16px 16px; | ||
| background: $color-white; | ||
| transition: transform $transition-duration; | ||
|
|
||
| &:hover { | ||
| transform: scale(1.2); | ||
| } | ||
|
|
||
| &__image { | ||
| display: block; | ||
| margin: 0 auto 40px; | ||
| width: 160px; | ||
| height: 134px; | ||
| } | ||
|
|
||
| &__title { | ||
| margin: 0 0 4px; | ||
| font-size: 12px; | ||
| line-height: 18px; | ||
| font-weight: 500; | ||
| color: $color-text-accent; | ||
| transition: color $transition-duration; | ||
|
|
||
| .card:hover & { | ||
| color: $color-title-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. This violates checklist item "All components follow BEM and use SCSS" because |
||
| } | ||
|
|
||
| &__code { | ||
| margin-bottom: 16px; | ||
| } | ||
|
|
||
| &__review-container { | ||
| display: flex; | ||
| justify-content: space-between; | ||
| align-items: flex-end; | ||
| margin-bottom: 24px; | ||
| } | ||
|
|
||
| &__review-count { | ||
| color: $color-text-accent; | ||
| } | ||
|
|
||
| &__price-container { | ||
| display: flex; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
| margin-bottom: 16px; | ||
| } | ||
|
|
||
| &__price-label { | ||
| font-size: 12px; | ||
| line-height: 18px; | ||
| } | ||
|
|
||
| &__price { | ||
| font-size: 16px; | ||
| line-height: 18px; | ||
| font-weight: bold; | ||
| color: $color-text-accent; | ||
| } | ||
|
|
||
| &__buy { | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| box-sizing: border-box; | ||
| height: 40px; | ||
| border: 1px solid $color-main; | ||
| border-radius: 5px; | ||
| font-size: 14px; | ||
| line-height: 16px; | ||
| font-weight: 700; | ||
| color: $color-white; | ||
| text-decoration: none; | ||
| text-transform: uppercase; | ||
| background-color: $color-main; | ||
| transition: | ||
| color $transition-duration, background-color $transition-duration; | ||
|
|
||
| &:hover { | ||
| color: $color-main; | ||
| background-color: $color-white; | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| @use 'variables' as *; | ||
|
|
||
| .cards-container { | ||
| display: grid; | ||
| grid-template-columns: $card-width; | ||
| justify-content: center; | ||
| gap: $gap-vertical $gap-horizontal; | ||
| padding: $container-padding-vertical $container-padding-horizontal; | ||
| max-width: calc(#{$card-width} * 4 + #{$gap-horizontal} * 3 + #{$container-padding-horizontal} * 2); | ||
| margin: 0 auto; | ||
| } | ||
|
|
||
| @media (min-width: 488px) { | ||
| .cards-container { | ||
| grid-template-columns: repeat(2, $card-width); | ||
| } | ||
| } | ||
|
|
||
| @media (min-width: 768px) { | ||
| .cards-container { | ||
| grid-template-columns: repeat(3, $card-width); | ||
| } | ||
| } | ||
|
|
||
|
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. This violates checklist item #2: "Repeated sizes and special colors are put to variables" because |
||
| @media (min-width: 1024px) { | ||
|
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. This violates the checklist point "Repeated sizes and special colors are put to variables" because you hard-code |
||
| .cards-container { | ||
| grid-template-columns: repeat(4, $card-width); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| :root { | ||
| --primary-blue: #00acdc; | ||
|
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. Defining |
||
| } | ||
|
|
||
| body { | ||
| margin: 0; | ||
| } | ||
|
|
||
| ul { | ||
|
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. This violates checklist item "Repeated sizes and special colors are put to variables" — card background |
||
| margin: 0; | ||
| padding: 0; | ||
| list-style: none; | ||
| } | ||
|
|
||
| .header { | ||
| display: flex; | ||
| align-items: center; | ||
|
|
||
| padding: 0 50px; | ||
|
|
||
| height: 60px; | ||
| box-sizing: border-box; | ||
|
|
||
| background-color: #fff; | ||
|
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. This still hard-codes |
||
| justify-content: space-between; | ||
| box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); | ||
| } | ||
|
|
||
| .header__logo-link { | ||
| display: block; | ||
| height: 40px; | ||
| width: 40px; | ||
|
Comment on lines
+31
to
+32
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. This violates checklist item "Repeated sizes and special colors are put to variables" — you already have |
||
| } | ||
|
Comment on lines
+30
to
+33
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. This violates checklist item "All components follow BEM and use SCSS" — the |
||
|
|
||
| .header__logo-img { | ||
| display: block; | ||
| height: 40px; | ||
| width: 40px; | ||
| } | ||
|
|
||
| .nav__list { | ||
| display: flex; | ||
| padding: 0; | ||
| margin: 0; | ||
| align-items: center; | ||
| list-style: none; | ||
| } | ||
|
|
||
| .nav__link { | ||
| display: flex; | ||
| align-items: center; | ||
| height: 60px; | ||
|
|
||
| color: #060b35; | ||
|
|
||
| position: relative; | ||
| font-size: 12px; | ||
| font-weight: 500; | ||
| line-height: 100%; | ||
| transition: color 0.3s; | ||
| white-space: nowrap; | ||
| text-decoration: none; | ||
| text-transform: uppercase; | ||
| font-family: Roboto, sans-serif; | ||
| } | ||
|
|
||
| .nav { | ||
| display: flex; | ||
| } | ||
|
|
||
| .nav__item { | ||
| margin-left: 20px; | ||
| } | ||
|
|
||
| .nav__item:first-child { | ||
| margin-left: 0; | ||
| } | ||
|
|
||
| .nav__link.is-active { | ||
| color: var(--primary-blue); | ||
| } | ||
|
|
||
| .nav__link.is-active::after { | ||
| content: ''; | ||
| position: absolute; | ||
| bottom: 0; | ||
| width: 100%; | ||
| height: 4px; | ||
| border-radius: 2px; | ||
| background-color: var(--primary-blue); | ||
| } | ||
|
|
||
| .nav__link:hover { | ||
| color: var(--primary-blue); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| .stars { | ||
| display: flex; | ||
|
|
||
| &__star { | ||
| width: 16px; | ||
| height: 16px; | ||
| margin-right: 4px; | ||
| background-image: url('../images/star.svg'); | ||
| background-repeat: no-repeat; | ||
|
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. This violates checklist item "Repeated sizes and special colors are put to variables" — card background |
||
| background-position: center; | ||
|
|
||
| &:last-child { | ||
|
Comment on lines
+4
to
+12
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. This violates checklist item "Repeated sizes and special colors are put to variables" — sizes like |
||
| margin-right: 0; | ||
| } | ||
| } | ||
|
|
||
| @for $i from 1 through 5 { | ||
| &--#{$i} &__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 comment
The reason will be displayed to describe this comment to others. Learn more.
This violates checklist item "Repeated sizes and special colors are put to variables" —
color: #34568b;is a hard-coded special color already defined as$color-title-hoverin_variables.scss, so this should use that variable instead of the literal value.