Skip to content

Commit 62ca346

Browse files
fix css
1 parent 953ea9b commit 62ca346

27 files changed

Lines changed: 256 additions & 81 deletions

src/cart.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ <h2 class="not-found__title">No Products Found</h2>
4040
different keywords.
4141
</p>
4242
</div>
43+
<button class="scroll-top-btn" aria-label="Scroll to top">
44+
&#8679;
45+
</button>
4346
</main>
4447

4548
<aside class="sidebar">

src/css/base.css

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
:root {
2-
/* font-family: Inter, Avenir, Helvetica, Arial, sans-serif; */
3-
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
4-
Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
2+
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
53
font-size: 16px;
6-
line-height: 1.5;
4+
line-height: 24px;
75
font-weight: 400;
86

9-
color: #242424;
10-
background-color: rgba(255, 255, 255, 0.87);
11-
127
font-synthesis: none;
138
text-rendering: optimizeLegibility;
149
-webkit-font-smoothing: antialiased;
1510
-moz-osx-font-smoothing: grayscale;
1611
-webkit-text-size-adjust: 100%;
12+
--primary-text-color: #121212;
13+
--secondary-text-color: #555555;
14+
--bg-color: #ffffff;
15+
--card-bg-color: #f9f9f9;
16+
--border-color: #e0e0e0;
17+
--accent-color: #ff6b0a;
18+
19+
[data-theme='dark'] {
20+
--primary-text-color: #ffffff;
21+
--secondary-text-color: #adadad;
22+
--bg-color: #121212;
23+
--card-bg-color: #1e1e1e;
24+
--border-color: #333333;
25+
--accent-color: #ff6b0a;
26+
}
27+
}
28+
29+
body {
30+
background-color: var(--bg-color);
31+
color: var(--primary-text-color);
32+
transition: background-color 0.3s, color 0.3s;
1733
}

src/css/cart.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010

1111
padding: 1.5rem;
1212

13-
background: #fff;
13+
background-color: var(--card-bg-color);
14+
border: 1px solid var(--border-color);
1415
border-radius: 12px;
1516
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
17+
color: var(--primary-text-color);
18+
transition: background-color 0.3s, color 0.3s, border-color 0.3s;
1619
}
1720

1821
.cart-summary__inner {
@@ -87,9 +90,7 @@
8790
}
8891

8992
.cart-summary__hint {
90-
margin: 1rem 0;
91-
92-
color: #94a3b8;
93+
color: var(--primary-text-color);
9394
font-size: 0.9rem;
9495
text-align: center;
9596
}

src/css/categories.css

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
.categories__item {
1010
list-style: none;
11-
transition: transform 0.2s ease;
11+
transition: transform 0.3s ease;
1212

1313
&:hover {
1414
transform: translateY(-2px);
@@ -18,14 +18,14 @@
1818
.categories__btn {
1919
padding: 0.8rem 1.5rem;
2020

21-
color: #2d3748;
21+
color: var(--primary-text-color);
2222
font-size: 0.9rem;
2323
font-weight: 500;
2424
letter-spacing: 0.5px;
2525
text-transform: uppercase;
2626

27-
background: #fff;
28-
border: 2px solid #e2e8f0;
27+
background-color: var(--card-bg-color);
28+
border: 1px solid var(--border-color);
2929
border-radius: 25px;
3030
cursor: pointer;
3131
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
@@ -53,3 +53,8 @@
5353
border-color: #ff6b0a;
5454
}
5555
}
56+
57+
[data-theme='dark'] .categories__btn--active {
58+
background-color: var(--accent-color);
59+
color: white;
60+
}

src/css/container.css

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
/* Styles for Mobile devices */
21
.container {
32
max-width: 375px;
43
margin: 0 auto;
54
padding: 0 16px;
65
}
7-
/* Styles for Tablet devices */
6+
87
@media only screen and (min-width: 768px) {
98
.container {
109
max-width: 768px;
1110
}
1211
}
13-
/* Styles for Desktop devices */
12+
1413
@media only screen and (min-width: 1200px) {
1514
.container {
16-
max-width: 1200px;
15+
max-width: 1280px;
1716
padding: 0 32px;
1817
}
1918
}

src/css/header.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
.header {
22
padding: 20px 0;
33

4+
background-color: var(--card-bg-color);
5+
border-bottom: 1px solid var(--border-color);
6+
transition: background-color 0.3s, border-color 0.3s;
47
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
58
}
69
.header__container {
@@ -29,9 +32,10 @@
2932
align-items: center;
3033
gap: 5px;
3134

35+
color: var(--primary-text-color);
36+
transition: color 0.3s;
3237
font-weight: 500;
3338
letter-spacing: 0.02em;
34-
transition: 200ms ease-in;
3539

3640
&:hover,
3741
&:focus {
@@ -59,6 +63,10 @@
5963
}
6064
}
6165

66+
[data-theme='dark'] .nav__link--active {
67+
color: var(--accent-color);
68+
}
69+
6270
.nav__count {
6371
padding: 0.2rem 0.6rem;
6472

@@ -69,7 +77,7 @@
6977
border: 1px solid #ff6b0a;
7078
border-radius: 15px;
7179
background: #fff;
72-
transition: 200ms ease-in;
80+
transition: 0.3s ease-in;
7381

7482
.nav__link:hover &,
7583
.nav__link:focus &,

src/css/helpers.css

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
.scroll-top-btn {
2+
position: fixed;
3+
bottom: 20px;
4+
right: 20px;
5+
width: 50px;
6+
height: 50px;
7+
background-color: #ff6b0a;
8+
color: white;
9+
border: none;
10+
border-radius: 50%;
11+
font-size: 24px;
12+
cursor: pointer;
13+
display: flex;
14+
justify-content: center;
15+
align-items: center;
16+
opacity: 0;
17+
visibility: hidden;
18+
transition: opacity 0.3s, visibility 0.3s;
19+
z-index: 100;
20+
}
21+
22+
.scroll-top-btn--visible {
23+
opacity: 1;
24+
visibility: visible;
25+
}
26+
27+
.scroll-top-btn:hover {
28+
background-color: #e55a00;
29+
}
30+
31+
.theme-toggle-btn {
32+
position: absolute;
33+
top: 20px;
34+
right: 20px;
35+
width: 40px;
36+
height: 40px;
37+
background-color: transparent;
38+
border: 2px solid #ff6b0a;
39+
border-radius: 50%;
40+
font-size: 20px;
41+
cursor: pointer;
42+
display: flex;
43+
justify-content: center;
44+
align-items: center;
45+
z-index: 10;
46+
transition: background-color 0.3s;
47+
}
48+
49+
.theme-toggle-btn:hover {
50+
background-color: rgba(255, 107, 10, 0.1);
51+
}
52+
53+
[data-theme='dark'] a {
54+
color: var(--accent-color);
55+
}
56+
57+
[data-theme='dark'] button {
58+
color: var(--primary-text-color);
59+
}
60+
61+
[data-theme='dark'] svg {
62+
color: var(--primary-text-color);
63+
}
64+
65+
.load-more-btn {
66+
display: block;
67+
margin: 30px auto 0;
68+
padding: 12px 24px;
69+
background-color: var(--accent-color);
70+
color: white;
71+
border: none;
72+
border-radius: 4px;
73+
font-size: 16px;
74+
font-weight: 600;
75+
cursor: pointer;
76+
transition: background-color 0.3s, transform 0.3s;
77+
}
78+
79+
.load-more-btn:hover {
80+
background-color: #e55a00;
81+
transform: translateY(-2px);
82+
}
83+
84+
.load-more-btn:active {
85+
transform: translateY(0);
86+
}
87+
88+
[data-theme='dark'] .load-more-btn {
89+
background-color: var(--accent-color);
90+
color: white;
91+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
92+
}
93+
94+
.load-more-btn.is-loading {
95+
position: relative;
96+
color: transparent;
97+
pointer-events: none;
98+
}
99+
100+
.load-more-btn.is-loading::after {
101+
content: '';
102+
position: absolute;
103+
top: 50%;
104+
left: 50%;
105+
width: 20px;
106+
height: 20px;
107+
margin: -10px 0 0 -10px;
108+
border: 2px solid rgba(255, 255, 255, 0.2);
109+
border-top-color: white;
110+
border-radius: 50%;
111+
animation: spin 0.8s linear infinite;
112+
}
113+
114+
.load-more-btn.is-hidden {
115+
display: none;
116+
}

0 commit comments

Comments
 (0)