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,117 @@
1
+ //
2
+ // empty: an empty state (no items, nothing found, no role chosen) inside a box, or a whole error page
3
+ //
4
+ // <div class="empty">
5
+ // <div class="empty-img"><svg>…an illustration of src/illustrations…</svg></div>
6
+ // <p class="empty-header">404</p>
7
+ // <p class="empty-title">Nothing here yet</p>
8
+ // <p class="empty-subtitle">Add the first article, it will appear in this list.</p>
9
+ // <div class="empty-action"><a class="btn btn-primary" href="…">Add article</a></div>
10
+ // </div>
11
+ //
12
+ // Every part is optional; a box without an illustration can use an icon instead (`empty-icon`). `empty-page` centers
13
+ // the state on a page of its own (404, 403, 500, maintenance). The illustrations take their colors from the
14
+ // --cs-illustration-* tokens when inlined, so they follow the theme; as an <img> they use their own fallback colors.
15
+ //
16
+
17
+ :root,
18
+ [data-bs-theme='light'] {
19
+ --cs-illustration-bg: var(--bs-secondary-bg);
20
+ --cs-illustration-surface: var(--bs-body-bg);
21
+ --cs-illustration-line: color-mix(in srgb, var(--bs-body-color) 80%, transparent);
22
+ --cs-illustration-muted: color-mix(in srgb, var(--bs-body-color) 18%, var(--bs-body-bg));
23
+ --cs-illustration-accent: var(--bs-primary);
24
+ --cs-illustration-danger: var(--bs-danger);
25
+ }
26
+
27
+ [data-bs-theme='dark'] {
28
+ --cs-illustration-bg: color-mix(in srgb, var(--bs-body-color) 10%, var(--bs-body-bg));
29
+ --cs-illustration-line: color-mix(in srgb, var(--bs-body-color) 70%, transparent);
30
+ --cs-illustration-muted: color-mix(in srgb, var(--bs-body-color) 22%, var(--bs-body-bg));
31
+ }
32
+
33
+ .empty {
34
+ display: flex;
35
+ flex-direction: column;
36
+ align-items: center;
37
+ justify-content: center;
38
+ padding: 2rem 1rem;
39
+ text-align: center;
40
+ }
41
+
42
+ .empty-img {
43
+ width: 100%;
44
+ max-width: 15rem;
45
+ margin-bottom: 1.5rem;
46
+
47
+ > svg,
48
+ > img {
49
+ display: block;
50
+ width: 100%;
51
+ height: auto;
52
+ }
53
+ }
54
+
55
+ // an icon in a soft circle, for small empty states in boxes
56
+ .empty-icon {
57
+ display: inline-flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ width: 3rem;
61
+ height: 3rem;
62
+ margin-bottom: 1rem;
63
+ font-size: 1.375rem;
64
+ color: var(--bs-secondary-color);
65
+ background-color: var(--bs-tertiary-bg);
66
+ border-radius: 50%;
67
+ }
68
+
69
+ // the code of an error page (404), large and quiet
70
+ .empty-header {
71
+ margin-bottom: .75rem;
72
+ font-size: 3.5rem;
73
+ font-weight: 300;
74
+ line-height: 1;
75
+ color: var(--bs-secondary-color);
76
+ font-variant-numeric: tabular-nums;
77
+ }
78
+
79
+ .empty-title {
80
+ margin-bottom: .25rem;
81
+ font-size: 1rem;
82
+ font-weight: 600;
83
+ color: var(--bs-emphasis-color);
84
+ }
85
+
86
+ .empty-subtitle {
87
+ max-width: 30rem;
88
+ margin-bottom: 0;
89
+ color: var(--bs-secondary-color);
90
+ }
91
+
92
+ .empty-action {
93
+ display: flex;
94
+ flex-wrap: wrap;
95
+ gap: .5rem;
96
+ justify-content: center;
97
+ margin-top: 1.5rem;
98
+ }
99
+
100
+ // a page of its own: the state in the middle of the page background
101
+ .empty-page {
102
+ min-height: 100vh;
103
+ min-height: 100dvh;
104
+
105
+ > .empty {
106
+ min-height: inherit;
107
+ padding-block: 3rem;
108
+ }
109
+
110
+ .empty-img {
111
+ max-width: 20rem;
112
+ }
113
+
114
+ .empty-title {
115
+ font-size: 1.25rem;
116
+ }
117
+ }
@@ -0,0 +1,5 @@
1
+ //
2
+ // empty module of compostrap
3
+ //
4
+
5
+ @use 'empty/index';
@@ -0,0 +1,162 @@
1
+ //
2
+ // gallery: square tiles of images with buttons that appear over the image on hover or keyboard focus
3
+ //
4
+ // <figure class="gallery-item">
5
+ // <img src="..." alt="...">
6
+ // <span class="gallery-badge"><span class="badge theme-primary">Main photo</span></span>
7
+ // <figcaption class="gallery-caption" title="mountains.jpg">
8
+ // <span class="gallery-name">mountains</span><span class="gallery-ext">jpg</span>
9
+ // </figcaption>
10
+ // <div class="gallery-actions">
11
+ // <a class="btn btn-sm btn-icon btn-light" aria-label="Preview" data-tooltip><i class="bi bi-zoom-in"></i></a>
12
+ // </div>
13
+ // </figure>
14
+ //
15
+ // `gallery-actions show` keeps the buttons shown, e.g. while a delete waits for its confirmation.
16
+ //
17
+
18
+ @use '../variables' as var;
19
+
20
+ .gallery-item {
21
+ position: relative;
22
+ aspect-ratio: 1;
23
+ margin: 0;
24
+ overflow: hidden;
25
+ background-color: var(--bs-tertiary-bg);
26
+ border-radius: var(--bs-border-radius-lg);
27
+ box-shadow: var.$soft-shadow;
28
+
29
+ > img {
30
+ width: 100%;
31
+ height: 100%;
32
+ object-fit: cover;
33
+ transition: transform .3s ease;
34
+ }
35
+
36
+ &:hover > img,
37
+ &:focus-within > img {
38
+ transform: scale(1.04);
39
+ }
40
+ }
41
+
42
+ // a label in the top left corner, it does not take the clicks of the image
43
+ .gallery-badge {
44
+ position: absolute;
45
+ top: .5rem;
46
+ left: .5rem;
47
+ z-index: 1;
48
+ pointer-events: none;
49
+ }
50
+
51
+ // the buttons over a dimmed image
52
+ .gallery-actions {
53
+ position: absolute;
54
+ inset: 0;
55
+ z-index: 2;
56
+ display: flex;
57
+ flex-wrap: wrap;
58
+ gap: .5rem;
59
+ align-items: center;
60
+ justify-content: center;
61
+ padding: .5rem;
62
+ background-color: rgba(0, 0, 0, .45);
63
+ opacity: 0;
64
+ transition: opacity .15s ease-in-out;
65
+
66
+ .gallery-item:hover &,
67
+ .gallery-item:focus-within &,
68
+ &.show {
69
+ opacity: 1;
70
+ }
71
+
72
+ // a text over the image, e.g. the question of a confirmation
73
+ .gallery-text {
74
+ flex-basis: 100%;
75
+ font-size: .875rem;
76
+ font-weight: 600;
77
+ color: #fff;
78
+ text-align: center;
79
+ }
80
+ }
81
+
82
+ // the name at the bottom of the image on a dark fade: the name cut to one line, the extension as a small label;
83
+ // it gives way to the buttons on hover
84
+ .gallery-caption {
85
+ position: absolute;
86
+ right: 0;
87
+ bottom: 0;
88
+ left: 0;
89
+ z-index: 1;
90
+ display: flex;
91
+ gap: .375rem;
92
+ align-items: center;
93
+ padding: 1.75rem .625rem .5rem;
94
+ font-size: .875rem;
95
+ font-weight: 500;
96
+ line-height: 1.25;
97
+ color: #fff;
98
+ pointer-events: none;
99
+ background: linear-gradient(to top, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0));
100
+ transition: opacity .15s ease-in-out;
101
+
102
+ .gallery-item:hover &,
103
+ .gallery-item:focus-within &,
104
+ .gallery-item:has(.gallery-actions.show) & {
105
+ opacity: 0;
106
+ }
107
+ }
108
+
109
+ .gallery-name {
110
+ flex: 1;
111
+ min-width: 0;
112
+ overflow: hidden;
113
+ text-overflow: ellipsis;
114
+ white-space: nowrap;
115
+ }
116
+
117
+ .gallery-ext {
118
+ flex-shrink: 0;
119
+ padding: .125rem .375rem;
120
+ font-size: .6875rem;
121
+ font-weight: 600;
122
+ letter-spacing: .04em;
123
+ text-transform: uppercase;
124
+ background-color: rgba(255, 255, 255, .2);
125
+ border-radius: var(--bs-border-radius-sm);
126
+ }
127
+
128
+ // touch screens have no hover: the buttons stay shown in a column at the right edge, without dimming the image, so the
129
+ // label in the top left corner and the name at the bottom stay free
130
+ @media (hover: none) {
131
+ .gallery-actions:not(.show) {
132
+ flex-direction: column;
133
+ flex-wrap: nowrap;
134
+ gap: .375rem;
135
+ align-items: flex-end;
136
+ justify-content: flex-start;
137
+ background-color: transparent;
138
+ opacity: 1;
139
+ }
140
+
141
+ .gallery-item .gallery-caption {
142
+ opacity: 1;
143
+ }
144
+ }
145
+
146
+ @media (prefers-reduced-motion: reduce) {
147
+ .gallery-item > img,
148
+ .gallery-actions,
149
+ .gallery-caption {
150
+ transition: none;
151
+ }
152
+ }
153
+
154
+ // a small square image in a table row or a list, e.g. the photo of a product in a datagrid
155
+ .gallery-thumb {
156
+ flex-shrink: 0;
157
+ width: 2.5rem;
158
+ height: 2.5rem;
159
+ object-fit: cover;
160
+ background-color: var(--bs-tertiary-bg);
161
+ border-radius: var(--bs-border-radius);
162
+ }
@@ -0,0 +1,5 @@
1
+ //
2
+ // gallery module of compostrap
3
+ //
4
+
5
+ @use 'gallery/index';
@@ -0,0 +1,171 @@
1
+ //
2
+ // lightbox: the full-screen preview of the script Lightbox (a <dialog class="lightbox"> it creates itself): the image
3
+ // on a dark backdrop, its caption, a counter and round buttons to close and to browse
4
+ //
5
+
6
+ // The page under it does not scroll: the dialog and its backdrop keep a scroll gesture to themselves (the backdrop has
7
+ // to be a scroll container for that), so the scrollbar of the page stays and nothing shifts. Safari does not hold a
8
+ // gesture in a box that cannot scroll yet; on iOS, where the scrollbar takes no room, the page is locked the old way.
9
+ // The scrollbar left in view takes the dark look of the backdrop also in the light theme.
10
+ html.lightbox-open {
11
+ color-scheme: dark;
12
+ }
13
+
14
+ @supports (-webkit-touch-callout: none) {
15
+ .lightbox-open {
16
+ overflow: hidden;
17
+ }
18
+ }
19
+
20
+ .lightbox {
21
+ overscroll-behavior: contain;
22
+ // 100 %, not 100vw: the window without the scrollbar of the page, so the buttons at the right edge keep their
23
+ // distance from it and are not drawn under it
24
+ width: 100%;
25
+ max-width: 100%;
26
+ height: 100dvh;
27
+ max-height: 100dvh;
28
+ padding: 0;
29
+ margin: 0;
30
+ color: #fff;
31
+ background: transparent;
32
+ border: 0;
33
+
34
+ &::backdrop {
35
+ overflow: hidden;
36
+ overscroll-behavior: contain;
37
+ background-color: rgba(0, 0, 0, .95);
38
+ }
39
+
40
+ &[open] {
41
+ animation: lightbox-in .2s ease-out;
42
+ }
43
+ }
44
+
45
+ .lightbox-figure {
46
+ position: absolute;
47
+ inset: 3.5rem 4.5rem 1.5rem;
48
+ display: flex;
49
+ flex-direction: column;
50
+ align-items: center;
51
+ justify-content: center;
52
+ margin: 0;
53
+ }
54
+
55
+ .lightbox-image {
56
+ max-width: 100%;
57
+ max-height: calc(100% - 2.5rem);
58
+ object-fit: contain;
59
+ border-radius: var(--bs-border-radius);
60
+ box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
61
+ }
62
+
63
+ .lightbox-caption {
64
+ min-height: 1.25rem;
65
+ margin-top: .75rem;
66
+ font-size: .875rem;
67
+ color: rgba(255, 255, 255, .75);
68
+ text-align: center;
69
+ }
70
+
71
+ .lightbox-counter {
72
+ position: absolute;
73
+ top: 1.25rem;
74
+ left: 1.5rem;
75
+ font-size: .875rem;
76
+ font-variant-numeric: tabular-nums;
77
+ color: rgba(255, 255, 255, .75);
78
+ }
79
+
80
+ .lightbox-button {
81
+ position: absolute;
82
+ display: inline-flex;
83
+ align-items: center;
84
+ justify-content: center;
85
+ width: 2.75rem;
86
+ height: 2.75rem;
87
+ padding: 0;
88
+ color: #fff;
89
+ cursor: pointer;
90
+ background-color: rgba(255, 255, 255, .1);
91
+ border: 0;
92
+ border-radius: 50%;
93
+
94
+ &:hover {
95
+ background-color: rgba(255, 255, 255, .2);
96
+ }
97
+
98
+ &:focus-visible {
99
+ outline: 2px solid rgba(255, 255, 255, .8);
100
+ outline-offset: 2px;
101
+ }
102
+ }
103
+
104
+ .lightbox-close {
105
+ top: .75rem;
106
+ right: .75rem;
107
+ }
108
+
109
+ .lightbox-prev,
110
+ .lightbox-next {
111
+ top: 50%;
112
+ transform: translateY(-50%);
113
+ }
114
+
115
+ .lightbox-prev {
116
+ left: .75rem;
117
+ }
118
+
119
+ .lightbox-next {
120
+ right: .75rem;
121
+ }
122
+
123
+ // one image: nothing to browse
124
+ .lightbox-single {
125
+ .lightbox-prev,
126
+ .lightbox-next {
127
+ display: none;
128
+ }
129
+ }
130
+
131
+ // small screens: the image over the whole width, the arrows at the bottom
132
+ @media (max-width: 575.98px) {
133
+ .lightbox-figure {
134
+ inset: 3.5rem .5rem 4.5rem;
135
+ }
136
+
137
+ .lightbox-prev,
138
+ .lightbox-next {
139
+ top: auto;
140
+ bottom: .75rem;
141
+ transform: none;
142
+ }
143
+
144
+ .lightbox-prev {
145
+ left: calc(50% - 3.25rem);
146
+ }
147
+
148
+ .lightbox-next {
149
+ right: calc(50% - 3.25rem);
150
+ }
151
+ }
152
+
153
+ @keyframes lightbox-in {
154
+ from {
155
+ opacity: 0;
156
+ }
157
+
158
+ to {
159
+ opacity: 1;
160
+ }
161
+ }
162
+
163
+ @media (prefers-reduced-motion: reduce) {
164
+ .lightbox[open] {
165
+ animation: none;
166
+ }
167
+
168
+ .lightbox-button {
169
+ transition: none;
170
+ }
171
+ }
@@ -0,0 +1,5 @@
1
+ //
2
+ // lightbox module of compostrap
3
+ //
4
+
5
+ @use 'lightbox/index';
@@ -0,0 +1,143 @@
1
+ //
2
+ // number input: a number between a minus and a plus button, e.g. the quantity of an item in a cart
3
+ //
4
+ // <div class="number-input">
5
+ // <button type="button" class="number-input-btn" data-number-input="down" aria-label="Decrease"></button>
6
+ // <input type="number" class="form-control" value="1" min="1" max="99" step="1" aria-label="Quantity">
7
+ // <button type="button" class="number-input-btn" data-number-input="up" aria-label="Increase"></button>
8
+ // </div>
9
+ //
10
+ // No border and no box around the whole: two quiet gray buttons with the number between them on the surface of the
11
+ // page. The buttons draw their minus and plus themselves (an icon inside replaces them). A fractional step sets how
12
+ // many decimals the value keeps; min and max disable the buttons at the ends. The spin buttons of the browser are
13
+ // hidden, its validation stays. The buttons are a step smaller than a form control (32px; 26px with number-input-sm,
14
+ // 38px with number-input-lg).
15
+ //
16
+
17
+ @use '../bootstrap' as bs;
18
+
19
+ .number-input {
20
+ --number-input-btn-size: 2rem;
21
+ --number-input-btn-bg: rgba(var(--bs-body-color-rgb), .06);
22
+ --number-input-btn-hover-bg: rgba(var(--bs-body-color-rgb), .11);
23
+ --number-input-focus-bg: rgba(var(--bs-body-color-rgb), .05);
24
+
25
+ display: flex;
26
+ gap: .125rem;
27
+ align-items: center;
28
+ width: fit-content;
29
+
30
+ // the field is as wide as its number (at least two digits), so the buttons stay close to it
31
+ > .form-control {
32
+ min-width: calc(2.5ch + .5rem);
33
+ // a very long number scrolls in the field instead of pushing the page apart
34
+ max-width: calc(10ch + .5rem);
35
+ height: var(--number-input-btn-size);
36
+ min-height: 0;
37
+ padding: 0 .25rem;
38
+ font-size: inherit;
39
+ font-variant-numeric: tabular-nums;
40
+ text-align: center;
41
+ field-sizing: content;
42
+ background-color: transparent;
43
+ border: 0;
44
+ border-radius: var(--bs-border-radius);
45
+ box-shadow: none;
46
+ appearance: textfield;
47
+
48
+ &::-webkit-inner-spin-button,
49
+ &::-webkit-outer-spin-button {
50
+ margin: 0;
51
+ appearance: none;
52
+ }
53
+
54
+ // a quiet tint shows where the typing goes (the number has no frame of its own)
55
+ &:focus {
56
+ background-color: var(--number-input-focus-bg);
57
+ }
58
+
59
+ &:disabled {
60
+ color: var(--bs-secondary-color);
61
+ }
62
+ }
63
+ }
64
+
65
+ // a browser without field-sizing gets a field for about four digits
66
+ @supports not (field-sizing: content) {
67
+ .number-input > .form-control {
68
+ width: calc(5ch + .5rem);
69
+ }
70
+ }
71
+
72
+ .number-input-btn {
73
+ display: inline-flex;
74
+ flex-shrink: 0;
75
+ align-items: center;
76
+ justify-content: center;
77
+ width: var(--number-input-btn-size);
78
+ height: var(--number-input-btn-size);
79
+ padding: 0;
80
+ color: var(--bs-body-color);
81
+ background-color: var(--number-input-btn-bg);
82
+ border: 0;
83
+ border-radius: var(--bs-border-radius);
84
+
85
+ // a hovered button darkens at once; the focused one (keyboard) too, no ring
86
+ &:hover,
87
+ &:focus-visible {
88
+ outline: 0;
89
+ background-color: var(--number-input-btn-hover-bg);
90
+ }
91
+
92
+ &:disabled {
93
+ color: var(--bs-tertiary-color);
94
+ pointer-events: none;
95
+ background-color: rgba(var(--bs-body-color-rgb), .03);
96
+ }
97
+
98
+ // a minus, and a plus for the second button, when the button has no icon of its own
99
+ &:empty::before {
100
+ width: .75rem;
101
+ height: .75rem;
102
+ content: '';
103
+ background-color: currentcolor;
104
+ mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath stroke='black' stroke-width='1.75' stroke-linecap='round' d='M2.5 8h11'/%3e%3c/svg%3e") no-repeat center / contain;
105
+ }
106
+
107
+ &[data-number-input='up']:empty::before {
108
+ mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath stroke='black' stroke-width='1.75' stroke-linecap='round' d='M2.5 8h11M8 2.5v11'/%3e%3c/svg%3e");
109
+ }
110
+ }
111
+
112
+ // on the dark surface the same tints are fainter, so they are a step stronger
113
+ [data-bs-theme='dark'] .number-input {
114
+ --number-input-btn-bg: rgba(var(--bs-body-color-rgb), .1);
115
+ --number-input-btn-hover-bg: rgba(var(--bs-body-color-rgb), .17);
116
+ --number-input-focus-bg: rgba(var(--bs-body-color-rgb), .07);
117
+ }
118
+
119
+ // the sizes: 26, 32 and 38px high
120
+ .number-input-sm {
121
+ --number-input-btn-size: 1.625rem;
122
+
123
+ font-size: bs.$input-font-size-sm;
124
+ }
125
+
126
+ .number-input-lg {
127
+ --number-input-btn-size: 2.375rem;
128
+
129
+ font-size: bs.$input-font-size-lg;
130
+
131
+ > .form-control,
132
+ .number-input-btn {
133
+ border-radius: var(--bs-border-radius-lg);
134
+ }
135
+ }
136
+
137
+ // Safari of iOS zooms the page in when a field with a text under 16px gets the focus: the number is 16px there
138
+ // (the large size is over it already), the height of the field is the one of the buttons
139
+ @supports (-webkit-touch-callout: none) {
140
+ .number-input:not(.number-input-lg) > .form-control {
141
+ font-size: 1rem;
142
+ }
143
+ }
@@ -0,0 +1,5 @@
1
+ //
2
+ // number-input module of compostrap
3
+ //
4
+
5
+ @use 'number-input/index';