Skip to content

Commit b155295

Browse files
committed
Improve homepage layout and add icon guidelines
- Move results count next to search bar for better grouping - Constrain search bar width to 850px (fixed) so results count stays adjacent - Add icon guidelines to design system (prefer SVG, store in assets/icons/) - Maintain alignment between controls wrapper and catalog grid
1 parent fc7a3d0 commit b155295

3 files changed

Lines changed: 62 additions & 18 deletions

File tree

docs/design-system.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,38 @@ These principles ensure visual consistency and clear interaction patterns across
573573

574574
**Exception:** Small icon-only buttons may use `--radius-medium` (8px) when the button size is very small (≤32px).
575575

576+
### 5. Icons and Assets
577+
578+
**Rule:** Always use SVG icons. PNG is acceptable only when SVG is not available. All icons must be stored in `assets/icons/`.
579+
580+
```html
581+
<!-- ✅ CORRECT - SVG icon from assets/icons/ -->
582+
<img src="assets/icons/api-filter-icon.svg" width="16" height="16" alt="">
583+
584+
<!-- ✅ CORRECT - Inline SVG for interactive icons -->
585+
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" width="20" height="20">
586+
<path d="M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12Z"></path>
587+
</svg>
588+
589+
<!-- ⚠️ ACCEPTABLE - PNG only if SVG unavailable -->
590+
<img src="assets/icons/legacy-icon.png" width="16" height="16" alt="">
591+
592+
<!-- ❌ WRONG - Icon not in assets/icons/ -->
593+
<img src="images/icon.svg" width="16" height="16" alt="">
594+
```
595+
596+
**Why:**
597+
- SVG icons are scalable, crisp at any resolution, and easily styled with CSS
598+
- Centralized `assets/icons/` directory makes icon management consistent
599+
- Inline SVG allows `fill="currentColor"` to inherit text color for theme consistency
600+
601+
**Icon Guidelines:**
602+
- Prefer inline SVG for icons that change color or respond to interactions
603+
- Use `<img>` tags for static decorative icons
604+
- Always specify `width` and `height` attributes for performance
605+
- Use `currentColor` for fill/stroke when icons should match text color
606+
- Name icon files descriptively (e.g., `api-filter-icon.svg`, `skill-filter-icon.svg`)
607+
576608
---
577609

578610
## Quick Reference Cheat Sheet

scripts/portal_generator/assets/styles.css

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,11 +610,11 @@ code {
610610

611611
.tag-search-wrapper {
612612
position: relative;
613-
width: 100%;
614613
display: flex;
615614
align-items: center;
616615
gap: 12px;
617-
flex: 1;
616+
flex: 0 1 auto;
617+
max-width: 850px;
618618
}
619619

620620
.search-icon-catalog {
@@ -628,9 +628,19 @@ code {
628628

629629
/* Catalog Results Header */
630630
.catalog-results-header {
631+
display: flex;
632+
align-items: center;
633+
justify-content: space-between;
634+
gap: var(--space-lg);
635+
margin-right: 60px;
636+
}
637+
638+
.catalog-search-and-results {
631639
display: flex;
632640
align-items: center;
633641
gap: var(--space-lg);
642+
flex: 1;
643+
min-width: 0;
634644
}
635645

636646
.results-count {
@@ -639,6 +649,7 @@ code {
639649
margin: 0;
640650
white-space: nowrap;
641651
flex-shrink: 0;
652+
color: var(--color-text-secondary);
642653
}
643654

644655
/* Catalog Stats (Very Subtle Decorator) */
@@ -696,14 +707,13 @@ code {
696707
align-items: center;
697708
gap: var(--space-xx-small);
698709
padding: 8px 16px 8px 46px;
699-
max-width: 850px;
710+
width: 850px;
700711
border: 1.5px solid var(--color-gray-300);
701712
border-radius: 24px;
702713
background: var(--color-white);
703714
min-height: 30px;
704715
cursor: text;
705716
transition: all 0.2s;
706-
flex: 1;
707717
margin-left: -32px;
708718
}
709719

scripts/portal_generator/templates/homepage.html

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,24 @@ <h1 class="hero-title">MuleSoft Platform Developer Portal</h1>
3131
<div class="catalog-main-content">
3232
<div class="catalog-controls-wrapper">
3333
<div class="catalog-results-header">
34-
<div class="tag-search-wrapper">
35-
<svg class="search-icon-catalog" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false">
36-
<path d="M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12Zm-8 6a8 8 0 1 1 14.32 4.906l4.387 4.387a1 1 0 0 1-1.414 1.414l-4.387-4.387A8 8 0 0 1 2 10Z"></path>
37-
</svg>
38-
<div class="tag-search-input-container" id="tagSearchInputContainer">
39-
<div class="selected-tags" id="selectedTags"></div>
40-
<input type="text"
41-
id="tagSearchInput"
42-
class="tag-search-input"
43-
placeholder="Search by tags"
44-
aria-label="Search by tags"
45-
autocomplete="off">
34+
<div class="catalog-search-and-results">
35+
<div class="tag-search-wrapper">
36+
<svg class="search-icon-catalog" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false">
37+
<path d="M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12Zm-8 6a8 8 0 1 1 14.32 4.906l4.387 4.387a1 1 0 0 1-1.414 1.414l-4.387-4.387A8 8 0 0 1 2 10Z"></path>
38+
</svg>
39+
<div class="tag-search-input-container" id="tagSearchInputContainer">
40+
<div class="selected-tags" id="selectedTags"></div>
41+
<input type="text"
42+
id="tagSearchInput"
43+
class="tag-search-input"
44+
placeholder="Search by tags"
45+
aria-label="Search by tags"
46+
autocomplete="off">
47+
</div>
48+
<div class="tag-suggestions" id="tagSuggestions" style="display: none;"></div>
4649
</div>
47-
<div class="tag-suggestions" id="tagSuggestions" style="display: none;"></div>
50+
<h2 class="results-count"><span id="resultsType">All</span> (<span id="resultsCount">{{ apis|length + (all_skills|length if all_skills else 0) }}</span> Results)</h2>
4851
</div>
49-
<h2 class="results-count"><span id="resultsType">All</span> (<span id="resultsCount">{{ apis|length + (all_skills|length if all_skills else 0) }}</span> Results)</h2>
5052
<div class="catalog-controls-right">
5153
<button class="sort-btn" aria-label="Sort options">
5254
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" width="14" height="14" class="block shrink-0 text-current" aria-hidden="true" focusable="false" style="margin-right: 6px;">

0 commit comments

Comments
 (0)