diff --git a/readme.md b/readme.md index cf0977c416..b7e1561240 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ Create HTML page with catalog. Develop semantic page structure as shown on [the - add `data-qa="card-hover"` (not just `hover`) to the link `Buy` inside the first card - nav links color is not `black` any more (nav links should have `#060b35` color) - add class `is-active` to the first link (`Apple`) in navigation -- use `
` tag for cards container +- use `
` tag for cards container - use grid for cards with different number of columns: - 1 for the smaller screens - 2 starting at `488px` @@ -32,8 +32,8 @@ Make all the changes smooth on hover (during 300ms): ## Checklist ❗️ Replace `` with your Github username and copy the links to `Pull Request` description: -- [DEMO LINK](https://.github.io/layout_catalog/) -- [TEST REPORT LINK](https://.github.io/layout_catalog/report/html_report/) +- [DEMO LINK](https://staner1.github.io/layout_catalog/) +- [TEST REPORT LINK](https://staner1.github.io/layout_catalog/report/html_report/) ❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it. diff --git a/src/styles/blocks/card.scss b/src/styles/blocks/card.scss index 1d64aea705..e56a6a0982 100644 --- a/src/styles/blocks/card.scss +++ b/src/styles/blocks/card.scss @@ -24,13 +24,14 @@ gap: 4px; &-title { - font-size: 12px; + font-size: $font-size-standart; font-weight: 500; line-height: 18px; + color: $black; } &-subtitle { - font-size: 10px; + font-size: $font-size-small; color: $gray; font-weight: 400; line-height: 14px; @@ -38,27 +39,28 @@ } &__review { - width: 100%; + width: $width-100-perc; margin-bottom: 24px; display: flex; justify-content: space-between; &-label { - font-size: 10px; + font-size: $font-size-small; line-height: 16px; + color: $black; } } &__price { margin-bottom: 16px; - width: 100%; + width: $width-100-perc; height: 18px; display: flex; justify-content: space-between; align-items: center; &-label { - font-size: 12px; + font-size: $font-size-standart; font-weight: 400; color: $gray; } @@ -67,13 +69,14 @@ font-size: 16px; font-weight: 700; line-height: 18px; + color: $black; } } &__button { text-decoration: none; - width: 100%; + width: $width-100-perc; height: 40px; background-color: $turquoise; border-radius: 5px; diff --git a/src/styles/blocks/main.scss b/src/styles/blocks/main.scss index 9acb6e4889..51bf398ac4 100644 --- a/src/styles/blocks/main.scss +++ b/src/styles/blocks/main.scss @@ -3,18 +3,7 @@ display: grid; justify-content: center; - grid-template-columns: repeat(1, 200px); - gap: 46px 48px; - - @media (min-width: 488px) { - grid-template-columns: repeat(2, 200px); - } + @include content-grid-columns; - @media (min-width: 768px) { - grid-template-columns: repeat(3, 200px); - } - - @media (min-width: 1024px) { - grid-template-columns: repeat(4, 200px); - } + gap: 46px 48px; } diff --git a/src/styles/blocks/modifiers.scss b/src/styles/blocks/modifiers.scss index 9421ee2236..a94c772161 100644 --- a/src/styles/blocks/modifiers.scss +++ b/src/styles/blocks/modifiers.scss @@ -10,7 +10,7 @@ content: ''; position: absolute; bottom: 0; - width: 100%; + width: $width-100-perc; height: 4px; background-color: $turquoise; border-radius: 8px; @@ -20,6 +20,10 @@ transform: scale(1.2); } +.card:hover .card__text-title { + color: $blue-black; +} + .stars--4 .stars__star:nth-child(-n + 4) { background-image: url(../images/star-active.svg); background-repeat: no-repeat; diff --git a/src/styles/blocks/nav.scss b/src/styles/blocks/nav.scss index 6f33b50f12..a09f2450bb 100644 --- a/src/styles/blocks/nav.scss +++ b/src/styles/blocks/nav.scss @@ -7,12 +7,11 @@ } &__item { - position: relative; text-decoration: none; list-style-type: none; margin-right: 20px; - font-size: 12px; + font-size: $font-size-standart; font-weight: 500; &:last-child { diff --git a/src/styles/index.scss b/src/styles/index.scss index a7037fce2a..f4f8b00cb3 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,4 @@ +@import './utils/mixins'; @import './utils/variables'; @import './blocks/modifiers'; @import './blocks/page'; diff --git a/src/styles/utils/mixins.scss b/src/styles/utils/mixins.scss new file mode 100644 index 0000000000..d4c977a066 --- /dev/null +++ b/src/styles/utils/mixins.scss @@ -0,0 +1,33 @@ +@mixin small() { + @media (min-width: 488px) { + @content; + } +} + +@mixin medium() { + @media (min-width: 768px) { + @content; + } +} + +@mixin large() { + @media (min-width: 1024px) { + @content; + } +} + +@mixin content-grid-columns() { + grid-template-columns: repeat(1, 200px); + + @include small { + grid-template-columns: repeat(2, 200px); + } + + @include medium { + grid-template-columns: repeat(3, 200px); + } + + @include large { + grid-template-columns: repeat(4, 200px); + } +} diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss index ad8ff6c5ec..90a44a35cd 100644 --- a/src/styles/utils/variables.scss +++ b/src/styles/utils/variables.scss @@ -4,3 +4,7 @@ $black: #060b35; $gray-border: #f3f3f3; $gray: #616070; $white: #fff; +$blue-black: #34568b; +$font-size-standart: 12px; +$font-size-small: 10px; +$width-100-perc: 100%;