compostrap 0.0.0-stage → 1.0.0

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 +5047 -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 +140 -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 +438 -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 +13006 -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 +164 -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 +173 -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 +114 -0
  191. package/src/scss/theme/_tables.scss +59 -0
  192. package/src/scss/theme/_variables.scss +189 -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,181 @@
1
+ //
2
+ // blog: an article: a narrow column with the title, the perex, the author, the picture and the text
3
+ //
4
+ // <article class="blog-article">
5
+ // <a class="blog-back" href="...">← Blog</a>
6
+ // <h1 class="blog-article-title">Title</h1>
7
+ // <p class="blog-article-lead">Perex</p>
8
+ // <div class="blog-meta blog-article-meta"><span class="blog-author">…</span><time>…</time><a href="...">News</a></div>
9
+ // <div class="blog-article-image"><img src="..." alt=""></div>
10
+ // <div class="blog-content">text</div>
11
+ // </article>
12
+ //
13
+
14
+ .blog-article {
15
+ max-width: var(--blog-article-width, 48rem);
16
+ margin-inline: auto;
17
+ }
18
+
19
+ .blog-back {
20
+ display: inline-block;
21
+ margin-bottom: 1.5rem;
22
+ color: var(--bs-secondary-color);
23
+ text-decoration: none;
24
+
25
+ &:hover {
26
+ color: var(--bs-emphasis-color);
27
+ }
28
+ }
29
+
30
+ .blog-article-title {
31
+ margin-bottom: 1rem;
32
+ font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
33
+ font-weight: 600;
34
+ line-height: 1.15;
35
+ letter-spacing: -.02em;
36
+ }
37
+
38
+ .blog-article-lead {
39
+ margin-bottom: 1rem;
40
+ font-size: 1.125rem;
41
+ color: var(--bs-secondary-color);
42
+ }
43
+
44
+ .blog-article-meta {
45
+ margin-bottom: 1.5rem;
46
+ }
47
+
48
+ // the cover of an article: a wide cut over the whole column
49
+ .blog-article-image {
50
+ aspect-ratio: 21 / 9;
51
+ margin-bottom: 1.5rem;
52
+ overflow: hidden;
53
+ border-radius: var(--bs-border-radius-lg);
54
+
55
+ > img {
56
+ width: 100%;
57
+ height: 100%;
58
+ object-fit: cover;
59
+ object-position: top;
60
+ }
61
+ }
62
+
63
+ // the text of an article or a page (written in Texy, Markdown…): 16px, a step over the 14px of the page (18px was
64
+ // too big next to the comments), with more room between lines; pictures
65
+ // as the cover, a wide cut over the whole column
66
+ .blog-content {
67
+ font-size: 1rem;
68
+ line-height: 1.7;
69
+
70
+ // a link in the text is underlined: the theme draws links without a line, and in running text a color alone does
71
+ // not tell a link from the text (WCAG 1.4.1)
72
+ a {
73
+ text-decoration: underline;
74
+ text-underline-offset: .15em;
75
+ }
76
+
77
+ h2,
78
+ h3 {
79
+ margin-top: 2.5rem;
80
+ margin-bottom: 1rem;
81
+ }
82
+
83
+ h2 {
84
+ font-size: 1.375rem;
85
+ }
86
+
87
+ h3 {
88
+ font-size: 1.125rem;
89
+ }
90
+
91
+ img {
92
+ width: 100%;
93
+ height: auto;
94
+ aspect-ratio: 21 / 9;
95
+ object-fit: cover;
96
+ object-position: top;
97
+ border-radius: var(--bs-border-radius-lg);
98
+ }
99
+
100
+ // a quote: a line of the primary color on its left (drawn as a shadow, not a border)
101
+ blockquote {
102
+ padding: .25rem 0 .25rem 1.25rem;
103
+ margin: 1.5rem 0;
104
+ color: var(--bs-secondary-color);
105
+ box-shadow: inset 3px 0 0 var(--bs-primary);
106
+ }
107
+
108
+ pre {
109
+ padding: 1rem 1.25rem;
110
+ font-size: .875rem;
111
+ line-height: 1.6;
112
+ background-color: var(--blog-code-bg, var(--blog-tint-bg));
113
+ border-radius: var(--bs-border-radius-lg);
114
+
115
+ // the highlighter of drago prints text classes of Bootstrap; in a code block they take the colors of the code
116
+ // on nette.org (--blog-code-*), set through the variables these classes read, so no class of its own is needed
117
+ .text-primary {
118
+ --bs-primary-rgb: var(--blog-code-keyword);
119
+ }
120
+
121
+ .text-primary-emphasis {
122
+ --bs-primary-text-emphasis: rgb(var(--blog-code-function));
123
+ }
124
+
125
+ .text-success {
126
+ --bs-success-rgb: var(--blog-code-string);
127
+ }
128
+
129
+ .text-danger {
130
+ --bs-danger-rgb: var(--blog-code-number);
131
+ }
132
+
133
+ .text-warning-emphasis {
134
+ --bs-warning-text-emphasis: rgb(var(--blog-code-variable));
135
+ }
136
+
137
+ .text-info-emphasis {
138
+ --bs-info-text-emphasis: rgb(var(--blog-code-attribute));
139
+ }
140
+
141
+ .text-danger-emphasis {
142
+ --bs-danger-text-emphasis: rgb(var(--blog-code-macro));
143
+ }
144
+
145
+ .text-body-secondary {
146
+ --bs-secondary-color: rgb(var(--blog-code-comment));
147
+ }
148
+ }
149
+
150
+ > :last-child {
151
+ margin-bottom: 0;
152
+ }
153
+ }
154
+
155
+ // the colors of a highlighted code as on nette.org (its Prism theme): the light set on the light tint, the set of its
156
+ // dark code blocks in the dark theme; r, g, b without rgb(), because the text classes of Bootstrap read them so
157
+ :root,
158
+ [data-bs-theme='light'] {
159
+ // the box of a code is the light blue of nette.org; in the dark theme it stays the tint of the blog
160
+ --blog-code-bg: #f1f7ff;
161
+ --blog-code-keyword: 34, 130, 187; // #2282bb: keywords and tags
162
+ --blog-code-function: 226, 49, 64; // #e23140: names of functions and methods
163
+ --blog-code-string: 51, 141, 0; // #338d00
164
+ --blog-code-number: 153, 0, 85; // #990055
165
+ --blog-code-variable: 213, 148, 1; // #d59401
166
+ --blog-code-attribute: 137, 163, 21; // #89a315
167
+ --blog-code-macro: 224, 60, 60; // #e03c3c: Latte tags
168
+ --blog-code-comment: 112, 128, 144; // #708090
169
+ }
170
+
171
+ [data-bs-theme='dark'] {
172
+ --blog-code-bg: var(--blog-tint-bg);
173
+ --blog-code-keyword: 255, 213, 160; // #ffd5a0
174
+ --blog-code-function: 240, 141, 73; // #f08d49
175
+ --blog-code-string: 143, 210, 107; // #8fd26b
176
+ --blog-code-number: 240, 141, 73; // #f08d49
177
+ --blog-code-variable: 248, 197, 85; // #f8c555
178
+ --blog-code-attribute: 143, 210, 107; // #8fd26b
179
+ --blog-code-macro: 226, 119, 122; // #e2777a
180
+ --blog-code-comment: 153, 153, 153; // #999999
181
+ }
@@ -0,0 +1,108 @@
1
+ //
2
+ // blog: the comments under an article and the form of a new one
3
+ //
4
+ // <section class="blog-comments" id="comments">
5
+ // <h2 class="blog-comments-title">Comments <span>(2)</span></h2>
6
+ // <article class="blog-comment" id="comment-1">
7
+ // <div class="blog-comment-head"><span class="avatar avatar-sm theme-info">PK</span>
8
+ // <span class="blog-comment-author">Petra Králová</span> <a href="#comment-1">#1</a> <time>…</time></div>
9
+ // <div class="blog-comment-content">text</div>
10
+ // <div class="blog-meta blog-comment-foot"><a href="#comment-form">Reply</a><span>In reply to: <a href="#comment-1">#1 Petra Králová</a></span></div>
11
+ // </article>
12
+ // <h3 class="blog-comment-form-title">Add a comment</h3>
13
+ // <div class="blog-comment-form" id="comment-form">form</div>
14
+ // </section>
15
+ //
16
+
17
+ .blog-comments {
18
+ padding-top: 1.5rem;
19
+ margin-top: 3rem;
20
+ }
21
+
22
+ .blog-comments-title {
23
+ margin-bottom: 1.5rem;
24
+ font-size: 1.5rem;
25
+
26
+ span {
27
+ font-weight: 400;
28
+ color: var(--bs-secondary-color);
29
+ }
30
+ }
31
+
32
+ // a comment: a tinted box; the one opened by its link (#comment-2) is stronger and is not hidden under the header
33
+ .blog-comment,
34
+ .blog-comment-form {
35
+ padding: 1.5rem;
36
+ background-color: var(--blog-tint-bg);
37
+ border-radius: var(--bs-border-radius-xl);
38
+ scroll-margin-top: 6rem;
39
+ }
40
+
41
+ .blog-comment {
42
+ & + & {
43
+ margin-top: 1rem;
44
+ }
45
+
46
+ &:target {
47
+ background-color: var(--blog-tint-hover-bg);
48
+ }
49
+ }
50
+
51
+ .blog-comment-head {
52
+ display: flex;
53
+ flex-wrap: wrap;
54
+ gap: .5rem;
55
+ align-items: center;
56
+ margin-bottom: .625rem;
57
+ color: var(--bs-secondary-color);
58
+
59
+ a {
60
+ color: inherit;
61
+ text-decoration: none;
62
+ }
63
+ }
64
+
65
+ .blog-comment-author {
66
+ font-weight: 600;
67
+ color: var(--bs-body-color);
68
+ }
69
+
70
+ // the text of a comment is 15px, between the 14px of the page and the 16px of the article
71
+ .blog-comment-content {
72
+ font-size: .9375rem;
73
+ line-height: 1.6;
74
+ }
75
+
76
+ // a link in the text of a comment (a reference to another comment too) is underlined: the theme draws links without
77
+ // a line, and in running text a color alone does not tell a link from the text (WCAG 1.4.1)
78
+ .blog-comment-content a {
79
+ text-decoration: underline;
80
+ text-underline-offset: .15em;
81
+ }
82
+
83
+ // the paragraphs and lists of a comment without the bottom margin of the last one, so the box stays even
84
+ .blog-comment-content > :last-child {
85
+ margin-bottom: 0;
86
+ }
87
+
88
+ .blog-comment-foot {
89
+ margin-top: .625rem;
90
+ }
91
+
92
+ .blog-comment-form {
93
+ // opened by "Reply" (#comment-form) it leaves room for its title, which stands over the box
94
+ scroll-margin-top: 9rem;
95
+
96
+ // a field on the tint is in the color of the page, so it is seen
97
+ .form-control {
98
+ background-color: var(--blog-page-bg);
99
+ }
100
+ }
101
+
102
+ // the title of the form stands over its box, like the title of the comments
103
+ .blog-comment-form-title {
104
+ margin-top: 2.5rem;
105
+ margin-bottom: 1rem;
106
+ font-size: 1.125rem;
107
+ font-weight: 600;
108
+ }
@@ -0,0 +1,18 @@
1
+ //
2
+ // blog: a website with a blog outside the administration: the list of articles, an article and its comments
3
+ //
4
+ // <body class="blog-page">
5
+ // <header class="blog-header"><nav class="navbar navbar-expand-lg"><div class="container">brand, links, theme switch, sign in</div></nav></header>
6
+ // <main class="container">…</main>
7
+ // <footer class="blog-footer"><div class="container">…</div></footer>
8
+ // </body>
9
+ //
10
+ // The parts: `.blog-title` (the heading of a page), `.blog-pills` (the categories), `.blog-featured` (the newest article over the whole row),
11
+ // `.blog-card` (an article of the list), `.blog-meta` (date, category, comments parted by dots), `.blog-author`, `.blog-article` (an article
12
+ // with its text in `.blog-content`), `.blog-comment` and `.blog-comment-form`.
13
+ //
14
+
15
+ @use 'page';
16
+ @use 'list';
17
+ @use 'article';
18
+ @use 'comments';
@@ -0,0 +1,246 @@
1
+ //
2
+ // blog: the list of articles: the heading, the categories, the newest article over the whole row and the cards
3
+ //
4
+
5
+ @use '../bootstrap' as bs;
6
+
7
+ // the heading of a page of the website
8
+ // <h1 class="blog-title">Blog</h1>
9
+ .blog-title {
10
+ margin-bottom: 1.5rem;
11
+ font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
12
+ font-weight: 600;
13
+ line-height: 1.2;
14
+ letter-spacing: -.02em;
15
+ }
16
+
17
+ // the heading with a link on its right (the latest articles of a home page with "All articles")
18
+ // <div class="blog-heading"><h1 class="blog-title">Latest articles</h1><a href="...">All articles →</a></div>
19
+ .blog-heading {
20
+ display: flex;
21
+ gap: 1rem;
22
+ align-items: baseline;
23
+ justify-content: space-between;
24
+ margin-bottom: 2rem;
25
+
26
+ > .blog-title {
27
+ margin-bottom: 0;
28
+ }
29
+
30
+ > a {
31
+ color: var(--bs-secondary-color);
32
+ white-space: nowrap;
33
+ }
34
+ }
35
+
36
+ // the categories: pills in a row, the chosen one in the primary color, the others tinted
37
+ // <nav class="blog-pills" aria-label="Categories"><a class="blog-pill active" href="..." aria-current="page">All</a><a class="blog-pill" href="...">News</a></nav>
38
+ .blog-pills {
39
+ display: flex;
40
+ flex-wrap: wrap;
41
+ gap: .5rem;
42
+ margin-bottom: 2.5rem;
43
+ }
44
+
45
+ .blog-pill {
46
+ padding: .375rem .875rem;
47
+ color: var(--bs-body-color);
48
+ text-decoration: none;
49
+ background-color: var(--blog-tint-bg);
50
+ border-radius: var(--bs-border-radius-pill);
51
+
52
+ &:hover,
53
+ &:focus-visible {
54
+ color: var(--bs-body-color);
55
+ background-color: var(--blog-tint-hover-bg);
56
+ }
57
+
58
+ &.active {
59
+ font-weight: 500;
60
+ color: #fff;
61
+ background-color: var(--bs-primary);
62
+ }
63
+ }
64
+
65
+ // date, category and comments in one line, parted by dots; its links are gray
66
+ // <div class="blog-meta"><time datetime="...">2 days ago</time><a href="...">News</a><a href="...">Comments: 3</a></div>
67
+ .blog-meta {
68
+ display: flex;
69
+ flex-wrap: wrap;
70
+ column-gap: .5rem;
71
+ align-items: center;
72
+ color: var(--bs-secondary-color);
73
+
74
+ > * + *::before {
75
+ display: inline-block;
76
+ margin-right: .5rem;
77
+ text-decoration: none;
78
+ content: '\00b7';
79
+ }
80
+
81
+ a {
82
+ color: inherit;
83
+ }
84
+ }
85
+
86
+ // the author: an avatar (of the theme) with the name, a date or other text under it
87
+ // <div class="blog-author"><span class="avatar theme-primary">JN</span><div><div class="blog-author-name">Jan Novák</div><time>2 days ago</time></div></div>
88
+ .blog-author {
89
+ display: flex;
90
+ gap: .625rem;
91
+ align-items: center;
92
+ color: var(--bs-secondary-color);
93
+ }
94
+
95
+ .blog-author-name {
96
+ font-weight: 600;
97
+ color: var(--bs-body-color);
98
+ }
99
+
100
+ // the title of an article in the list is the link of the whole block (stretched-link of Bootstrap); other links in
101
+ // the block get .blog-over to stay clickable above it. A hovered block underlines its title
102
+ .blog-card-title a {
103
+ color: var(--bs-emphasis-color);
104
+ text-decoration: none;
105
+ }
106
+
107
+ .blog-featured:hover .blog-card-title a,
108
+ .blog-card:hover .blog-card-title a {
109
+ text-decoration: underline;
110
+ text-underline-offset: .15em;
111
+ }
112
+
113
+ .blog-over {
114
+ position: relative;
115
+ z-index: 2;
116
+ }
117
+
118
+ // the newest article over the whole row: a large picture next to the title, the perex and the author; no background
119
+ // <article class="blog-featured">
120
+ // <div class="blog-featured-image"><img src="..." alt=""></div>
121
+ // <div class="blog-featured-body">
122
+ // <div class="blog-meta">…</div>
123
+ // <h2 class="blog-card-title"><a class="stretched-link" href="...">Title</a></h2>
124
+ // <p class="blog-card-text">Perex</p>
125
+ // <div class="blog-author">…</div>
126
+ // </div>
127
+ // </article>
128
+ .blog-featured {
129
+ position: relative;
130
+ display: grid;
131
+ grid-template-columns: 7fr 5fr;
132
+ gap: 2.5rem;
133
+ align-items: center;
134
+ margin-bottom: 2.5rem;
135
+
136
+ .blog-meta {
137
+ margin-bottom: .5rem;
138
+ }
139
+
140
+ .blog-card-title {
141
+ margin-bottom: .75rem;
142
+ font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
143
+ font-weight: 600;
144
+ line-height: 1.2;
145
+ letter-spacing: -.02em;
146
+ }
147
+
148
+ .blog-card-text {
149
+ margin-bottom: 1.5rem;
150
+ font-size: 1.125rem;
151
+ color: var(--bs-secondary-color);
152
+ }
153
+ }
154
+
155
+ .blog-featured-image {
156
+ aspect-ratio: 16 / 9;
157
+ overflow: hidden;
158
+ border-radius: var(--bs-border-radius-xl);
159
+
160
+ > img {
161
+ width: 100%;
162
+ height: 100%;
163
+ object-fit: cover;
164
+ object-position: top;
165
+ }
166
+ }
167
+
168
+ // an article of the list: a tinted card instead of a border, the whole card is a link; the footer with the author
169
+ // stays at its bottom, so the cards of a row are in line
170
+ // <article class="blog-card">
171
+ // <div class="blog-card-image"><img src="..." alt="" loading="lazy"></div>
172
+ // <div class="blog-meta">…</div>
173
+ // <h2 class="blog-card-title"><a class="stretched-link" href="...">Title</a></h2>
174
+ // <p class="blog-card-text">Perex</p>
175
+ // <div class="blog-card-footer"><div class="blog-author">…</div><a class="blog-over" href="...">Comments: 3</a></div>
176
+ // </article>
177
+ .blog-card {
178
+ position: relative;
179
+ display: flex;
180
+ flex-direction: column;
181
+ height: 100%;
182
+ padding: 1.5rem;
183
+ background-color: var(--blog-tint-bg);
184
+ border-radius: var(--bs-border-radius-xl);
185
+
186
+ &:hover {
187
+ background-color: var(--blog-tint-hover-bg);
188
+ }
189
+
190
+ .blog-meta {
191
+ margin-bottom: .5rem;
192
+ }
193
+
194
+ .blog-card-title {
195
+ margin-bottom: .5rem;
196
+ font-size: 1.125rem;
197
+ font-weight: 600;
198
+ line-height: 1.3;
199
+ }
200
+
201
+ // the perex of a card is cut after three lines
202
+ .blog-card-text {
203
+ display: -webkit-box;
204
+ margin-bottom: 0;
205
+ overflow: hidden;
206
+ color: var(--bs-secondary-color);
207
+ -webkit-box-orient: vertical;
208
+ -webkit-line-clamp: 3;
209
+ line-clamp: 3;
210
+ }
211
+ }
212
+
213
+ .blog-card-image {
214
+ aspect-ratio: 2 / 1;
215
+ margin-bottom: 1rem;
216
+ overflow: hidden;
217
+ border-radius: var(--bs-border-radius-lg);
218
+
219
+ > img {
220
+ width: 100%;
221
+ height: 100%;
222
+ object-fit: cover;
223
+ object-position: top;
224
+ }
225
+ }
226
+
227
+ .blog-card-footer {
228
+ display: flex;
229
+ gap: .5rem;
230
+ align-items: center;
231
+ justify-content: space-between;
232
+ padding-top: 1rem;
233
+ margin-top: auto;
234
+ color: var(--bs-secondary-color);
235
+
236
+ a {
237
+ color: inherit;
238
+ }
239
+ }
240
+
241
+ @include bs.media-breakpoint-down(lg) {
242
+ .blog-featured {
243
+ grid-template-columns: 1fr;
244
+ gap: 1.5rem;
245
+ }
246
+ }
@@ -0,0 +1,138 @@
1
+ //
2
+ // blog: the page, the header with the links of the website and the footer
3
+ //
4
+
5
+ @use '../bootstrap' as bs;
6
+
7
+ :root,
8
+ [data-bs-theme] {
9
+ --blog-page-bg: var(--bs-body-bg);
10
+ --blog-tint-bg: var(--bs-tertiary-bg);
11
+ // a hovered block: halfway from the tint to the secondary background (the secondary one itself was too strong)
12
+ --blog-tint-hover-bg: color-mix(in srgb, var(--blog-tint-bg) 50%, var(--bs-secondary-bg));
13
+ }
14
+
15
+ // in the light theme the tint is the page color of the administration and the shop (#f6f6f6 in the theme): there
16
+ // white boxes stand on it, here the header, the footer and the boxes in it stand on a white page
17
+ :root,
18
+ [data-bs-theme='light'] {
19
+ --blog-tint-bg: color-mix(in srgb, var(--bs-tertiary-bg) 98.4%, #000);
20
+ }
21
+
22
+ [data-bs-theme='dark'] {
23
+ --blog-tint-bg: var(--bs-tertiary-bg);
24
+ }
25
+
26
+ // the footer stays at the bottom of a short page
27
+ .blog-page {
28
+ display: flex;
29
+ flex-direction: column;
30
+ min-height: 100vh;
31
+ background-color: var(--blog-page-bg);
32
+
33
+ > main {
34
+ flex: 1 0 auto;
35
+ width: 100%;
36
+ padding-block: 2rem 3rem;
37
+ }
38
+ }
39
+
40
+ // the header is a tinted bar over the page (as the footer), it stays at the top while the page scrolls; inside is a
41
+ // navbar of Bootstrap, so the links fold into a menu on a phone
42
+ // <header class="blog-header"><nav class="navbar navbar-expand-lg"><div class="container">
43
+ // <a class="blog-brand" href="/">Logo <span>Name</span></a>
44
+ // <button class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#blog-menu">…</button>
45
+ // <div class="collapse navbar-collapse" id="blog-menu">
46
+ // <ul class="navbar-nav ms-auto"><li class="nav-item"><a class="nav-link active" href="/blog">Blog</a></li></ul>
47
+ // <div class="blog-header-actions">theme switch, sign in</div>
48
+ // </div>
49
+ // </div></nav></header>
50
+ .blog-header {
51
+ position: sticky;
52
+ top: 0;
53
+ z-index: 10;
54
+ background-color: var(--blog-tint-bg);
55
+
56
+ .navbar {
57
+ min-height: 4rem;
58
+ }
59
+
60
+ .navbar-toggler {
61
+ border: 0;
62
+ }
63
+
64
+ .nav-link.active {
65
+ font-weight: 600;
66
+ color: var(--bs-emphasis-color);
67
+ }
68
+ }
69
+
70
+ .blog-brand {
71
+ display: inline-flex;
72
+ gap: .625rem;
73
+ align-items: center;
74
+ font-weight: 600;
75
+ color: var(--bs-emphasis-color);
76
+ text-decoration: none;
77
+
78
+ // the brand is not underlined on hover like a link of the text
79
+ &:hover {
80
+ color: var(--bs-emphasis-color);
81
+ text-decoration: none;
82
+ }
83
+ }
84
+
85
+ .blog-header-actions {
86
+ display: flex;
87
+ flex-wrap: wrap;
88
+ gap: .5rem;
89
+ align-items: center;
90
+ margin-left: .5rem;
91
+ }
92
+
93
+ // the footer: the brand with a short text and columns of links
94
+ // <footer class="blog-footer"><div class="container"><div class="row g-4">
95
+ // <div class="col-lg-4">brand, text</div>
96
+ // <div class="col-6 col-md-4 col-lg-2"><h2 class="blog-footer-title">Links</h2><ul class="blog-footer-links"><li><a href="...">Blog</a></li></ul></div>
97
+ // </div></div></footer>
98
+ .blog-footer {
99
+ padding: 3rem 0;
100
+ margin-top: auto;
101
+ color: var(--bs-secondary-color);
102
+ background-color: var(--blog-tint-bg);
103
+ }
104
+
105
+ .blog-footer-title {
106
+ margin-bottom: .75rem;
107
+ font-size: 1rem;
108
+ font-weight: 600;
109
+ color: var(--bs-secondary-color);
110
+ }
111
+
112
+ .blog-footer-links {
113
+ padding: 0;
114
+ margin: 0;
115
+ list-style: none;
116
+
117
+ li + li {
118
+ margin-top: .5rem;
119
+ }
120
+
121
+ a {
122
+ color: var(--bs-body-color);
123
+ text-decoration: none;
124
+
125
+ &:hover {
126
+ color: var(--bs-emphasis-color);
127
+ text-decoration: underline;
128
+ }
129
+ }
130
+ }
131
+
132
+ @include bs.media-breakpoint-down(lg) {
133
+ // the folded menu: the actions under the links
134
+ .blog-header-actions {
135
+ padding-block: .5rem;
136
+ margin-left: 0;
137
+ }
138
+ }
@@ -0,0 +1,5 @@
1
+ //
2
+ // blog module of compostrap
3
+ //
4
+
5
+ @use 'blog/index';