Skip to content

Commit 3cf6803

Browse files
dermatzCopilot
andauthored
feat: add new color group styles to toolbar (#188)
* feat: add new color variables and group styles to toolbar CSS; update createMenuItem to accept groupKey * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: scope purple variable and increase hover specificity for group labels * fix: simplify warning display logic in CompatibilityChecker * fix: rename purple color variable and update groupKey data attribute in toolbar --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent a63cafb commit 3cf6803

3 files changed

Lines changed: 37 additions & 6 deletions

File tree

src/Service/Hyva/CompatibilityChecker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ private function getStatusDisplay(array $moduleData): string
203203
return '<fg=green>✓ Compatible</>';
204204
}
205205

206-
if ($moduleData['compatible'] && $moduleData['hasWarnings']) {
206+
if ($moduleData['compatible']) {
207207
return '<fg=yellow>⚠ Warnings</>';
208208
}
209209

src/view/frontend/web/css/toolbar.css

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
--mageforge-color-slate-400: #94a3b8;
2323
--mageforge-color-orange: #fb923c;
2424
--mageforge-color-pink: #C850C0;
25+
--mageforge-color-purple: #a855f7;
2526
--mageforge-color-amber: #edb04d;
27+
--mageforge-group-color-wcag: var(--mageforge-color-purple);
28+
--mageforge-group-color-html-quality: var(--mageforge-color-blue);
29+
--mageforge-group-color-performance: var(--mageforge-color-orange);
2630
--mageforge-color-amber-alpha-15: rgba(237, 176, 77, 0.15);
2731
--mageforge-color-amber-alpha-35: rgba(237, 176, 77, 0.35);
2832
--mageforge-bg-dark: rgba(15, 23, 42, 0.98);
@@ -332,7 +336,7 @@
332336
font-size: 11px;
333337
line-height: 1.3;
334338
user-select: text;
335-
cursor: text;
339+
cursor: default;
336340
}
337341

338342
.mageforge-toolbar-menu-desc.mageforge-active {
@@ -405,7 +409,7 @@
405409
margin-bottom: 4px;
406410
}
407411

408-
.mageforge-toolbar-menu-group-header:hover .mageforge-toolbar-menu-group-label,
412+
.mageforge-toolbar-menu-group .mageforge-toolbar-menu-group-header:hover .mageforge-toolbar-menu-group-label,
409413
.mageforge-toolbar-menu-group-header:hover .mageforge-toolbar-menu-group-chevron {
410414
color: var(--mageforge-color-white);
411415
}
@@ -417,7 +421,31 @@
417421
text-transform: uppercase;
418422
transition: color 0.15s ease;
419423
letter-spacing: 0.08em;
420-
color: var(--mageforge-color-orange);
424+
color: var(--mageforge-color-slate-400);
425+
}
426+
427+
.mageforge-toolbar-menu-group[data-group-key="wcag"] .mageforge-toolbar-menu-group-label {
428+
color: var(--mageforge-group-color-wcag);
429+
}
430+
431+
.mageforge-toolbar-menu-group[data-group-key="html-quality"] .mageforge-toolbar-menu-group-label {
432+
color: var(--mageforge-group-color-html-quality);
433+
}
434+
435+
.mageforge-toolbar-menu-group[data-group-key="performance"] .mageforge-toolbar-menu-group-label {
436+
color: var(--mageforge-group-color-performance);
437+
}
438+
439+
.mageforge-toolbar-menu-item[data-group-key="wcag"] .mageforge-toolbar-menu-icon {
440+
color: var(--mageforge-group-color-wcag);
441+
}
442+
443+
.mageforge-toolbar-menu-item[data-group-key="html-quality"] .mageforge-toolbar-menu-icon {
444+
color: var(--mageforge-group-color-html-quality);
445+
}
446+
447+
.mageforge-toolbar-menu-item[data-group-key="performance"] .mageforge-toolbar-menu-icon {
448+
color: var(--mageforge-group-color-performance);
421449
}
422450

423451
.mageforge-toolbar-menu-group-chevron {

src/view/frontend/web/js/toolbar/ui.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ export const uiMethods = {
264264
audit.icon,
265265
audit.label,
266266
audit.description,
267-
() => this.runAudit(audit.key)
267+
() => this.runAudit(audit.key),
268+
key
268269
));
269270
});
270271

@@ -280,13 +281,15 @@ export const uiMethods = {
280281
* @param {string} label
281282
* @param {string} description
282283
* @param {Function} callback
284+
* @param {?string} groupKey - Optional parent group key for the item
283285
* @return {HTMLButtonElement}
284286
*/
285-
createMenuItem(key, icon, label, description, callback) {
287+
createMenuItem(key, icon, label, description, callback, groupKey = null) {
286288
const item = document.createElement('button');
287289
item.type = 'button';
288290
item.className = 'mageforge-toolbar-menu-item';
289291
item.dataset.auditKey = key;
292+
if (groupKey) item.dataset.groupKey = groupKey;
290293
item.setAttribute('aria-pressed', 'false');
291294

292295
const iconEl = document.createElement('span');

0 commit comments

Comments
 (0)