styling-sidebar-products
Skill721 starsChanged 2 months agoMITView on GitHub
How products and pages appear in the PostHog sidebar: which category they sit in, which icon and color they get, and which groups share a color gradient. Use when adding a product or data management page to the sidebar (treeItemsProducts or treeItemsMetadata in a products/*/manifest.tsx), giving an entry a new icon or color, moving an entry between sidebar categories, adding a category, or when a sidebar icon renders the wrong color, the wrong glyph, or differently once starred. Trigger terms: sidebar, nav, All products, Popular, category, iconType, iconColor, product icon, product color, gradient, starred icon.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- PostHog/posthogword for word, first seen Oct 4, 2026
Other versions1 project uses a version of this.
Word for word · 1
- PostHog/posthog★ 40k100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository119 other files it gives its agents.
- AGENTS.mdAGENTS.md
- common/AGENTS.mdAGENTS.md
- proto/AGENTS.mdAGENTS.md
- rust/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- common/CLAUDE.mdCLAUDE.md
- proto/CLAUDE.mdCLAUDE.md
- rust/CLAUDE.mdCLAUDE.md
- .cursor/rules/django-python.mdcCursor rule
- .cursor/rules/react-typescript.mdcCursor rule
- .cursor/rules/rust.mdcCursor rule
- adding-activity-loggingSkill
- adding-api-scopesSkill
- adding-inbound-webhooksSkill
- adding-inbox-sourcesSkill
- adding-ingestion-warningsSkill
- adding-mcp-store-serversSkill
- adding-personhog-rpcSkill
- adding-product-alertingSkill
- adding-project-secret-api-key-authSkill
- adopting-generated-api-typesSkill
- analyzing-experiment-precompute-canarySkill
- analyzing-experiment-query-performanceSkill
- analyzing-insights-across-teamsSkill
- announcing-behavior-changesSkill
- auditing-llm-gateway-paritySkill
- auditing-warehouse-source-coverageSkill
- authenticating-to-clickhouseSkill
- authoring-ci-workflowsSkill
- autoresolving-pr-conflictsSkill
- building-product-empty-statesSkill
- clickhouse-migrationsSkill
- debugging-ci-failuresSkill
- debugging-local-replaySkill
- debugging-local-task-agent-runsSkill
- debugging-mcp-analyticsSkill
- debugging-signals-pipelineSkill
- debugging-table-access-deniedSkill
- depot-ciSkill
- depot-container-buildsSkill
- depot-github-runnersSkill
- developing-subscriptionsSkill
- django-migrationsSkill
- django-startup-timeSkill
- documenting-warehouse-sourcesSkill
- editing-agents-mdSkill
- establishing-code-ownershipSkill
- extending-hobby-smoke-testsSkill
- extending-personhog-test-harnessSkill
- finding-llm-gateway-migration-candidatesSkill
- fixing-flaky-testsSkill
- gating-production-deploysSkill
- gating-sensitive-actionsSkill
- generating-clickhouse-query-performance-reportsSkill
- hogliSkill
- implementing-mcp-toolsSkill
- implementing-mcp-ui-appsSkill
- implementing-warehouse-sourcesSkill
- improving-drf-endpointsSkill
- improving-mcp-toolsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
One icon per entry: No two sidebar entries share a glyph.
- Very specific: line 34
If the icon type you want is also used outside the sidebar, for example event_definition or data_pipeline_metadata, add a new icon type …
- Very specific: line 37
One color, set in both places: Put the same color variable pair on the iconTypes entry and on the manifest entry's iconColor.
- Distinctive: line 39
When the two disagree, the product shows two colors across the app.
- Distinctive: line 40
Always give both a light and a dark variable, because a single value is reused for dark mode and reads poorly there.
- Distinctive: line 44
Do not add a per-surface icon override.
- Distinctive: line 59
When you add, remove or rename an entry in one of these categories, regenerate the whole category, since every step moves:
- Very specific: line 68
If an entry shared a variable with a product outside the group, give it its own variable first.
- Distinctive: line 73
Avoid the gradient families above, so a product does not look like it belongs to AI engineering, CDP, Schema or Tools.
- Very specific: line 78
After renaming or adding one, update CATEGORY_ORDER in productsCatalog.ts, update the old nav's CATEGORY_ORDER in ProjectTree/utils.tsx, …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Styling sidebar products
The sidebar reads every entry from the product manifests. An entry needs three things to look right: a category, an icon type that only it uses in the sidebar, and a color. Some categories share a gradient, so a new entry in one of them changes its neighbors' colors too.
Where things live
| What | File |
Entry definition (path, category, iconType, iconColor, href, flag) | products/<product>/manifest.tsx, under treeItemsProducts or treeItemsMetadata |
| Icon glyph and default color per icon type | iconTypes in frontend/src/layout/panel-layout/ProjectTree/defaultTree.tsx |
| The icon type union | FileSystemIconType in frontend/src/queries/schema/schema-general.ts |
| Color values | --color-product-<name>-light and -dark in frontend/src/styles/base.scss |
| Category names | ProductItemCategory in schema-general.ts |
| Category order in the sidebar | CATEGORY_ORDER in frontend/src/layout/panel-layout/navbar/tabs/productsCatalog.ts |
| Sidebar-only groupings (Popular, hidden tab pages, pinned rows) | navProductsTabLogic.ts and productsCatalog.ts in the same folder |
| Custom icons that are components, like the Support badge | ProjectTree/customIconRegistry.tsx |
Rules
One icon per entry. No two sidebar entries share a glyph.
If the icon type you want is also used outside the sidebar, for example event_definition or data_pipeline_metadata, add a new icon type instead of changing the shared one.
A new icon type goes into the FileSystemIconType union and the iconTypes map, and then hogli build:schema regenerates the Python enums.
One color, set in both places. Put the same color variable pair on the iconTypes entry and on the manifest entry's iconColor.
The sidebar row uses the manifest color. Scene titles, search and other surfaces use the map color.
When the two disagree, the product shows two colors across the app.
Always give both a light and a dark variable, because a single value is reused for dark mode and reads poorly there.
Starred entries follow the product. A star stores only iconType || type and href.
The file tree looks up the product by href (getProductIcon in defaultTree.tsx) and uses its icon and color, and it wraps custom icons in ProductIconWrapper.
Do not add a per-surface icon override. Fix the manifest and the map, and the star follows.
Pinned rows stay neutral. Home, Self-driving and Activity and people have no color on purpose.
Color families
Four categories use one gradient each. The steps follow the order the sidebar shows, which is alphabetical by label.
| Category | Gradient | Light end points |
| AI engineering | indigo to magenta | rgb(99 102 241) to rgb(196 60 218) |
| CDP | golden yellow to burnt orange | rgb(234 179 8) to rgb(194 65 12) |
| Schema | teal to deep blue | rgb(20 184 166) to rgb(29 78 216) |
| Tools | red to magenta pink | rgb(239 68 68) to rgb(217 40 160) |
When you add, remove or rename an entry in one of these categories, regenerate the whole category, since every step moves:
python3 .agents/skills/styling-sidebar-products/scripts/sidebar_gradient.py schema \
actions annotations event-definitions mcp-servers sql-variablesPass the color variable names in sidebar order, and include entries behind a feature flag.
Paste the output over the matching lines in base.scss.
If an entry shared a variable with a product outside the group, give it its own variable first. warehouse-destinations is an example: it used to share with Data ops.
The end points, including dark mode, live in the script. Change them there, not by hand in base.scss.
The other categories (Popular, Data, Monitoring, Product engineering, Messaging, Unreleased) use each product's own brand color. Pick a hue that differs from the entries right next to it in the same category. Avoid the gradient families above, so a product does not look like it belongs to AI engineering, CDP, Schema or Tools.
Categories
Categories are values of ProductItemCategory, and the backend reads them through products.json.
After renaming or adding one, update CATEGORY_ORDER in productsCatalog.ts, update the old nav's CATEGORY_ORDER in ProjectTree/utils.tsx, and update test_get_products_by_category_has_expected_categories in posthog/test/test_products.py.
Then run hogli build:schema and pnpm --filter=@posthog/frontend build:products.
Popular is sidebar-only. It lives in POPULAR_PRODUCT_PATHS and does not change a product's real category.
Pages that are tabs of another page, like the definitions tabs, stay in their manifest but are hidden in navProductsTabLogic.ts.
Check it
hogli test frontend/src/layout/panel-layoutruns the sidebar logic tests. It also checks that every starred product renders the same icon and color as its row, inProjectTree/utils.test.ts.- Render the
Layout/Products and filesstory in light and dark (Darkstory), and look at the whole category, not only the new entry. A gradient reads wrong when one step is off. - Storybook does not hot-reload
base.scss. Restart it after changing a color, or it keeps rendering the old values. - Neighboring steps need visible contrast. When steps look alike, widen the end points in hue and lightness rather than adding more steps.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

