0 Votes

Changes for page Home

Last modified by Alex Cotiugă on 2026/01/13 13:12

From version 7.79
edited by Alex Cotiugă
on 2025/11/13 20:56
Change comment: There is no comment for this version
To version 7.93
edited by Alex Cotiugă
on 2025/11/13 21:42
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -113,12 +113,24 @@
113 113   <section class="services" aria-labelledby="services-title">
114 114   <div class="container">
115 115   <h2 id="services-title">Services</h2>
116 - <p class="services-sub">All the XWiki services you need, delivered with precision and care</p>
117 - <div class="services-grid">
116 + <p class="lead">
117 + All the XWiki services you need, delivered with precision and care
118 + </p>
119 +
120 + #set ($servicesSize = $servicesSectionData.size())
121 + <div class="row services-grid" role="list">
118 118   #foreach ($entry in $servicesSectionData)
119 - <article class="service">
120 - <i class="fa fa-$entry.icon" aria-hidden="true"></i>
121 - <div class="body">
123 + #set ($classes = "service col-xs-12 col-sm-6")
124 + ## If this is the last item and the number of services is odd,
125 + ## center it on its own row on small+ screens
126 + #if ($foreach.count == $servicesSize && ($servicesSize % 2) == 1)
127 + #set ($classes = "$classes col-sm-offset-3")
128 + #end
129 + <div class="$classes" role="listitem">
130 + <div class="service-icon">
131 + <i class="fa fa-$entry.icon" aria-hidden="true"></i>
132 + </div>
133 + <div class="service-body">
122 122   <h4>$entry.title</h4>
123 123   <p>$entry.content</p>
124 124   <ul>
... ... @@ -127,7 +127,7 @@
127 127   #end
128 128   </ul>
129 129   </div>
130 - </article>
142 + </div>
131 131   #end
132 132   </div>
133 133   </div>
XWiki.StyleSheetExtension[0]
Code
... ... @@ -124,26 +124,28 @@
124 124   .widgets {
125 125   margin-top: 12px;
126 126  
127 - /* Flex layout = equal-height columns */
127 + /* Flex layout for equal-height and spacing */
128 128   display: flex;
129 129   flex-wrap: wrap;
130 + justify-content: space-between;
130 130  
131 - /* Cancel Bootstrap's outer gutters so cards align with heading */
132 - margin-left: -15px;
133 - margin-right: -15px;
134 -
135 135   .widget {
136 - /* Bootstrap grid classes (col-sm-6, col-md-3) still apply padding */
133 + box-sizing: border-box;
134 +
135 + /* Desktop (md+) – 4 per row */
136 + flex: 0 0 24%;
137 + max-width: 24%;
138 + margin-bottom: 16px;
139 +
140 + /* Card look */
137 137   display: flex;
138 138   flex-direction: column;
139 139   height: 100%;
140 -
141 - /* Card design */
144 + padding: 18px;
142 142   background: #fff;
143 143   border: 1px solid @line;
144 144   border-radius: @radius;
145 145   box-shadow: @shadow-sm;
146 - padding: 18px;
147 147   transition: transform .18s ease, box-shadow .18s ease;
148 148  
149 149   &:hover {
... ... @@ -158,14 +158,8 @@
158 158   padding-bottom: 6px;
159 159   margin-bottom: 8px;
160 160   border-bottom: 1px solid fade(@line, 60%);
161 -
162 - i { color: @brand; }
163 -
164 - h4 {
165 - margin: 0;
166 - line-height: 1.2;
167 - color: @text;
168 - }
163 + i { color: @brand; }
164 + h4 { margin: 0; line-height: 1.2; color: @text; }
169 169   }
170 170  
171 171   p {
... ... @@ -175,130 +175,86 @@
175 175   }
176 176   }
177 177  
174 + /* Tablet (sm–md) – 2 per row */
175 + @media (max-width: 991px) {
176 + .widget {
177 + flex: 0 0 48%;
178 + max-width: 48%;
179 + }
180 + }
181 +
182 + /* Mobile (xs) – 1 per row */
178 178   @media (max-width: 767px) {
179 179   .widget {
180 - margin-bottom: 16px; /* spacing between stacked items */
185 + flex: 0 0 100%;
186 + max-width: 100%;
181 181   }
182 182   }
183 183   }
184 184  
185 -
186 186   /* SERVICES */
187 187   .services {
188 - h2 {
189 - margin: 0 0 .3rem;
190 - }
191 -
192 - .services-sub {
193 - margin: 0 0 1.75rem;
194 - color: @muted;
195 - }
196 -
197 - /* Flex layout: 2 per row on desktop */
198 198   .services-grid {
199 - display: flex;
200 - flex-wrap: wrap;
201 - gap: 32px 36px; // row gap, column gap
202 - }
194 + margin-top: 12px;
203 203  
204 - .service {
205 - display: grid;
206 - grid-template-columns: 48px 1fr;
207 - gap: 16px;
208 - padding: 18px 0;
209 - border-top: 1px solid @line;
196 + .service {
197 + /* Bootstrap grid (col-sm-6) handles width & wrapping */
198 + margin-bottom: 24px;
210 210  
211 - /* two per row */
212 - flex: 1 1 calc(50% - 18px);
213 - max-width: calc(50% - 18px);
214 -
215 - /* first row: no top border */
216 - &:nth-of-type(-n + 2) {
217 - border-top: none;
218 - }
219 -
220 - > i {
221 - width: 42px;
222 - height: 42px;
223 - border-radius: 50%;
200 + /* Icon + text on a row */
224 224   display: flex;
225 - align-items: center;
226 - justify-content: center;
227 - font-size: 18px;
228 - color: @brand;
229 - background: fade(@brand, 10%);
230 - margin-top: 3px;
231 - }
202 + align-items: flex-start;
203 + gap: 16px;
232 232  
233 - .body {
234 - h4 {
235 - margin: 0 0 4px;
236 - font-size: 1.125rem;
237 - font-weight: 800;
205 + .service-icon {
206 + width: 42px;
207 + height: 42px;
208 + border-radius: 50%;
209 + display: flex;
210 + align-items: center;
211 + justify-content: center;
212 + font-size: 18px;
213 + color: @brand;
214 + background: fade(@brand, 10%);
215 + margin-top: 3px;
216 + flex-shrink: 0;
238 238   }
239 239  
240 - p {
241 - margin: 0 0 6px;
242 - color: @text;
243 - line-height: 1.5;
244 - }
219 + .service-body {
220 + h4 {
221 + margin: 0 0 4px;
222 + font-size: 1.125rem;
223 + font-weight: 800;
224 + }
245 245  
246 - ul {
247 - margin: .45rem 0 0;
248 - padding-left: 1.1rem;
249 - color: @muted;
250 - font-size: .95rem;
251 - }
226 + p {
227 + margin: 0 0 6px;
228 + color: @text;
229 + line-height: 1.5;
230 + }
252 252  
253 - li {
254 - margin: .25rem 0;
255 - line-height: 1.45;
232 + ul {
233 + margin: .45rem 0 0;
234 + padding-left: 1.1rem;
235 + color: @muted;
236 + font-size: .95rem;
237 + }
238 +
239 + li {
240 + margin: .25rem 0;
241 + line-height: 1.45;
242 + }
256 256   }
257 257   }
258 - }
259 259  
260 - /* If there is an odd number of services, center the last one */
261 - .services-grid > .service:last-child:nth-child(odd) {
262 - flex-basis: 100%;
263 - max-width: 680px;
264 - margin-left: auto;
265 - margin-right: auto;
266 - }
267 -
268 - /* Mobile: single column, full-width */
269 - @media (max-width: 760px) {
270 - .services-grid {
271 - gap: 20px;
272 - }
273 -
274 - .service {
275 - grid-template-columns: 40px 1fr;
276 - flex: 1 1 100%;
277 - max-width: 100%;
278 -
279 - /* reset border for all, then remove only on first */
280 - border-top: 1px solid @line;
281 -
282 - &:nth-of-type(1) {
283 - border-top: none;
246 + @media (max-width: 767px) {
247 + .service {
248 + margin-bottom: 20px;
284 284   }
285 -
286 - > i {
287 - width: 36px;
288 - height: 36px;
289 - font-size: 16px;
290 - }
291 291   }
292 -
293 - /* On mobile, last item behaves like all others */
294 - .services-grid > .service:last-child:nth-child(odd) {
295 - flex-basis: 100%;
296 - max-width: 100%;
297 - margin-left: 0;
298 - margin-right: 0;
299 - }
300 300   }
301 301   }
253 +
302 302   /* METRICS */
303 303   .metrics {
304 304   display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr);