compostrap 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/dist/css/auth.css +166 -0
  2. package/dist/css/blog.css +512 -0
  3. package/dist/css/chart.css +99 -0
  4. package/dist/css/compostrap.css +5052 -0
  5. package/dist/css/dashboard.css +360 -0
  6. package/dist/css/datagrid.css +64 -0
  7. package/dist/css/datepicker.css +514 -0
  8. package/dist/css/dialogs.css +185 -0
  9. package/dist/css/dropzone.css +86 -0
  10. package/dist/css/elements.css +181 -0
  11. package/dist/css/empty.css +94 -0
  12. package/dist/css/gallery.css +122 -0
  13. package/dist/css/lightbox.css +144 -0
  14. package/dist/css/number-input.css +100 -0
  15. package/dist/css/otp-input.css +177 -0
  16. package/dist/css/password-toggle.css +52 -0
  17. package/dist/css/rating.css +95 -0
  18. package/dist/css/selection.css +59 -0
  19. package/dist/css/settings.css +85 -0
  20. package/dist/css/shop.css +1026 -0
  21. package/dist/css/sidebar-menu.css +439 -0
  22. package/dist/css/sidebar.css +95 -0
  23. package/dist/css/spinner.css +102 -0
  24. package/dist/css/strength.css +118 -0
  25. package/dist/css/theme-switcher.css +5 -0
  26. package/dist/css/theme.css +13034 -0
  27. package/dist/css/tooltip.css +158 -0
  28. package/dist/js/chart.js +257 -0
  29. package/dist/js/datepicker.js +82 -0
  30. package/dist/js/dialogs.js +7 -0
  31. package/dist/js/dropzone.js +15 -0
  32. package/dist/js/index.js +24 -0
  33. package/dist/js/lightbox.js +77 -0
  34. package/dist/js/number-input.js +44 -0
  35. package/dist/js/otp-input.js +182 -0
  36. package/dist/js/password-toggle.js +16 -0
  37. package/dist/js/selection.js +32 -0
  38. package/dist/js/sidebar-menu.js +76 -0
  39. package/dist/js/sidebar.js +120 -0
  40. package/dist/js/spinner.js +27 -0
  41. package/dist/js/strength.js +87 -0
  42. package/dist/js/theme-switcher.js +98 -0
  43. package/dist/js/tooltip.js +17 -0
  44. package/docs/auth.md +25 -0
  45. package/docs/blog.md +85 -0
  46. package/docs/chart.md +39 -0
  47. package/docs/datagrid.md +64 -0
  48. package/docs/datepicker.md +35 -0
  49. package/docs/dialogs.md +81 -0
  50. package/docs/dropzone.md +23 -0
  51. package/docs/elements.md +38 -0
  52. package/docs/empty.md +25 -0
  53. package/docs/gallery.md +23 -0
  54. package/docs/layout.md +143 -0
  55. package/docs/lightbox.md +18 -0
  56. package/docs/number-input.md +19 -0
  57. package/docs/otp-input.md +52 -0
  58. package/docs/password-toggle.md +21 -0
  59. package/docs/rating.md +15 -0
  60. package/docs/selection.md +52 -0
  61. package/docs/settings.md +25 -0
  62. package/docs/shop.md +140 -0
  63. package/docs/spinner.md +51 -0
  64. package/docs/strength.md +26 -0
  65. package/docs/theme-switcher.md +60 -0
  66. package/docs/theme.md +100 -0
  67. package/docs/tooltip.md +30 -0
  68. package/license +21 -0
  69. package/package.json +106 -6
  70. package/readme.md +198 -0
  71. package/src/illustrations/empty.svg +15 -0
  72. package/src/illustrations/forbidden.svg +16 -0
  73. package/src/illustrations/maintenance.svg +14 -0
  74. package/src/illustrations/not-found.svg +22 -0
  75. package/src/illustrations/server-error.svg +21 -0
  76. package/src/js/chart.js +359 -0
  77. package/src/js/datepicker.js +154 -0
  78. package/src/js/dialogs.js +25 -0
  79. package/src/js/dropzone.js +35 -0
  80. package/src/js/index.js +29 -0
  81. package/src/js/lightbox.js +165 -0
  82. package/src/js/number-input.js +87 -0
  83. package/src/js/otp-input.js +401 -0
  84. package/src/js/password-toggle.js +45 -0
  85. package/src/js/selection.js +114 -0
  86. package/src/js/sidebar-menu.js +178 -0
  87. package/src/js/sidebar.js +326 -0
  88. package/src/js/spinner.js +76 -0
  89. package/src/js/strength.js +115 -0
  90. package/src/js/theme-switcher.js +197 -0
  91. package/src/js/tooltip.js +46 -0
  92. package/src/scss/_bootstrap.scss +9 -0
  93. package/src/scss/_variables.scss +58 -0
  94. package/src/scss/auth/_index.scss +210 -0
  95. package/src/scss/auth.scss +5 -0
  96. package/src/scss/blog/_article.scss +181 -0
  97. package/src/scss/blog/_comments.scss +108 -0
  98. package/src/scss/blog/_index.scss +18 -0
  99. package/src/scss/blog/_list.scss +246 -0
  100. package/src/scss/blog/_page.scss +138 -0
  101. package/src/scss/blog.scss +5 -0
  102. package/src/scss/chart/_index.scss +114 -0
  103. package/src/scss/chart.scss +5 -0
  104. package/src/scss/compostrap.scss +29 -0
  105. package/src/scss/dashboard/_content.scss +25 -0
  106. package/src/scss/dashboard/_dropdown.scss +71 -0
  107. package/src/scss/dashboard/_index.scss +9 -0
  108. package/src/scss/dashboard/_nanobar.scss +34 -0
  109. package/src/scss/dashboard/_navbar.scss +314 -0
  110. package/src/scss/dashboard/_theme.scss +27 -0
  111. package/src/scss/dashboard.scss +5 -0
  112. package/src/scss/datagrid/_index.scss +111 -0
  113. package/src/scss/datagrid.scss +5 -0
  114. package/src/scss/datepicker/_index.scss +557 -0
  115. package/src/scss/datepicker.scss +5 -0
  116. package/src/scss/dialogs/_index.scss +8 -0
  117. package/src/scss/dialogs/_modal.scss +82 -0
  118. package/src/scss/dialogs/_offcanvas.scss +13 -0
  119. package/src/scss/dialogs/_search.scss +79 -0
  120. package/src/scss/dialogs/_toast.scss +61 -0
  121. package/src/scss/dialogs.scss +5 -0
  122. package/src/scss/dropzone/_index.scss +111 -0
  123. package/src/scss/dropzone.scss +5 -0
  124. package/src/scss/elements/_datagrid-filter.scss +21 -0
  125. package/src/scss/elements/_index.scss +9 -0
  126. package/src/scss/elements/_list-row.scss +40 -0
  127. package/src/scss/elements/_loading.scss +47 -0
  128. package/src/scss/elements/_stat.scss +73 -0
  129. package/src/scss/elements/_status-dot.scss +38 -0
  130. package/src/scss/elements.scss +5 -0
  131. package/src/scss/empty/_index.scss +117 -0
  132. package/src/scss/empty.scss +5 -0
  133. package/src/scss/gallery/_index.scss +162 -0
  134. package/src/scss/gallery.scss +5 -0
  135. package/src/scss/lightbox/_index.scss +171 -0
  136. package/src/scss/lightbox.scss +5 -0
  137. package/src/scss/number-input/_index.scss +143 -0
  138. package/src/scss/number-input.scss +5 -0
  139. package/src/scss/otp-input/_index.scss +214 -0
  140. package/src/scss/otp-input.scss +5 -0
  141. package/src/scss/password-toggle/_index.scss +82 -0
  142. package/src/scss/password-toggle.scss +5 -0
  143. package/src/scss/rating/_index.scss +121 -0
  144. package/src/scss/rating.scss +5 -0
  145. package/src/scss/selection/_index.scss +84 -0
  146. package/src/scss/selection.scss +5 -0
  147. package/src/scss/settings/_index.scss +6 -0
  148. package/src/scss/settings/_nav-list.scss +52 -0
  149. package/src/scss/settings/_setting-row.scss +50 -0
  150. package/src/scss/settings.scss +5 -0
  151. package/src/scss/shop/_bar.scss +64 -0
  152. package/src/scss/shop/_catalog.scss +308 -0
  153. package/src/scss/shop/_checkout.scss +204 -0
  154. package/src/scss/shop/_filters.scss +116 -0
  155. package/src/scss/shop/_hero.scss +130 -0
  156. package/src/scss/shop/_index.scss +22 -0
  157. package/src/scss/shop/_page.scss +154 -0
  158. package/src/scss/shop/_reviews.scss +165 -0
  159. package/src/scss/shop/_stepper.scss +159 -0
  160. package/src/scss/shop.scss +5 -0
  161. package/src/scss/sidebar/_body.scss +8 -0
  162. package/src/scss/sidebar/_index.scss +8 -0
  163. package/src/scss/sidebar/_sidebar.scss +89 -0
  164. package/src/scss/sidebar/_theme.scss +7 -0
  165. package/src/scss/sidebar/_wrapper.scss +17 -0
  166. package/src/scss/sidebar-menu/_compact.scss +174 -0
  167. package/src/scss/sidebar-menu/_index.scss +9 -0
  168. package/src/scss/sidebar-menu/_list.scss +131 -0
  169. package/src/scss/sidebar-menu/_pills.scss +82 -0
  170. package/src/scss/sidebar-menu/_scrollbar.scss +53 -0
  171. package/src/scss/sidebar-menu/_theme.scss +109 -0
  172. package/src/scss/sidebar-menu.scss +5 -0
  173. package/src/scss/sidebar.scss +5 -0
  174. package/src/scss/spinner/_index.scss +130 -0
  175. package/src/scss/spinner.scss +5 -0
  176. package/src/scss/strength/_index.scss +118 -0
  177. package/src/scss/strength.scss +5 -0
  178. package/src/scss/theme/_accordion.scss +20 -0
  179. package/src/scss/theme/_alerts.scss +24 -0
  180. package/src/scss/theme/_avatar.scss +37 -0
  181. package/src/scss/theme/_badges.scss +53 -0
  182. package/src/scss/theme/_base.scss +9 -0
  183. package/src/scss/theme/_breadcrumb.scss +64 -0
  184. package/src/scss/theme/_buttons.scss +200 -0
  185. package/src/scss/theme/_cards.scss +17 -0
  186. package/src/scss/theme/_colors.scss +139 -0
  187. package/src/scss/theme/_forms.scss +175 -0
  188. package/src/scss/theme/_index.scss +18 -0
  189. package/src/scss/theme/_navs.scss +15 -0
  190. package/src/scss/theme/_overlays.scss +128 -0
  191. package/src/scss/theme/_tables.scss +59 -0
  192. package/src/scss/theme/_variables.scss +194 -0
  193. package/src/scss/theme-switcher/_index.scss +9 -0
  194. package/src/scss/theme-switcher.scss +5 -0
  195. package/src/scss/theme.scss +9 -0
  196. package/src/scss/tooltip/_index.scss +177 -0
  197. package/src/scss/tooltip.scss +5 -0
  198. package/README.md +0 -3
@@ -0,0 +1,64 @@
1
+ //
2
+ // shop: the bar at the bottom of a phone with the total and the button to go on, so the button is not far below the
3
+ // content. From large screens it is hidden, the summary card (.shop-summary) with its own button is in view there.
4
+ //
5
+ // <div class="shop-bar">
6
+ // <div class="shop-bar-total"><span class="shop-bar-label">Total to pay</span><span class="shop-bar-sum">$1,404</span></div>
7
+ // <a class="btn btn-primary" href="...">Continue with order</a>
8
+ // </div>
9
+ //
10
+ // The button of the summary card gets `d-none d-lg-block`, so the page has one button at a time. The page leaves room
11
+ // under its footer for the bar.
12
+ //
13
+
14
+ @use '../bootstrap' as bs;
15
+
16
+ .shop-bar {
17
+ position: fixed;
18
+ right: 0;
19
+ bottom: 0;
20
+ left: 0;
21
+ z-index: 20;
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: space-between;
25
+ gap: 1rem;
26
+ padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
27
+ background-color: var(--shop-surface-bg);
28
+ box-shadow: 0 -4px 12px -6px rgba(0, 0, 0, .18);
29
+
30
+ .btn {
31
+ flex: 0 1 auto;
32
+ white-space: nowrap;
33
+ }
34
+ }
35
+
36
+ .shop-bar-total {
37
+ display: flex;
38
+ flex-direction: column;
39
+ min-width: 0;
40
+ line-height: 1.25;
41
+ }
42
+
43
+ .shop-bar-label {
44
+ color: var(--bs-secondary-color);
45
+ }
46
+
47
+ .shop-bar-sum {
48
+ font-size: 1.125rem;
49
+ font-weight: 600;
50
+ }
51
+
52
+ .shop-page:has(.shop-bar) {
53
+ padding-bottom: 4.75rem;
54
+ }
55
+
56
+ @include bs.media-breakpoint-up(lg) {
57
+ .shop-bar {
58
+ display: none;
59
+ }
60
+
61
+ .shop-page:has(.shop-bar) {
62
+ padding-bottom: 0;
63
+ }
64
+ }
@@ -0,0 +1,308 @@
1
+ //
2
+ // shop: the product list and the product detail
3
+ //
4
+ // <article class="shop-product">
5
+ // <a class="shop-product-image" href="..."><img src="..." alt=""><span class="badge theme-danger shop-product-badge">-15%</span></a>
6
+ // <div class="shop-product-body">
7
+ // <div class="shop-product-rating"><span class="rating-static rating-sm" style="--rating-value: 4.8"></span> 4.8 <a href="...">24×</a></div>
8
+ // <h2 class="shop-product-title"><a href="...">Name</a></h2>
9
+ // <p class="shop-product-text">Excerpt</p>
10
+ // <div class="shop-product-footer">
11
+ // <div class="shop-product-buy"><div class="shop-product-prices"><span class="shop-price">$934</span>
12
+ // <span class="shop-price-old">$1,099</span></div><button class="btn btn-primary btn-sm">Add to cart</button></div>
13
+ // <p class="shop-stock text-success">In stock</p></div></div>
14
+ // </article>
15
+ //
16
+
17
+ @use '../bootstrap' as bs;
18
+ @use '../variables' as var;
19
+
20
+ // the order of the product list (recommended, cheapest, …): links as tabs in one row, which scrolls on a phone
21
+ // <nav class="shop-sort" aria-label="Sort products"><ul class="nav nav-tabs">
22
+ // <li class="nav-item"><a class="nav-link active" href="..." aria-current="true">Recommended</a></li>
23
+ // </ul></nav>
24
+ .shop-sort {
25
+ margin-bottom: 1rem;
26
+
27
+ .nav {
28
+ flex-wrap: nowrap;
29
+ overflow-x: auto;
30
+ white-space: nowrap;
31
+ scrollbar-width: none;
32
+ }
33
+ }
34
+
35
+ // the box over the tiles: the chosen filters (.shop-filter-chips) and under them the order of the list (.shop-sort).
36
+ // The tabs of the order stand on the bottom edge of the box: no frames, the current one has a line under it
37
+ // <div class="shop-toolbar"><div class="shop-filter-chips">…</div><nav class="shop-sort">…</nav></div>
38
+ .shop-toolbar {
39
+ padding: .75rem 1rem 0;
40
+ margin-bottom: 1rem;
41
+ background-color: var(--shop-surface-bg);
42
+ border: var.$surface-border;
43
+ border-radius: var(--bs-border-radius-lg);
44
+
45
+ .shop-filter-chips {
46
+ margin-bottom: .25rem;
47
+ }
48
+
49
+ .shop-sort {
50
+ margin-bottom: 0;
51
+ }
52
+
53
+ .nav-tabs {
54
+ gap: .25rem;
55
+ border-bottom: 0;
56
+ }
57
+
58
+ .nav-tabs .nav-link {
59
+ padding: .625rem .75rem;
60
+ margin-bottom: 0;
61
+ border: 0;
62
+ border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
63
+
64
+ &.active {
65
+ font-weight: 500;
66
+ color: var(--bs-primary);
67
+ background-color: transparent;
68
+ box-shadow: inset 0 -2px 0 var(--bs-primary);
69
+ }
70
+ }
71
+ }
72
+
73
+ .shop-product {
74
+ display: flex;
75
+ flex-direction: column;
76
+ height: 100%;
77
+ overflow: hidden;
78
+ background-color: var(--shop-surface-bg);
79
+ border: var.$surface-border;
80
+ border-radius: var(--bs-border-radius-lg);
81
+ }
82
+
83
+ .shop-product-image {
84
+ position: relative;
85
+ display: flex;
86
+ align-items: center;
87
+ justify-content: center;
88
+ aspect-ratio: 4 / 3;
89
+ padding: 1rem 1rem 0;
90
+
91
+ // the whole photo, centered in the area (never cropped)
92
+ > img {
93
+ max-width: 100%;
94
+ max-height: 100%;
95
+ object-fit: contain;
96
+ }
97
+ }
98
+
99
+ .shop-product-badge {
100
+ position: absolute;
101
+ top: .75rem;
102
+ left: .75rem;
103
+ }
104
+
105
+ .shop-product-body {
106
+ display: flex;
107
+ flex: 1;
108
+ flex-direction: column;
109
+ padding: 1rem;
110
+ }
111
+
112
+ // the rating over the title: stars (module rating), the value and the count of reviews; a product without a rating
113
+ // shows empty stars (--rating-value: 0) and a quiet text, so the row is not empty and the titles of a row of tiles
114
+ // stay in line
115
+ .shop-product-rating {
116
+ display: flex;
117
+ gap: .375rem;
118
+ align-items: center;
119
+ min-height: 1.5rem;
120
+ margin-bottom: .25rem;
121
+
122
+ a {
123
+ color: var(--bs-secondary-color);
124
+ }
125
+ }
126
+
127
+ .shop-product-title {
128
+ margin-bottom: .25rem;
129
+ font-size: 1rem;
130
+ font-weight: 600;
131
+
132
+ a {
133
+ color: var(--bs-emphasis-color);
134
+ text-decoration: none;
135
+ }
136
+ }
137
+
138
+ .shop-product-text {
139
+ margin-bottom: .75rem;
140
+ color: var(--bs-secondary-color);
141
+ }
142
+
143
+ // two narrow tiles in a row (a phone): the long text of parameters is cut after a few lines, or one row of tiles
144
+ // would be higher than the screen; a rating without a value (.shop-product-rating-empty) drops its empty stars
145
+ // there, so its text stays on one line and the titles of the row in line
146
+ @include bs.media-breakpoint-down(md) {
147
+ .shop-product-text {
148
+ display: -webkit-box;
149
+ overflow: hidden;
150
+ -webkit-box-orient: vertical;
151
+ -webkit-line-clamp: var(--shop-product-text-lines, 4);
152
+ line-clamp: var(--shop-product-text-lines, 4);
153
+ }
154
+
155
+ .shop-product-rating-empty > .rating-static {
156
+ display: none;
157
+ }
158
+ }
159
+
160
+ .shop-product-footer {
161
+ padding-top: 1rem;
162
+ margin-top: auto;
163
+
164
+ // the availability in the middle under the price and the button
165
+ > .shop-stock {
166
+ justify-content: center;
167
+ font-weight: 500;
168
+ }
169
+ }
170
+
171
+ // the price (the original one under it) on the left, the button on the right, together on a tinted strip that parts
172
+ // them from the text; the strip is as high with one price as with two, so the tiles of a row stay in line
173
+ .shop-product-buy {
174
+ display: flex;
175
+ flex-wrap: wrap;
176
+ gap: .5rem;
177
+ align-items: center;
178
+ justify-content: space-between;
179
+ min-height: 3.5rem;
180
+ padding: .5rem .5rem .5rem .625rem;
181
+ margin-bottom: .75rem;
182
+ background-color: var(--shop-tint-bg);
183
+ border-radius: var(--bs-border-radius);
184
+ }
185
+
186
+ .shop-product-prices {
187
+ display: flex;
188
+ flex-direction: column;
189
+ line-height: 1.3;
190
+ }
191
+
192
+ // prices: the current one, the original one crossed out
193
+ .shop-price {
194
+ font-size: 1rem;
195
+ font-weight: 600;
196
+ color: var(--bs-emphasis-color);
197
+ }
198
+
199
+ .shop-price-old {
200
+ color: var(--bs-secondary-color);
201
+ text-decoration: line-through;
202
+ }
203
+
204
+ // the availability of a product: a text in the color of the state (an icon before it is possible)
205
+ .shop-stock {
206
+ display: flex;
207
+ align-items: center;
208
+ gap: .375rem;
209
+ }
210
+
211
+ // a choice of a variant (memory, color, …) as pills; the chosen one is tinted
212
+ // <div class="shop-variant-group"><div class="shop-variant-title">Memory</div><div class="shop-variant-options">
213
+ // <button type="button" class="shop-variant-pill active">16 GB</button>
214
+ // </div></div>
215
+ .shop-variant-group + .shop-variant-group {
216
+ margin-top: 1.25rem;
217
+ }
218
+
219
+ .shop-variant-title {
220
+ margin-bottom: .5rem;
221
+ font-weight: 600;
222
+ }
223
+
224
+ .shop-variant-options {
225
+ display: flex;
226
+ flex-wrap: wrap;
227
+ gap: .5rem;
228
+ }
229
+
230
+ .shop-variant-pill {
231
+ padding: .4375rem .875rem;
232
+ font-weight: 500;
233
+ color: var(--bs-body-color);
234
+ cursor: pointer;
235
+ background-color: var(--bs-secondary-bg);
236
+ border: 0;
237
+ border-radius: var(--bs-border-radius);
238
+
239
+ &:hover:not(:disabled) {
240
+ background-color: var(--bs-border-color);
241
+ }
242
+
243
+ &.active {
244
+ color: var(--shop-primary-text);
245
+ background-color: var(--bs-primary-bg-subtle);
246
+ }
247
+
248
+ &:disabled {
249
+ opacity: .45;
250
+ text-decoration: line-through;
251
+ cursor: not-allowed;
252
+ }
253
+ }
254
+
255
+ // the photos of a product: the big one and the thumbnails under it. They have no surface of their own, they stand in
256
+ // the box of the detail (a card) next to the name, the price and the choice of a variant. The big photo can be a link
257
+ // that opens it in the lightbox (a.shop-detail-zoom around it), the thumbnails buttons or links
258
+ .shop-detail-zoom {
259
+ display: block;
260
+ cursor: zoom-in;
261
+ border-radius: var(--bs-border-radius);
262
+ }
263
+
264
+ .shop-detail-main {
265
+ display: block;
266
+ width: 100%;
267
+ aspect-ratio: 4 / 3;
268
+ object-fit: contain;
269
+ border-radius: var(--bs-border-radius);
270
+ }
271
+
272
+ .shop-detail-thumbs {
273
+ display: flex;
274
+ gap: .625rem;
275
+ margin-top: .75rem;
276
+ overflow-x: auto;
277
+ }
278
+
279
+ .shop-detail-thumb {
280
+ display: block;
281
+ flex: 0 0 4.5rem;
282
+ height: 4.5rem;
283
+ padding: 0;
284
+ overflow: hidden;
285
+ cursor: pointer;
286
+ background: none;
287
+ border: 0;
288
+ border-radius: var(--bs-border-radius);
289
+ opacity: .5;
290
+
291
+ // the shown photo is the one at full strength, the others are dimmed (no border)
292
+ &:hover,
293
+ &.active {
294
+ opacity: 1;
295
+ }
296
+
297
+ img {
298
+ width: 100%;
299
+ height: 100%;
300
+ object-fit: contain;
301
+ }
302
+ }
303
+
304
+ @include bs.media-breakpoint-down(sm) {
305
+ .shop-detail-main {
306
+ aspect-ratio: 1;
307
+ }
308
+ }
@@ -0,0 +1,204 @@
1
+ //
2
+ // shop: the cart, the choice of the delivery and the summary of the order
3
+ //
4
+
5
+ // a row of the cart: a photo, the name, the amount, the price, remove
6
+ // <div class="shop-cart-item"><img class="shop-cart-photo" …><div class="shop-cart-info">…</div><div class="shop-cart-qty">number input</div><div class="shop-cart-price">…</div><div class="shop-cart-remove">…</div></div>
7
+ .shop-cart-item {
8
+ display: flex;
9
+ flex-wrap: wrap;
10
+ align-items: center;
11
+ gap: 1rem;
12
+ padding: 1rem 0;
13
+
14
+ + .shop-cart-item {
15
+ border-top: 1px solid var(--bs-border-color-translucent);
16
+ }
17
+
18
+ &:first-child {
19
+ padding-top: 0;
20
+ }
21
+
22
+ &:last-child {
23
+ padding-bottom: 0;
24
+ }
25
+ }
26
+
27
+ .shop-cart-photo {
28
+ width: 4rem;
29
+ height: 4rem;
30
+ object-fit: contain;
31
+ border-radius: var(--bs-border-radius);
32
+ }
33
+
34
+ .shop-cart-info {
35
+ flex: 1 1 12rem;
36
+ min-width: 0;
37
+ }
38
+
39
+ .shop-cart-qty {
40
+ width: 9rem;
41
+ }
42
+
43
+ .shop-cart-price {
44
+ min-width: 6rem;
45
+ font-weight: 600;
46
+ text-align: end;
47
+ }
48
+
49
+ // facts of an order to read (the customer, the address, the carrier): a quiet label over each value, side by side
50
+ // as many as fit
51
+ // <dl class="shop-info"><div><dt>Email</dt><dd>jan@example.com</dd></div>…</dl>
52
+ .shop-info {
53
+ display: grid;
54
+ grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
55
+ gap: 1rem 2rem;
56
+ margin: 0;
57
+
58
+ dt {
59
+ margin-bottom: .125rem;
60
+ font-weight: 400;
61
+ color: var(--bs-secondary-color);
62
+ }
63
+
64
+ dd {
65
+ margin: 0;
66
+ }
67
+ }
68
+
69
+ // an address written as on a parcel: the name in bold on its own line, then the street, the town and the country
70
+ // <address class="shop-address"><strong>Jan Novák</strong>Dlouhá 12<br>110 00 Praha<br>Czechia</address>
71
+ .shop-address {
72
+ margin: 0;
73
+ font-style: normal;
74
+ font-weight: 400;
75
+ line-height: 1.6;
76
+ color: var(--bs-body-color);
77
+
78
+ strong {
79
+ display: block;
80
+ font-weight: 600;
81
+ color: var(--bs-emphasis-color);
82
+ }
83
+ }
84
+
85
+ // the choice of a carrier or payment: a card next to a hidden radio (.btn-check); the chosen one is tinted
86
+ // <input type="radio" class="btn-check" name="carrier" id="c1" checked>
87
+ // <label class="shop-option" for="c1"><span class="shop-option-main"><i class="shop-option-icon bi bi-truck"></i><span>Name</span></span><span class="shop-option-price">$4</span></label>
88
+ .shop-option {
89
+ display: flex;
90
+ align-items: center;
91
+ justify-content: space-between;
92
+ gap: .75rem;
93
+ width: 100%;
94
+ padding: .5rem .875rem;
95
+ margin-bottom: .375rem;
96
+ cursor: pointer;
97
+ background-color: var(--bs-tertiary-bg);
98
+ border-radius: var(--bs-border-radius);
99
+
100
+ &:hover {
101
+ background-color: var(--bs-secondary-bg);
102
+ }
103
+ }
104
+
105
+ .shop-option-main {
106
+ display: flex;
107
+ align-items: center;
108
+ gap: .75rem;
109
+ }
110
+
111
+ .shop-option-icon {
112
+ flex-shrink: 0;
113
+ width: 1.5rem;
114
+ font-size: 1.125rem;
115
+ line-height: 1;
116
+ text-align: center;
117
+ color: var(--bs-secondary-color);
118
+ }
119
+
120
+ .shop-option-price {
121
+ font-weight: 600;
122
+ white-space: nowrap;
123
+ }
124
+
125
+ .btn-check:checked + .shop-option {
126
+ background-color: var(--bs-primary-bg-subtle);
127
+
128
+ .shop-option-icon {
129
+ color: var(--bs-primary);
130
+ }
131
+ }
132
+
133
+ .btn-check:focus-visible + .shop-option {
134
+ box-shadow: 0 0 0 var(--bs-focus-ring-width, 1px) var(--bs-primary);
135
+ }
136
+
137
+ // the confirmation of a placed order: a banner in the tint of success (as a subtle badge), a check in a green
138
+ // circle on the left, next to it the title in the green of the text and the text; .theme-success gives the colors
139
+ // of the theme, without the theme the tokens of Bootstrap are used
140
+ // <div class="shop-confirm theme-success"><span class="shop-confirm-icon"><i class="bi bi-check-lg"></i></span>
141
+ // <div><h2 class="shop-confirm-title">Thank you</h2><p>…</p></div></div>
142
+ .shop-confirm {
143
+ display: flex;
144
+ gap: 1rem;
145
+ align-items: center;
146
+ padding: 1.25rem;
147
+ margin-bottom: 1rem;
148
+ background-color: var(--theme-bg-subtle, var(--bs-success-bg-subtle));
149
+ border-radius: var(--bs-border-radius-lg);
150
+ }
151
+
152
+ .shop-confirm-icon {
153
+ display: inline-flex;
154
+ flex-shrink: 0;
155
+ align-items: center;
156
+ justify-content: center;
157
+ width: 2.75rem;
158
+ height: 2.75rem;
159
+ font-size: 1.5rem;
160
+ color: #fff;
161
+ background-color: var(--bs-success);
162
+ border-radius: 50%;
163
+ }
164
+
165
+ .shop-confirm-title {
166
+ margin-bottom: .125rem;
167
+ font-size: 1.1875rem;
168
+ color: var(--theme-fg, var(--bs-success-text-emphasis));
169
+ }
170
+
171
+ // the summary of prices next to the steps, in view while the page scrolls (large screens)
172
+ // <div class="shop-summary"><div class="card"><div class="card-body">
173
+ // <div class="shop-summary-row"><span>Items:</span><span>2</span></div>
174
+ // <div class="shop-summary-total"><span>Total to pay:</span><span class="shop-summary-sum">$1,249</span></div>
175
+ // </div></div></div>
176
+ .shop-summary {
177
+ @media (min-width: 992px) {
178
+ position: sticky;
179
+ top: 5.25rem;
180
+ }
181
+ }
182
+
183
+ .shop-summary-row {
184
+ display: flex;
185
+ justify-content: space-between;
186
+ gap: 1rem;
187
+ margin-bottom: .5rem;
188
+ }
189
+
190
+ .shop-summary-total {
191
+ display: flex;
192
+ justify-content: space-between;
193
+ align-items: baseline;
194
+ gap: 1rem;
195
+ padding-top: .75rem;
196
+ margin-top: .75rem;
197
+ border-top: 1px solid var(--bs-border-color-translucent);
198
+ font-size: 1.125rem;
199
+ font-weight: 600;
200
+ }
201
+
202
+ .shop-summary-sum {
203
+ color: var(--bs-primary);
204
+ }
@@ -0,0 +1,116 @@
1
+ //
2
+ // shop: the filters of the product list
3
+ //
4
+ // <div class="shop-catalog">
5
+ // <div class="offcanvas-lg offcanvas-start" id="shop-filters" tabindex="-1">
6
+ // <div class="offcanvas-header">title, close button</div>
7
+ // <div class="offcanvas-body"><form class="shop-filters">
8
+ // <fieldset class="shop-filter"><legend class="shop-filter-title">Brand</legend>
9
+ // <div class="form-check"><input class="form-check-input" type="checkbox" id="f1">
10
+ // <label class="form-check-label" for="f1">Acme <span class="shop-filter-count">(12)</span></label></div>
11
+ // </fieldset>
12
+ // <fieldset class="shop-filter"><legend class="shop-filter-title">Price</legend>
13
+ // <div class="shop-filter-range"><input class="form-control form-control-sm"> – <input class="form-control form-control-sm"></div>
14
+ // </fieldset>
15
+ // </form></div>
16
+ // </div>
17
+ // <div>
18
+ // <div class="shop-filter-chips"><a class="shop-filter-chip" href="...">In stock <i class="bi bi-x-lg"></i></a></div>
19
+ // the order (.shop-sort) and the tiles
20
+ // </div>
21
+ // </div>
22
+ //
23
+ // From lg up the filters are a box in a column next to the list; below it they are a panel (the responsive offcanvas
24
+ // of Bootstrap) opened by a button with data-bs-toggle="offcanvas".
25
+ //
26
+
27
+ @use '../bootstrap' as bs;
28
+ @use '../variables' as var;
29
+
30
+ .shop-catalog {
31
+ --shop-filters-width: 16rem;
32
+
33
+ @include bs.media-breakpoint-up(lg) {
34
+ display: grid;
35
+ grid-template-columns: var(--shop-filters-width) minmax(0, 1fr);
36
+ gap: 1rem;
37
+ align-items: start;
38
+ }
39
+ }
40
+
41
+ .shop-filters {
42
+ width: 100%;
43
+
44
+ @include bs.media-breakpoint-up(lg) {
45
+ padding: 1rem;
46
+ background-color: var(--shop-surface-bg);
47
+ border: var.$surface-border;
48
+ border-radius: var(--bs-border-radius-lg);
49
+ }
50
+ }
51
+
52
+ // a group of the filters: its title and the choices
53
+ .shop-filter {
54
+ min-width: 0;
55
+ padding: 0;
56
+ margin: 0;
57
+ border: 0;
58
+
59
+ & + & {
60
+ margin-top: 1.25rem;
61
+ }
62
+
63
+ .form-check:last-child {
64
+ margin-bottom: 0;
65
+ }
66
+ }
67
+
68
+ .shop-filter-title {
69
+ float: none;
70
+ margin-bottom: .5rem;
71
+ font-size: inherit;
72
+ font-weight: 600;
73
+ color: var(--bs-emphasis-color);
74
+ }
75
+
76
+ // the count of products of a choice
77
+ .shop-filter-count {
78
+ color: var(--bs-secondary-color);
79
+ }
80
+
81
+ // a range (price from – to)
82
+ .shop-filter-range {
83
+ display: flex;
84
+ gap: .5rem;
85
+ align-items: center;
86
+ color: var(--bs-secondary-color);
87
+ }
88
+
89
+ // the chosen filters over the list: a click removes one
90
+ .shop-filter-chips {
91
+ display: flex;
92
+ flex-wrap: wrap;
93
+ gap: .5rem;
94
+ align-items: center;
95
+ margin-bottom: 1rem;
96
+ }
97
+
98
+ .shop-filter-chip {
99
+ display: inline-flex;
100
+ gap: .375rem;
101
+ align-items: center;
102
+ padding: .25rem .75rem;
103
+ color: var(--bs-body-color);
104
+ text-decoration: none;
105
+ background-color: rgba(var(--bs-body-color-rgb), .06);
106
+ border-radius: var(--bs-border-radius-pill);
107
+
108
+ &:hover {
109
+ color: var(--bs-emphasis-color);
110
+ background-color: rgba(var(--bs-body-color-rgb), .1);
111
+ }
112
+
113
+ .bi {
114
+ font-size: .75em;
115
+ }
116
+ }