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.
- package/dist/css/auth.css +166 -0
- package/dist/css/blog.css +512 -0
- package/dist/css/chart.css +99 -0
- package/dist/css/compostrap.css +5052 -0
- package/dist/css/dashboard.css +360 -0
- package/dist/css/datagrid.css +64 -0
- package/dist/css/datepicker.css +514 -0
- package/dist/css/dialogs.css +185 -0
- package/dist/css/dropzone.css +86 -0
- package/dist/css/elements.css +181 -0
- package/dist/css/empty.css +94 -0
- package/dist/css/gallery.css +122 -0
- package/dist/css/lightbox.css +144 -0
- package/dist/css/number-input.css +100 -0
- package/dist/css/otp-input.css +177 -0
- package/dist/css/password-toggle.css +52 -0
- package/dist/css/rating.css +95 -0
- package/dist/css/selection.css +59 -0
- package/dist/css/settings.css +85 -0
- package/dist/css/shop.css +1026 -0
- package/dist/css/sidebar-menu.css +439 -0
- package/dist/css/sidebar.css +95 -0
- package/dist/css/spinner.css +102 -0
- package/dist/css/strength.css +118 -0
- package/dist/css/theme-switcher.css +5 -0
- package/dist/css/theme.css +13034 -0
- package/dist/css/tooltip.css +158 -0
- package/dist/js/chart.js +257 -0
- package/dist/js/datepicker.js +82 -0
- package/dist/js/dialogs.js +7 -0
- package/dist/js/dropzone.js +15 -0
- package/dist/js/index.js +24 -0
- package/dist/js/lightbox.js +77 -0
- package/dist/js/number-input.js +44 -0
- package/dist/js/otp-input.js +182 -0
- package/dist/js/password-toggle.js +16 -0
- package/dist/js/selection.js +32 -0
- package/dist/js/sidebar-menu.js +76 -0
- package/dist/js/sidebar.js +120 -0
- package/dist/js/spinner.js +27 -0
- package/dist/js/strength.js +87 -0
- package/dist/js/theme-switcher.js +98 -0
- package/dist/js/tooltip.js +17 -0
- package/docs/auth.md +25 -0
- package/docs/blog.md +85 -0
- package/docs/chart.md +39 -0
- package/docs/datagrid.md +64 -0
- package/docs/datepicker.md +35 -0
- package/docs/dialogs.md +81 -0
- package/docs/dropzone.md +23 -0
- package/docs/elements.md +38 -0
- package/docs/empty.md +25 -0
- package/docs/gallery.md +23 -0
- package/docs/layout.md +143 -0
- package/docs/lightbox.md +18 -0
- package/docs/number-input.md +19 -0
- package/docs/otp-input.md +52 -0
- package/docs/password-toggle.md +21 -0
- package/docs/rating.md +15 -0
- package/docs/selection.md +52 -0
- package/docs/settings.md +25 -0
- package/docs/shop.md +140 -0
- package/docs/spinner.md +51 -0
- package/docs/strength.md +26 -0
- package/docs/theme-switcher.md +60 -0
- package/docs/theme.md +100 -0
- package/docs/tooltip.md +30 -0
- package/license +21 -0
- package/package.json +106 -6
- package/readme.md +198 -0
- package/src/illustrations/empty.svg +15 -0
- package/src/illustrations/forbidden.svg +16 -0
- package/src/illustrations/maintenance.svg +14 -0
- package/src/illustrations/not-found.svg +22 -0
- package/src/illustrations/server-error.svg +21 -0
- package/src/js/chart.js +359 -0
- package/src/js/datepicker.js +154 -0
- package/src/js/dialogs.js +25 -0
- package/src/js/dropzone.js +35 -0
- package/src/js/index.js +29 -0
- package/src/js/lightbox.js +165 -0
- package/src/js/number-input.js +87 -0
- package/src/js/otp-input.js +401 -0
- package/src/js/password-toggle.js +45 -0
- package/src/js/selection.js +114 -0
- package/src/js/sidebar-menu.js +178 -0
- package/src/js/sidebar.js +326 -0
- package/src/js/spinner.js +76 -0
- package/src/js/strength.js +115 -0
- package/src/js/theme-switcher.js +197 -0
- package/src/js/tooltip.js +46 -0
- package/src/scss/_bootstrap.scss +9 -0
- package/src/scss/_variables.scss +58 -0
- package/src/scss/auth/_index.scss +210 -0
- package/src/scss/auth.scss +5 -0
- package/src/scss/blog/_article.scss +181 -0
- package/src/scss/blog/_comments.scss +108 -0
- package/src/scss/blog/_index.scss +18 -0
- package/src/scss/blog/_list.scss +246 -0
- package/src/scss/blog/_page.scss +138 -0
- package/src/scss/blog.scss +5 -0
- package/src/scss/chart/_index.scss +114 -0
- package/src/scss/chart.scss +5 -0
- package/src/scss/compostrap.scss +29 -0
- package/src/scss/dashboard/_content.scss +25 -0
- package/src/scss/dashboard/_dropdown.scss +71 -0
- package/src/scss/dashboard/_index.scss +9 -0
- package/src/scss/dashboard/_nanobar.scss +34 -0
- package/src/scss/dashboard/_navbar.scss +314 -0
- package/src/scss/dashboard/_theme.scss +27 -0
- package/src/scss/dashboard.scss +5 -0
- package/src/scss/datagrid/_index.scss +111 -0
- package/src/scss/datagrid.scss +5 -0
- package/src/scss/datepicker/_index.scss +557 -0
- package/src/scss/datepicker.scss +5 -0
- package/src/scss/dialogs/_index.scss +8 -0
- package/src/scss/dialogs/_modal.scss +82 -0
- package/src/scss/dialogs/_offcanvas.scss +13 -0
- package/src/scss/dialogs/_search.scss +79 -0
- package/src/scss/dialogs/_toast.scss +61 -0
- package/src/scss/dialogs.scss +5 -0
- package/src/scss/dropzone/_index.scss +111 -0
- package/src/scss/dropzone.scss +5 -0
- package/src/scss/elements/_datagrid-filter.scss +21 -0
- package/src/scss/elements/_index.scss +9 -0
- package/src/scss/elements/_list-row.scss +40 -0
- package/src/scss/elements/_loading.scss +47 -0
- package/src/scss/elements/_stat.scss +73 -0
- package/src/scss/elements/_status-dot.scss +38 -0
- package/src/scss/elements.scss +5 -0
- package/src/scss/empty/_index.scss +117 -0
- package/src/scss/empty.scss +5 -0
- package/src/scss/gallery/_index.scss +162 -0
- package/src/scss/gallery.scss +5 -0
- package/src/scss/lightbox/_index.scss +171 -0
- package/src/scss/lightbox.scss +5 -0
- package/src/scss/number-input/_index.scss +143 -0
- package/src/scss/number-input.scss +5 -0
- package/src/scss/otp-input/_index.scss +214 -0
- package/src/scss/otp-input.scss +5 -0
- package/src/scss/password-toggle/_index.scss +82 -0
- package/src/scss/password-toggle.scss +5 -0
- package/src/scss/rating/_index.scss +121 -0
- package/src/scss/rating.scss +5 -0
- package/src/scss/selection/_index.scss +84 -0
- package/src/scss/selection.scss +5 -0
- package/src/scss/settings/_index.scss +6 -0
- package/src/scss/settings/_nav-list.scss +52 -0
- package/src/scss/settings/_setting-row.scss +50 -0
- package/src/scss/settings.scss +5 -0
- package/src/scss/shop/_bar.scss +64 -0
- package/src/scss/shop/_catalog.scss +308 -0
- package/src/scss/shop/_checkout.scss +204 -0
- package/src/scss/shop/_filters.scss +116 -0
- package/src/scss/shop/_hero.scss +130 -0
- package/src/scss/shop/_index.scss +22 -0
- package/src/scss/shop/_page.scss +154 -0
- package/src/scss/shop/_reviews.scss +165 -0
- package/src/scss/shop/_stepper.scss +159 -0
- package/src/scss/shop.scss +5 -0
- package/src/scss/sidebar/_body.scss +8 -0
- package/src/scss/sidebar/_index.scss +8 -0
- package/src/scss/sidebar/_sidebar.scss +89 -0
- package/src/scss/sidebar/_theme.scss +7 -0
- package/src/scss/sidebar/_wrapper.scss +17 -0
- package/src/scss/sidebar-menu/_compact.scss +174 -0
- package/src/scss/sidebar-menu/_index.scss +9 -0
- package/src/scss/sidebar-menu/_list.scss +131 -0
- package/src/scss/sidebar-menu/_pills.scss +82 -0
- package/src/scss/sidebar-menu/_scrollbar.scss +53 -0
- package/src/scss/sidebar-menu/_theme.scss +109 -0
- package/src/scss/sidebar-menu.scss +5 -0
- package/src/scss/sidebar.scss +5 -0
- package/src/scss/spinner/_index.scss +130 -0
- package/src/scss/spinner.scss +5 -0
- package/src/scss/strength/_index.scss +118 -0
- package/src/scss/strength.scss +5 -0
- package/src/scss/theme/_accordion.scss +20 -0
- package/src/scss/theme/_alerts.scss +24 -0
- package/src/scss/theme/_avatar.scss +37 -0
- package/src/scss/theme/_badges.scss +53 -0
- package/src/scss/theme/_base.scss +9 -0
- package/src/scss/theme/_breadcrumb.scss +64 -0
- package/src/scss/theme/_buttons.scss +200 -0
- package/src/scss/theme/_cards.scss +17 -0
- package/src/scss/theme/_colors.scss +139 -0
- package/src/scss/theme/_forms.scss +175 -0
- package/src/scss/theme/_index.scss +18 -0
- package/src/scss/theme/_navs.scss +15 -0
- package/src/scss/theme/_overlays.scss +128 -0
- package/src/scss/theme/_tables.scss +59 -0
- package/src/scss/theme/_variables.scss +194 -0
- package/src/scss/theme-switcher/_index.scss +9 -0
- package/src/scss/theme-switcher.scss +5 -0
- package/src/scss/theme.scss +9 -0
- package/src/scss/tooltip/_index.scss +177 -0
- package/src/scss/tooltip.scss +5 -0
- package/README.md +0 -3
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
//
|
|
2
|
+
// shop: the welcome of the storefront, a low band right under the header in the whole width of the window, with a
|
|
3
|
+
// label, a title in two tones, a short text and a row of white icons of products
|
|
4
|
+
//
|
|
5
|
+
// <header class="shop-header">…</header>
|
|
6
|
+
// <section class="shop-hero">
|
|
7
|
+
// <div class="container">
|
|
8
|
+
// <div class="shop-hero-copy">
|
|
9
|
+
// <p class="shop-hero-eyebrow">Compostrap Shop</p>
|
|
10
|
+
// <p class="shop-hero-title">Your shopping, <em>simply.</em></p>
|
|
11
|
+
// <p class="shop-hero-text">Text</p>
|
|
12
|
+
// </div>
|
|
13
|
+
// <div class="shop-hero-art" aria-hidden="true">
|
|
14
|
+
// <span class="shop-hero-icon"><i class="bi bi-headphones"></i></span>
|
|
15
|
+
// <span class="shop-hero-icon"><i class="bi bi-laptop"></i></span>
|
|
16
|
+
// </div>
|
|
17
|
+
// </div>
|
|
18
|
+
// </section>
|
|
19
|
+
// <main class="container">…</main>
|
|
20
|
+
//
|
|
21
|
+
// The band is tinted with the primary color and joins the header without a gap; its content keeps the width of the
|
|
22
|
+
// page. The pictures are left out on a phone.
|
|
23
|
+
//
|
|
24
|
+
|
|
25
|
+
@use '../bootstrap' as bs;
|
|
26
|
+
|
|
27
|
+
.shop-hero {
|
|
28
|
+
--shop-hero-bg: color-mix(in srgb, var(--bs-primary) 11%, var(--shop-surface-bg));
|
|
29
|
+
--shop-hero-icon-size: 3rem;
|
|
30
|
+
|
|
31
|
+
padding: 1rem 0;
|
|
32
|
+
margin-bottom: 1.5rem;
|
|
33
|
+
// the tint grows towards the pictures
|
|
34
|
+
background: linear-gradient(100deg, var(--shop-hero-bg) 45%, color-mix(in srgb, var(--bs-primary) 21%, var(--shop-surface-bg)));
|
|
35
|
+
|
|
36
|
+
> .container {
|
|
37
|
+
display: flex;
|
|
38
|
+
gap: 1.5rem;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: space-between;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// the band joins the header: the header drops its gap, the band has it under itself
|
|
45
|
+
.shop-header:has(+ .shop-hero) {
|
|
46
|
+
margin-bottom: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.shop-hero-copy {
|
|
50
|
+
min-width: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// a short line and a label in capitals over the title
|
|
54
|
+
.shop-hero-eyebrow {
|
|
55
|
+
display: flex;
|
|
56
|
+
gap: .5rem;
|
|
57
|
+
align-items: center;
|
|
58
|
+
margin-bottom: .25rem;
|
|
59
|
+
font-size: .75rem;
|
|
60
|
+
font-weight: 700;
|
|
61
|
+
color: var(--bs-primary);
|
|
62
|
+
text-transform: uppercase;
|
|
63
|
+
letter-spacing: .12em;
|
|
64
|
+
|
|
65
|
+
&::before {
|
|
66
|
+
width: 1.5rem;
|
|
67
|
+
height: 1px;
|
|
68
|
+
content: '';
|
|
69
|
+
background-color: currentcolor;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// the title: its <em> is the second tone, lighter and in the primary color
|
|
74
|
+
.shop-hero-title {
|
|
75
|
+
margin-bottom: .125rem;
|
|
76
|
+
font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
|
|
77
|
+
font-weight: 500;
|
|
78
|
+
line-height: 1.2;
|
|
79
|
+
// a blue of its own, deeper than the primary color of the label and of the second tone (a dark title was too loud
|
|
80
|
+
// on the tint): the primary color mixed with the color of headings, so it is a light blue in the dark theme
|
|
81
|
+
color: color-mix(in srgb, var(--bs-primary) 55%, var(--bs-emphasis-color));
|
|
82
|
+
letter-spacing: -.02em;
|
|
83
|
+
|
|
84
|
+
em {
|
|
85
|
+
font-style: normal;
|
|
86
|
+
font-weight: 400;
|
|
87
|
+
color: var(--bs-primary);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.shop-hero-text {
|
|
92
|
+
margin-bottom: 0;
|
|
93
|
+
color: var(--bs-secondary-color);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// the pictures: a row of white icons of products, each on a round chip in the primary color; the chips grow stronger
|
|
97
|
+
// towards the edge like the tint of the band (the first one is the weakest)
|
|
98
|
+
.shop-hero-art {
|
|
99
|
+
display: flex;
|
|
100
|
+
flex: none;
|
|
101
|
+
gap: .625rem;
|
|
102
|
+
align-items: center;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.shop-hero-icon {
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
width: var(--shop-hero-icon-size);
|
|
110
|
+
height: var(--shop-hero-icon-size);
|
|
111
|
+
font-size: calc(var(--shop-hero-icon-size) * .45);
|
|
112
|
+
color: #fff;
|
|
113
|
+
background-color: color-mix(in srgb, var(--bs-primary) var(--shop-hero-icon-tone, 100%), var(--shop-surface-bg));
|
|
114
|
+
border-radius: 50%;
|
|
115
|
+
|
|
116
|
+
&:nth-last-child(2) { --shop-hero-icon-tone: 82%; }
|
|
117
|
+
&:nth-last-child(3) { --shop-hero-icon-tone: 64%; }
|
|
118
|
+
&:nth-last-child(4) { --shop-hero-icon-tone: 46%; }
|
|
119
|
+
&:nth-last-child(n + 5) { --shop-hero-icon-tone: 30%; }
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@include bs.media-breakpoint-down(md) {
|
|
123
|
+
.shop-hero {
|
|
124
|
+
margin-bottom: 1rem;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.shop-hero-art {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// shop: the storefront of an e-shop, the shopping cart and the order process, outside the administration
|
|
3
|
+
//
|
|
4
|
+
// <body class="shop-page">
|
|
5
|
+
// <header class="shop-header"><div class="container">brand, links, theme switch, <a class="shop-minicart">…</a></div></header>
|
|
6
|
+
// <main class="container">…</main>
|
|
7
|
+
// <footer class="shop-footer"><div class="container">…</div></footer>
|
|
8
|
+
// </body>
|
|
9
|
+
//
|
|
10
|
+
// The parts: `.shop-hero` (the welcome band under the header), `.shop-stepper` (steps of the order, in `.shop-checkout-head` with the title of the page), `.shop-option` (a card choice of a carrier or payment next to a
|
|
11
|
+
// `.btn-check`), `.shop-product` (a product tile), `.shop-filters` (the filters of the list), `.shop-variant-pill` (a variant choice), `.shop-detail-gallery`, `.shop-review` (the reviews of a product),
|
|
12
|
+
// `.shop-cart-item` (a row of the cart), `.shop-summary` (the sticky price summary), `.shop-info` (the facts of an order to read), `.shop-bar` (the total and the button at the bottom of a phone), `.shop-minicart`.
|
|
13
|
+
//
|
|
14
|
+
|
|
15
|
+
@use 'page';
|
|
16
|
+
@use 'stepper';
|
|
17
|
+
@use 'hero';
|
|
18
|
+
@use 'catalog';
|
|
19
|
+
@use 'filters';
|
|
20
|
+
@use 'reviews';
|
|
21
|
+
@use 'checkout';
|
|
22
|
+
@use 'bar';
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
//
|
|
2
|
+
// shop: the page, the header with the mini cart and the footer
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
@use '../bootstrap' as bs;
|
|
6
|
+
|
|
7
|
+
:root,
|
|
8
|
+
[data-bs-theme='light'] {
|
|
9
|
+
--shop-page-bg: color-mix(in srgb, var(--bs-tertiary-bg) 98.4%, #000);
|
|
10
|
+
--shop-surface-bg: var(--bs-body-bg);
|
|
11
|
+
--shop-tint-bg: rgba(var(--bs-body-color-rgb), .04);
|
|
12
|
+
// the primary color as a text on its light tint (the chosen variant, a finished step): darkened by 18 %, the least
|
|
13
|
+
// that reads 4.5:1 there
|
|
14
|
+
--shop-primary-text: color-mix(in oklch, var(--bs-primary) 82%, #000);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// the page is darker than its surfaces in the dark theme, as in the dashboard
|
|
18
|
+
[data-bs-theme='dark'] {
|
|
19
|
+
--shop-page-bg: color-mix(in srgb, var(--bs-body-bg) 55%, #000);
|
|
20
|
+
// a light tint is weaker on a dark surface, so it is stronger there
|
|
21
|
+
--shop-tint-bg: rgba(var(--bs-body-color-rgb), .09);
|
|
22
|
+
--shop-primary-text: var(--bs-primary);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// the footer stays at the bottom of a short page
|
|
26
|
+
.shop-page {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
min-height: 100vh;
|
|
30
|
+
background-color: var(--shop-page-bg);
|
|
31
|
+
|
|
32
|
+
> main {
|
|
33
|
+
flex: 1 0 auto;
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// the header is a white bar over the page, its content in the width of the page
|
|
39
|
+
.shop-header {
|
|
40
|
+
position: sticky;
|
|
41
|
+
top: 0;
|
|
42
|
+
z-index: 10;
|
|
43
|
+
margin-bottom: 1.5rem;
|
|
44
|
+
background-color: var(--shop-surface-bg);
|
|
45
|
+
|
|
46
|
+
> .container {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: 1rem;
|
|
50
|
+
min-height: 3.75rem;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.shop-brand {
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: .625rem;
|
|
58
|
+
font-weight: 600;
|
|
59
|
+
color: var(--bs-emphasis-color);
|
|
60
|
+
text-decoration: none;
|
|
61
|
+
|
|
62
|
+
// the brand is not underlined on hover like a link of the text
|
|
63
|
+
&:hover {
|
|
64
|
+
color: var(--bs-emphasis-color);
|
|
65
|
+
text-decoration: none;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.shop-nav {
|
|
70
|
+
display: flex;
|
|
71
|
+
gap: .25rem;
|
|
72
|
+
margin: 0 auto 0 1.5rem;
|
|
73
|
+
padding: 0;
|
|
74
|
+
list-style: none;
|
|
75
|
+
|
|
76
|
+
a {
|
|
77
|
+
display: block;
|
|
78
|
+
padding: .375rem .75rem;
|
|
79
|
+
color: var(--bs-secondary-color);
|
|
80
|
+
text-decoration: none;
|
|
81
|
+
border-radius: var(--bs-border-radius);
|
|
82
|
+
|
|
83
|
+
&:hover,
|
|
84
|
+
&.active {
|
|
85
|
+
color: var(--bs-emphasis-color);
|
|
86
|
+
background-color: var(--bs-tertiary-bg);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// the cart in the header: an icon with the count over it and the price. The count is the number of pieces; over 99
|
|
92
|
+
// the shop prints "99+", for an empty cart it leaves the badge empty (it stays in the page as the aria-live region
|
|
93
|
+
// and is not shown)
|
|
94
|
+
// <a class="shop-minicart" href="..."><span class="shop-minicart-icon"><i class="bi bi-cart3"></i><span class="badge theme-danger">2</span></span> <span>$1,249</span></a>
|
|
95
|
+
.shop-minicart {
|
|
96
|
+
display: inline-flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
gap: .625rem;
|
|
99
|
+
padding: .375rem .75rem;
|
|
100
|
+
font-weight: 500;
|
|
101
|
+
color: var(--bs-body-color);
|
|
102
|
+
text-decoration: none;
|
|
103
|
+
border-radius: var(--bs-border-radius);
|
|
104
|
+
|
|
105
|
+
&:hover {
|
|
106
|
+
background-color: var(--bs-tertiary-bg);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.shop-minicart-icon {
|
|
111
|
+
position: relative;
|
|
112
|
+
display: inline-flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
font-size: 1.25rem;
|
|
115
|
+
|
|
116
|
+
// the count: a circle for one digit (as wide as high), a pill for more ("99+"). It overlaps the icon by a negative
|
|
117
|
+
// margin and stays in the flow, so a wider count moves the price instead of covering it; placed by whole pixels,
|
|
118
|
+
// because a translate by half of a width that changes lands between pixels and blurs the edge
|
|
119
|
+
.badge {
|
|
120
|
+
position: relative;
|
|
121
|
+
top: -.5625rem;
|
|
122
|
+
display: inline-flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
justify-content: center;
|
|
125
|
+
min-width: 1.125rem;
|
|
126
|
+
height: 1.125rem;
|
|
127
|
+
padding: 0 .25rem;
|
|
128
|
+
margin-right: -.25rem;
|
|
129
|
+
margin-left: -.5rem;
|
|
130
|
+
font-size: .6875rem;
|
|
131
|
+
line-height: 1;
|
|
132
|
+
|
|
133
|
+
&:empty {
|
|
134
|
+
display: none;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.shop-footer {
|
|
140
|
+
margin-top: 3rem;
|
|
141
|
+
padding: 1.5rem 0;
|
|
142
|
+
color: var(--bs-secondary-color);
|
|
143
|
+
background-color: var(--shop-surface-bg);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@include bs.media-breakpoint-down(md) {
|
|
147
|
+
.shop-nav {
|
|
148
|
+
display: none;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.shop-minicart {
|
|
152
|
+
margin-left: auto;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
//
|
|
2
|
+
// shop: the reviews of a product on its detail
|
|
3
|
+
//
|
|
4
|
+
// <div class="shop-reviews-summary">
|
|
5
|
+
// <div class="shop-reviews-score"><div class="shop-reviews-value">4.8</div>
|
|
6
|
+
// <span class="rating-static" style="--rating-value: 4.8"></span><div>24 reviews</div></div>
|
|
7
|
+
// <ul class="shop-reviews-bars">
|
|
8
|
+
// <li><span>5</span><span class="shop-reviews-bar" style="--shop-reviews-share: 83%"></span><span>20</span></li>
|
|
9
|
+
// </ul>
|
|
10
|
+
// </div>
|
|
11
|
+
// <article class="shop-review">
|
|
12
|
+
// <header class="shop-review-header"><span class="avatar theme-primary">JN</span>
|
|
13
|
+
// <div class="shop-review-author"><strong>Jan Novák</strong><small>12 October 2026</small></div>
|
|
14
|
+
// <span class="rating-static rating-sm" style="--rating-value: 5"></span></header>
|
|
15
|
+
// <p>Text</p>
|
|
16
|
+
// <div class="shop-review-points"><ul class="shop-review-pros"><li>…</li></ul><ul class="shop-review-cons"><li>…</li></ul></div>
|
|
17
|
+
// <footer class="shop-review-footer">Was this review helpful? buttons</footer>
|
|
18
|
+
// </article>
|
|
19
|
+
//
|
|
20
|
+
|
|
21
|
+
@use '../bootstrap' as bs;
|
|
22
|
+
|
|
23
|
+
// the average with the stars and the count next to the shares of the five grades
|
|
24
|
+
.shop-reviews-summary {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
gap: 1.5rem 3rem;
|
|
28
|
+
align-items: center;
|
|
29
|
+
margin-bottom: 1.5rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.shop-reviews-score {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
gap: .25rem;
|
|
36
|
+
align-items: center;
|
|
37
|
+
min-width: 9rem;
|
|
38
|
+
color: var(--bs-secondary-color);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.shop-reviews-value {
|
|
42
|
+
font-size: 2.5rem;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
line-height: 1.1;
|
|
45
|
+
color: var(--bs-emphasis-color);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// a row per grade: the grade, the bar of its share, the count
|
|
49
|
+
.shop-reviews-bars {
|
|
50
|
+
display: grid;
|
|
51
|
+
flex: 1 1 14rem;
|
|
52
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
53
|
+
gap: .375rem .75rem;
|
|
54
|
+
align-items: center;
|
|
55
|
+
max-width: 24rem;
|
|
56
|
+
padding: 0;
|
|
57
|
+
margin: 0;
|
|
58
|
+
list-style: none;
|
|
59
|
+
|
|
60
|
+
> li {
|
|
61
|
+
display: contents;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
> li > :last-child {
|
|
65
|
+
color: var(--bs-secondary-color);
|
|
66
|
+
text-align: end;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.shop-reviews-bar {
|
|
71
|
+
height: .5rem;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
background-color: rgba(var(--bs-body-color-rgb), .08);
|
|
74
|
+
border-radius: var(--bs-border-radius-pill);
|
|
75
|
+
|
|
76
|
+
&::before {
|
|
77
|
+
display: block;
|
|
78
|
+
width: var(--shop-reviews-share, 0%);
|
|
79
|
+
height: 100%;
|
|
80
|
+
content: '';
|
|
81
|
+
background-color: var(--rating-color, #ffb800);
|
|
82
|
+
border-radius: inherit;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// one review; a line parts it from the one before
|
|
87
|
+
.shop-review {
|
|
88
|
+
padding-block: 1.25rem;
|
|
89
|
+
border-top: var(--bs-border-width) solid var(--bs-border-color);
|
|
90
|
+
|
|
91
|
+
&:last-of-type {
|
|
92
|
+
padding-bottom: 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
> p {
|
|
96
|
+
margin-bottom: .75rem;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.shop-review-header {
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-wrap: wrap;
|
|
103
|
+
gap: .5rem .75rem;
|
|
104
|
+
align-items: center;
|
|
105
|
+
margin-bottom: .75rem;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// the name (with a badge of a verified purchase) and the date under it
|
|
109
|
+
.shop-review-author {
|
|
110
|
+
display: flex;
|
|
111
|
+
flex: 1 1 10rem;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
min-width: 0;
|
|
114
|
+
|
|
115
|
+
> small {
|
|
116
|
+
color: var(--bs-secondary-color);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// what the customer liked and disliked, side by side from sm up
|
|
121
|
+
.shop-review-points {
|
|
122
|
+
display: grid;
|
|
123
|
+
gap: .5rem 2rem;
|
|
124
|
+
margin-bottom: .75rem;
|
|
125
|
+
|
|
126
|
+
@include bs.media-breakpoint-up(sm) {
|
|
127
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.shop-review-pros,
|
|
132
|
+
.shop-review-cons {
|
|
133
|
+
padding: 0;
|
|
134
|
+
margin: 0;
|
|
135
|
+
list-style: none;
|
|
136
|
+
|
|
137
|
+
> li {
|
|
138
|
+
position: relative;
|
|
139
|
+
padding-left: 1.25rem;
|
|
140
|
+
|
|
141
|
+
&::before {
|
|
142
|
+
position: absolute;
|
|
143
|
+
left: 0;
|
|
144
|
+
font-weight: 700;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.shop-review-pros > li::before {
|
|
150
|
+
color: var(--bs-success);
|
|
151
|
+
content: '+';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.shop-review-cons > li::before {
|
|
155
|
+
color: var(--bs-danger);
|
|
156
|
+
content: '\2212';
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.shop-review-footer {
|
|
160
|
+
display: flex;
|
|
161
|
+
flex-wrap: wrap;
|
|
162
|
+
gap: .5rem;
|
|
163
|
+
align-items: center;
|
|
164
|
+
color: var(--bs-secondary-color);
|
|
165
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
//
|
|
2
|
+
// shop: the steps of the order, numbered circles joined by a line
|
|
3
|
+
//
|
|
4
|
+
// <nav aria-label="Checkout steps"><ol class="shop-stepper">
|
|
5
|
+
// <li class="shop-stepper-item is-done"><a href="..."><span class="shop-stepper-badge"><i class="bi bi-check-lg"></i></span><span class="shop-stepper-label">Cart</span></a><span class="shop-stepper-line"></span></li>
|
|
6
|
+
// <li class="shop-stepper-item is-current" aria-current="step">…<span class="shop-stepper-badge">2</span>…</li>
|
|
7
|
+
// </ol></nav>
|
|
8
|
+
//
|
|
9
|
+
|
|
10
|
+
@use '../bootstrap' as bs;
|
|
11
|
+
@use '../variables' as var;
|
|
12
|
+
|
|
13
|
+
// the head of a step of the order: one bar, the title of the page in its left third and the steps in the other two,
|
|
14
|
+
// so the steps stay in place whatever the length of the title; below lg the steps go under the title
|
|
15
|
+
// <header class="shop-checkout-head"><nav aria-label="Checkout steps"><ol class="shop-stepper">…</ol></nav><h1 class="h4 mb-0">Your shopping cart</h1></header>
|
|
16
|
+
.shop-checkout-head {
|
|
17
|
+
display: grid;
|
|
18
|
+
gap: 1rem 1.5rem;
|
|
19
|
+
align-items: center;
|
|
20
|
+
padding: 1rem 1.25rem;
|
|
21
|
+
// the gap under the page header is its own; under the bar the same gap as between the boxes of the page
|
|
22
|
+
margin-bottom: 1rem;
|
|
23
|
+
background-color: var(--shop-surface-bg);
|
|
24
|
+
border: var.$surface-border;
|
|
25
|
+
border-radius: var(--bs-border-radius-lg);
|
|
26
|
+
|
|
27
|
+
// the steps come first in the markup (the navigation before the title), the title is shown before them;
|
|
28
|
+
// the steps are a container, so the names of the steps hide by the room the steps have (see the end of the file)
|
|
29
|
+
> nav {
|
|
30
|
+
order: 1;
|
|
31
|
+
min-width: 0;
|
|
32
|
+
container-type: inline-size;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@include bs.media-breakpoint-up(lg) {
|
|
36
|
+
// 5 : 7, so a longer title stays on one line (the steps then keep only the name of the current one)
|
|
37
|
+
grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
|
|
38
|
+
|
|
39
|
+
// steps without a title (the confirmation of the order) take the whole bar
|
|
40
|
+
> nav:only-child {
|
|
41
|
+
grid-column: 1 / -1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// next to the title the lines between the steps are shorter, so the names of all steps fit from xl up
|
|
45
|
+
> nav:not(:only-child) .shop-stepper-line {
|
|
46
|
+
min-width: 1rem;
|
|
47
|
+
margin: 0 .5rem;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@include bs.media-breakpoint-up(xl) {
|
|
52
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.shop-stepper {
|
|
57
|
+
--shop-stepper-size: 2rem;
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
margin: 0;
|
|
61
|
+
padding: 0;
|
|
62
|
+
list-style: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.shop-stepper-item {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex: 1 1 auto;
|
|
68
|
+
align-items: center;
|
|
69
|
+
min-width: 0;
|
|
70
|
+
|
|
71
|
+
> a,
|
|
72
|
+
> span:first-child {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
color: inherit;
|
|
76
|
+
text-decoration: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&:last-child {
|
|
80
|
+
flex: 0 0 auto;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&:last-child .shop-stepper-line {
|
|
84
|
+
display: none;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.shop-stepper-badge {
|
|
89
|
+
display: inline-flex;
|
|
90
|
+
flex-shrink: 0;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
width: var(--shop-stepper-size);
|
|
94
|
+
height: var(--shop-stepper-size);
|
|
95
|
+
font-weight: 600;
|
|
96
|
+
color: var(--bs-secondary-color);
|
|
97
|
+
background-color: var(--bs-secondary-bg);
|
|
98
|
+
border-radius: 50%;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.shop-stepper-label {
|
|
102
|
+
margin-left: .625rem;
|
|
103
|
+
font-weight: 500;
|
|
104
|
+
color: var(--bs-secondary-color);
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.shop-stepper-line {
|
|
109
|
+
flex: 1 1 auto;
|
|
110
|
+
min-width: 1.5rem;
|
|
111
|
+
height: 2px;
|
|
112
|
+
margin: 0 1rem;
|
|
113
|
+
background-color: var(--bs-secondary-bg);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.shop-stepper-item.is-done {
|
|
117
|
+
.shop-stepper-badge {
|
|
118
|
+
color: #fff;
|
|
119
|
+
background-color: var(--bs-primary);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.shop-stepper-label {
|
|
123
|
+
color: var(--bs-body-color);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.shop-stepper-line {
|
|
127
|
+
background-color: var(--bs-primary);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.shop-stepper-item.is-current {
|
|
132
|
+
.shop-stepper-badge {
|
|
133
|
+
color: var(--shop-primary-text);
|
|
134
|
+
background-color: var(--bs-primary-bg-subtle);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.shop-stepper-label {
|
|
138
|
+
font-weight: 600;
|
|
139
|
+
color: var(--bs-emphasis-color);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// on phones only the current step keeps its name
|
|
144
|
+
@include bs.media-breakpoint-down(sm) {
|
|
145
|
+
.shop-stepper-item:not(.is-current) .shop-stepper-label {
|
|
146
|
+
display: none;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.shop-stepper-line {
|
|
150
|
+
margin: 0 .5rem;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// in a narrow head of a step too (a small window)
|
|
155
|
+
@container (max-width: 36rem) {
|
|
156
|
+
.shop-stepper-item:not(.is-current) .shop-stepper-label {
|
|
157
|
+
display: none;
|
|
158
|
+
}
|
|
159
|
+
}
|