ultimate-jekyll-manager 0.0.191 → 0.0.194
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/assets/css/pages/status/index.scss +27 -40
- package/dist/assets/js/core/exit-popup.js +0 -1
- package/dist/assets/js/pages/status/index.js +31 -12
- package/dist/commands/setup.js +1 -2
- package/dist/defaults/.github/workflows/build.yml +3 -0
- package/dist/defaults/dist/_layouts/themes/classy/frontend/pages/status.html +7 -7
- package/dist/gulp/tasks/sass.js +120 -102
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Status Page Styles
|
|
3
3
|
*
|
|
4
|
-
* Uses Bootstrap semantic colors:
|
|
5
|
-
* - success for operational (green)
|
|
6
|
-
* - warning for degraded (amber)
|
|
7
|
-
* - danger for major outage (red)
|
|
8
|
-
* - info for maintenance (blue)
|
|
4
|
+
* Uses Bootstrap semantic colors via bg-* classes:
|
|
5
|
+
* - bg-success for operational (green)
|
|
6
|
+
* - bg-warning for degraded (amber)
|
|
7
|
+
* - bg-danger for major outage (red)
|
|
8
|
+
* - bg-info for maintenance (blue)
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
// Status Pulse - size for the blinking dot (uses global animation-pulse class)
|
|
@@ -14,25 +14,25 @@
|
|
|
14
14
|
height: 8px;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
// Status Banner - gradient backgrounds based on
|
|
17
|
+
// Status Banner - gradient backgrounds based on Bootstrap color classes
|
|
18
18
|
.status-banner {
|
|
19
|
-
&.
|
|
20
|
-
background: linear-gradient(135deg, rgba(var(--bs-success-rgb), 0.1) 0%, rgba(var(--bs-success-rgb), 0.05) 100%);
|
|
19
|
+
&.bg-success {
|
|
20
|
+
background: linear-gradient(135deg, rgba(var(--bs-success-rgb), 0.1) 0%, rgba(var(--bs-success-rgb), 0.05) 100%) !important;
|
|
21
21
|
border-left: 4px solid var(--bs-success) !important;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
&.
|
|
25
|
-
background: linear-gradient(135deg, rgba(var(--bs-warning-rgb), 0.1) 0%, rgba(var(--bs-warning-rgb), 0.05) 100%);
|
|
24
|
+
&.bg-warning {
|
|
25
|
+
background: linear-gradient(135deg, rgba(var(--bs-warning-rgb), 0.1) 0%, rgba(var(--bs-warning-rgb), 0.05) 100%) !important;
|
|
26
26
|
border-left: 4px solid var(--bs-warning) !important;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
&.
|
|
30
|
-
background: linear-gradient(135deg, rgba(var(--bs-danger-rgb), 0.1) 0%, rgba(var(--bs-danger-rgb), 0.05) 100%);
|
|
29
|
+
&.bg-danger {
|
|
30
|
+
background: linear-gradient(135deg, rgba(var(--bs-danger-rgb), 0.1) 0%, rgba(var(--bs-danger-rgb), 0.05) 100%) !important;
|
|
31
31
|
border-left: 4px solid var(--bs-danger) !important;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
&.
|
|
35
|
-
background: linear-gradient(135deg, rgba(var(--bs-info-rgb), 0.1) 0%, rgba(var(--bs-info-rgb), 0.05) 100%);
|
|
34
|
+
&.bg-info {
|
|
35
|
+
background: linear-gradient(135deg, rgba(var(--bs-info-rgb), 0.1) 0%, rgba(var(--bs-info-rgb), 0.05) 100%) !important;
|
|
36
36
|
border-left: 4px solid var(--bs-info) !important;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -67,11 +67,7 @@
|
|
|
67
67
|
flex: 1 1 0;
|
|
68
68
|
min-width: 0;
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
&.status-degraded { background-color: var(--bs-warning); }
|
|
72
|
-
&.status-major { background-color: var(--bs-danger); }
|
|
73
|
-
&.status-maintenance { background-color: var(--bs-info); }
|
|
74
|
-
&.status-unknown { background-color: var(--bs-secondary-bg); }
|
|
70
|
+
// Uses Bootstrap bg-* classes for colors
|
|
75
71
|
|
|
76
72
|
&:hover {
|
|
77
73
|
transform: scaleY(1.2);
|
|
@@ -79,27 +75,21 @@
|
|
|
79
75
|
}
|
|
80
76
|
}
|
|
81
77
|
|
|
82
|
-
// Uptime Bar Legend
|
|
78
|
+
// Uptime Bar Legend - uses Bootstrap bg-* classes for colors
|
|
83
79
|
.uptime-bar-legend {
|
|
84
80
|
width: 16px;
|
|
85
81
|
height: 16px;
|
|
86
|
-
|
|
87
|
-
&.status-operational { background-color: var(--bs-success); }
|
|
88
|
-
&.status-degraded { background-color: var(--bs-warning); }
|
|
89
|
-
&.status-major { background-color: var(--bs-danger); }
|
|
90
|
-
&.status-maintenance { background-color: var(--bs-info); }
|
|
91
82
|
}
|
|
92
83
|
|
|
93
|
-
// Incident & Maintenance Cards - border colors
|
|
84
|
+
// Incident & Maintenance Cards - border colors based on Bootstrap classes
|
|
94
85
|
.incident-card,
|
|
95
86
|
.maintenance-card {
|
|
96
87
|
border-left: 4px solid var(--bs-border-color) !important;
|
|
97
88
|
|
|
98
|
-
&.
|
|
99
|
-
&.
|
|
100
|
-
&.
|
|
101
|
-
&.
|
|
102
|
-
&.status-maintenance { border-left-color: var(--bs-info) !important; }
|
|
89
|
+
&.border-success { border-left-color: var(--bs-success) !important; }
|
|
90
|
+
&.border-warning { border-left-color: var(--bs-warning) !important; }
|
|
91
|
+
&.border-danger { border-left-color: var(--bs-danger) !important; }
|
|
92
|
+
&.border-info { border-left-color: var(--bs-info) !important; }
|
|
103
93
|
}
|
|
104
94
|
|
|
105
95
|
// Incident Timeline - custom component
|
|
@@ -133,19 +123,20 @@
|
|
|
133
123
|
transform: translateX(-3px);
|
|
134
124
|
}
|
|
135
125
|
|
|
136
|
-
|
|
126
|
+
// Uses data attributes for timeline dot colors
|
|
127
|
+
&[data-status="warning"]::before {
|
|
137
128
|
background-color: var(--bs-warning);
|
|
138
129
|
border-color: var(--bs-warning);
|
|
139
130
|
}
|
|
140
|
-
|
|
131
|
+
&[data-status="danger"]::before {
|
|
141
132
|
background-color: var(--bs-danger);
|
|
142
133
|
border-color: var(--bs-danger);
|
|
143
134
|
}
|
|
144
|
-
|
|
135
|
+
&[data-status="info"]::before {
|
|
145
136
|
background-color: var(--bs-info);
|
|
146
137
|
border-color: var(--bs-info);
|
|
147
138
|
}
|
|
148
|
-
|
|
139
|
+
&[data-status="success"]::before {
|
|
149
140
|
background-color: var(--bs-success);
|
|
150
141
|
border-color: var(--bs-success);
|
|
151
142
|
}
|
|
@@ -162,13 +153,9 @@
|
|
|
162
153
|
pointer-events: none;
|
|
163
154
|
white-space: nowrap;
|
|
164
155
|
|
|
156
|
+
// Status dot uses Bootstrap bg-* classes
|
|
165
157
|
.status-dot {
|
|
166
158
|
width: 8px;
|
|
167
159
|
height: 8px;
|
|
168
|
-
|
|
169
|
-
&.status-operational { background-color: var(--bs-success); }
|
|
170
|
-
&.status-degraded { background-color: var(--bs-warning); }
|
|
171
|
-
&.status-major { background-color: var(--bs-danger); }
|
|
172
|
-
&.status-maintenance { background-color: var(--bs-info); }
|
|
173
160
|
}
|
|
174
161
|
}
|
|
@@ -30,7 +30,7 @@ export default (Manager) => {
|
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
// Configuration
|
|
33
|
+
// Configuration - maps status levels to Bootstrap classes
|
|
34
34
|
const config = {
|
|
35
35
|
selectors: {
|
|
36
36
|
statusBanner: '#status-banner',
|
|
@@ -42,11 +42,30 @@ const config = {
|
|
|
42
42
|
incidentsEmpty: '#incidents-empty',
|
|
43
43
|
subscribeForm: '#status-subscribe-form',
|
|
44
44
|
},
|
|
45
|
+
// Maps status levels to Bootstrap bg-* classes
|
|
45
46
|
statusClasses: {
|
|
46
|
-
operational: '
|
|
47
|
-
degraded: '
|
|
48
|
-
major: '
|
|
49
|
-
maintenance: '
|
|
47
|
+
operational: 'bg-success',
|
|
48
|
+
degraded: 'bg-warning',
|
|
49
|
+
major: 'bg-danger',
|
|
50
|
+
maintenance: 'bg-info',
|
|
51
|
+
},
|
|
52
|
+
// Maps status levels to Bootstrap border-* classes
|
|
53
|
+
borderClasses: {
|
|
54
|
+
operational: 'border-success',
|
|
55
|
+
degraded: 'border-warning',
|
|
56
|
+
major: 'border-danger',
|
|
57
|
+
maintenance: 'border-info',
|
|
58
|
+
resolved: 'border-success',
|
|
59
|
+
investigating: 'border-warning',
|
|
60
|
+
identified: 'border-danger',
|
|
61
|
+
monitoring: 'border-info',
|
|
62
|
+
},
|
|
63
|
+
// Maps incident status to data-status attribute values
|
|
64
|
+
dataStatusMap: {
|
|
65
|
+
investigating: 'warning',
|
|
66
|
+
identified: 'danger',
|
|
67
|
+
monitoring: 'info',
|
|
68
|
+
resolved: 'success',
|
|
50
69
|
},
|
|
51
70
|
statusLabels: {
|
|
52
71
|
operational: 'Operational',
|
|
@@ -81,13 +100,13 @@ function showUptimeTooltip(e, $bar, index, totalDays) {
|
|
|
81
100
|
const date = new Date();
|
|
82
101
|
date.setDate(date.getDate() - daysAgo);
|
|
83
102
|
|
|
84
|
-
// Get status from the bar's class
|
|
103
|
+
// Get status from the bar's Bootstrap bg-* class
|
|
85
104
|
let status = 'operational';
|
|
86
|
-
if ($bar.classList.contains('
|
|
105
|
+
if ($bar.classList.contains('bg-warning')) {
|
|
87
106
|
status = 'degraded';
|
|
88
|
-
} else if ($bar.classList.contains('
|
|
107
|
+
} else if ($bar.classList.contains('bg-danger')) {
|
|
89
108
|
status = 'major';
|
|
90
|
-
} else if ($bar.classList.contains('
|
|
109
|
+
} else if ($bar.classList.contains('bg-info')) {
|
|
91
110
|
status = 'maintenance';
|
|
92
111
|
}
|
|
93
112
|
|
|
@@ -360,7 +379,7 @@ function updateMaintenance(maintenanceItems) {
|
|
|
360
379
|
|
|
361
380
|
// Build maintenance cards
|
|
362
381
|
const html = maintenanceItems.map(item => `
|
|
363
|
-
<div class="card maintenance-card border-0 bg-body-tertiary mb-3
|
|
382
|
+
<div class="card maintenance-card border-0 bg-body-tertiary mb-3 border-info">
|
|
364
383
|
<div class="card-body p-4">
|
|
365
384
|
<div class="d-flex justify-content-between align-items-start mb-2">
|
|
366
385
|
<h4 class="h5 fw-semibold mb-0">${escapeHtml(item.title)}</h4>
|
|
@@ -409,7 +428,7 @@ function updateIncidents(incidents) {
|
|
|
409
428
|
|
|
410
429
|
// Build incident cards
|
|
411
430
|
const html = incidents.map(incident => `
|
|
412
|
-
<div class="card incident-card border-0 bg-body-tertiary mb-3
|
|
431
|
+
<div class="card incident-card border-0 bg-body-tertiary mb-3 ${config.borderClasses[incident.status] || ''}">
|
|
413
432
|
<div class="card-body p-4">
|
|
414
433
|
<div class="d-flex justify-content-between align-items-start mb-2 flex-wrap gap-2">
|
|
415
434
|
<h4 class="h5 fw-semibold mb-0">${escapeHtml(incident.title)}</h4>
|
|
@@ -421,7 +440,7 @@ function updateIncidents(incidents) {
|
|
|
421
440
|
${incident.updates && incident.updates.length > 0 ? `
|
|
422
441
|
<div class="incident-timeline mt-3">
|
|
423
442
|
${incident.updates.map(update => `
|
|
424
|
-
<div class="timeline-item status
|
|
443
|
+
<div class="timeline-item pb-3" data-status="${config.dataStatusMap[update.status] || ''}">
|
|
425
444
|
<div class="small text-muted mb-1">${formatDateTime(update.created_at)}</div>
|
|
426
445
|
<div class="small">${escapeHtml(update.message)}</div>
|
|
427
446
|
</div>
|
package/dist/commands/setup.js
CHANGED
|
@@ -826,8 +826,7 @@ async function migrateHooksToNestedStructure() {
|
|
|
826
826
|
|
|
827
827
|
// Check if new file already exists
|
|
828
828
|
if (jetpack.exists(newPath)) {
|
|
829
|
-
logger.warn(`⚠️
|
|
830
|
-
continue;
|
|
829
|
+
logger.warn(`⚠️ Migrate ${migration.old}: ${migration.new} already exists`);
|
|
831
830
|
}
|
|
832
831
|
|
|
833
832
|
// Move the file
|
|
@@ -51,6 +51,9 @@ jobs:
|
|
|
51
51
|
# - name: Run bundle install # TODO: [DEPRECATED] MIGRATE TO: bundle config set --local path 'vendor/bundle'
|
|
52
52
|
# run: |
|
|
53
53
|
# bundle install --path vendor/bundle
|
|
54
|
+
- name: Ensure Gemfile uses published gem (not local path)
|
|
55
|
+
run: |
|
|
56
|
+
sed -i 's|gem "jekyll-uj-powertools", path:.*|gem "jekyll-uj-powertools", "~> 1.0"|g' Gemfile
|
|
54
57
|
- name: Run bundle install
|
|
55
58
|
run: |
|
|
56
59
|
bundle install
|
|
@@ -80,7 +80,7 @@ incidents:
|
|
|
80
80
|
<!-- Overall Status Banner -->
|
|
81
81
|
<div class="row justify-content-center">
|
|
82
82
|
<div class="col-lg-10">
|
|
83
|
-
<div id="status-banner" class="card border-0 shadow-lg status-banner
|
|
83
|
+
<div id="status-banner" class="card border-0 shadow-lg status-banner bg-success" data-lazy="@class animation-slide-up">
|
|
84
84
|
<div class="card-body p-4">
|
|
85
85
|
<div class="d-flex align-items-center justify-content-between flex-wrap gap-3">
|
|
86
86
|
<div class="d-flex align-items-center gap-3">
|
|
@@ -111,7 +111,7 @@ incidents:
|
|
|
111
111
|
<div class="service-item py-3 border-bottom {% if forloop.last %}border-bottom-0{% endif %}" data-service-id="{{ service.id }}" data-lazy="@class animation-slide-up">
|
|
112
112
|
<div class="d-flex align-items-center justify-content-between mb-2">
|
|
113
113
|
<div class="d-flex align-items-center gap-2">
|
|
114
|
-
<span class="service-status-dot
|
|
114
|
+
<span class="service-status-dot" data-service-status="{{ service.id }}">
|
|
115
115
|
{% uj_icon "circle-check", "text-success" %}
|
|
116
116
|
</span>
|
|
117
117
|
{% iftruthy service.url %}
|
|
@@ -130,7 +130,7 @@ incidents:
|
|
|
130
130
|
</div>
|
|
131
131
|
<div class="uptime-bars d-flex gap-1 cursor-pointer" data-service-bars="{{ service.id }}" title="Uptime history for the last {{ page.resolved.status.days }} days">
|
|
132
132
|
{% for i in (1..90) %}
|
|
133
|
-
<div class="uptime-bar rounded-1
|
|
133
|
+
<div class="uptime-bar rounded-1 bg-success" data-day="{{ i }}"></div>
|
|
134
134
|
{% endfor %}
|
|
135
135
|
</div>
|
|
136
136
|
</div>
|
|
@@ -141,19 +141,19 @@ incidents:
|
|
|
141
141
|
<div class="mt-4 d-flex align-items-center justify-content-between flex-wrap gap-2 text-muted small" data-lazy="@class animation-slide-up">
|
|
142
142
|
<div class="d-flex align-items-center flex-wrap gap-2 gap-md-4">
|
|
143
143
|
<div class="d-flex align-items-center gap-1">
|
|
144
|
-
<div class="uptime-bar-legend rounded-1
|
|
144
|
+
<div class="uptime-bar-legend rounded-1 bg-success"></div>
|
|
145
145
|
<span>Operational</span>
|
|
146
146
|
</div>
|
|
147
147
|
<div class="d-flex align-items-center gap-1">
|
|
148
|
-
<div class="uptime-bar-legend rounded-1
|
|
148
|
+
<div class="uptime-bar-legend rounded-1 bg-warning"></div>
|
|
149
149
|
<span>Degraded</span>
|
|
150
150
|
</div>
|
|
151
151
|
<div class="d-flex align-items-center gap-1">
|
|
152
|
-
<div class="uptime-bar-legend rounded-1
|
|
152
|
+
<div class="uptime-bar-legend rounded-1 bg-danger"></div>
|
|
153
153
|
<span>Outage</span>
|
|
154
154
|
</div>
|
|
155
155
|
<div class="d-flex align-items-center gap-1">
|
|
156
|
-
<div class="uptime-bar-legend rounded-1
|
|
156
|
+
<div class="uptime-bar-legend rounded-1 bg-info"></div>
|
|
157
157
|
<span>Maintenance</span>
|
|
158
158
|
</div>
|
|
159
159
|
</div>
|
package/dist/gulp/tasks/sass.js
CHANGED
|
@@ -13,6 +13,7 @@ const { template } = require('node-powertools');
|
|
|
13
13
|
const yaml = require('js-yaml');
|
|
14
14
|
const postcss = require('gulp-postcss');
|
|
15
15
|
const purgeCss = require('@fullhuman/postcss-purgecss').default;
|
|
16
|
+
const through2 = require('through2');
|
|
16
17
|
|
|
17
18
|
// Load package
|
|
18
19
|
const package = Manager.getPackage('main');
|
|
@@ -125,6 +126,7 @@ function sass(complete) {
|
|
|
125
126
|
// Apply PurgeCSS if enabled
|
|
126
127
|
if (ENABLE_PURGECSS) {
|
|
127
128
|
logger.log('PurgeCSS enabled - removing unused CSS');
|
|
129
|
+
const purgeCssStartTime = performance.now();
|
|
128
130
|
|
|
129
131
|
// Define content patterns for PurgeCSS
|
|
130
132
|
const contentPatterns = [
|
|
@@ -193,109 +195,125 @@ function sass(complete) {
|
|
|
193
195
|
// });
|
|
194
196
|
|
|
195
197
|
// Apply PurgeCSS
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
198
|
+
const purgeCssPlugin = purgeCss({
|
|
199
|
+
content: contentPatterns,
|
|
200
|
+
// Safelist patterns for dynamic classes
|
|
201
|
+
safelist: {
|
|
202
|
+
standard: [
|
|
203
|
+
// Bootstrap JavaScript components
|
|
204
|
+
/^modal-/,
|
|
205
|
+
/^bs-/,
|
|
206
|
+
/^data-bs-/,
|
|
207
|
+
/^carousel-/,
|
|
208
|
+
/^collapse/,
|
|
209
|
+
/^dropdown-/,
|
|
210
|
+
/^offcanvas-/,
|
|
211
|
+
/^tooltip-/,
|
|
212
|
+
/^popover-/,
|
|
213
|
+
/^toast-/,
|
|
214
|
+
/^show$/,
|
|
215
|
+
/^showing$/,
|
|
216
|
+
/^hide$/,
|
|
217
|
+
/^fade$/,
|
|
218
|
+
/^active$/,
|
|
219
|
+
/^disabled$/,
|
|
220
|
+
|
|
221
|
+
// Accordion specific
|
|
222
|
+
/^accordion/,
|
|
223
|
+
/^collapsed$/,
|
|
224
|
+
/^collapsing$/,
|
|
225
|
+
|
|
226
|
+
// Common dynamic classes
|
|
227
|
+
/^is-/,
|
|
228
|
+
/^has-/,
|
|
229
|
+
/^was-/,
|
|
230
|
+
|
|
231
|
+
// Animations
|
|
232
|
+
/^animation-/,
|
|
233
|
+
|
|
234
|
+
// Utilities that might be added dynamically
|
|
235
|
+
/^[mp][trblxy]?-[0-9]+$/,
|
|
236
|
+
/^text-/,
|
|
237
|
+
/^bg-/,
|
|
238
|
+
/^border-/,
|
|
239
|
+
/^rounded-/,
|
|
240
|
+
/^shadow-/,
|
|
241
|
+
/^d-/,
|
|
242
|
+
/^flex-/,
|
|
243
|
+
/^justify-/,
|
|
244
|
+
/^align-/,
|
|
245
|
+
/^order-/,
|
|
246
|
+
/^overflow-/,
|
|
247
|
+
/^position-/,
|
|
248
|
+
/^w-/,
|
|
249
|
+
/^h-/,
|
|
250
|
+
/^mw-/,
|
|
251
|
+
/^mh-/,
|
|
252
|
+
/^min-/,
|
|
253
|
+
/^max-/,
|
|
254
|
+
|
|
255
|
+
// Utilities
|
|
256
|
+
/^ratio-/,
|
|
257
|
+
/^object-/,
|
|
258
|
+
|
|
259
|
+
// Libraries
|
|
260
|
+
// Cookies
|
|
261
|
+
/^cookie-consent-/,
|
|
262
|
+
|
|
263
|
+
// Font Awesome
|
|
264
|
+
/^fa-/,
|
|
265
|
+
|
|
266
|
+
// Lazy
|
|
267
|
+
/^lazy-/,
|
|
268
|
+
|
|
269
|
+
// Social
|
|
270
|
+
/^social-share-/,
|
|
271
|
+
],
|
|
272
|
+
deep: [
|
|
273
|
+
// Preserve input state pseudo-selectors (checkbox, radio, etc.)
|
|
274
|
+
/:checked/,
|
|
275
|
+
/:disabled/,
|
|
276
|
+
/:enabled/,
|
|
277
|
+
/:focus/,
|
|
278
|
+
/:hover/,
|
|
279
|
+
/:valid/,
|
|
280
|
+
/:invalid/,
|
|
281
|
+
],
|
|
282
|
+
greedy: [],
|
|
283
|
+
// Preserve keyframe animations
|
|
284
|
+
keyframes: [
|
|
285
|
+
/^spinner-/,
|
|
286
|
+
// /^accordion/,
|
|
287
|
+
// /^fade-/,
|
|
288
|
+
// /^slide-/,
|
|
289
|
+
// /^collapse/
|
|
290
|
+
]
|
|
291
|
+
},
|
|
292
|
+
// Don't remove CSS variables
|
|
293
|
+
variables: true,
|
|
294
|
+
// Keep keyframes
|
|
295
|
+
keyframes: true,
|
|
296
|
+
// Keep font-face rules
|
|
297
|
+
fontFace: true
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
// Pipe postcss and log timing when all files complete
|
|
301
|
+
let purgeCssLogged = false;
|
|
302
|
+
stream = stream
|
|
303
|
+
.pipe(postcss([purgeCssPlugin]))
|
|
304
|
+
.pipe(through2.obj(
|
|
305
|
+
function (file, enc, cb) {
|
|
306
|
+
cb(null, file);
|
|
290
307
|
},
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
308
|
+
function (cb) {
|
|
309
|
+
if (!purgeCssLogged) {
|
|
310
|
+
purgeCssLogged = true;
|
|
311
|
+
const purgeCssTime = ((performance.now() - purgeCssStartTime) / 1000).toFixed(2);
|
|
312
|
+
logger.log(`PurgeCSS completed in ${purgeCssTime}s`);
|
|
313
|
+
}
|
|
314
|
+
cb();
|
|
315
|
+
}
|
|
316
|
+
));
|
|
299
317
|
}
|
|
300
318
|
|
|
301
319
|
// Process
|