Files
gitea/web_src/css/features/heatmap.css
silverwind 1d25bb22f4 Move heatmap to first-party code (#37262)
Replaces `@silverwind/vue3-calendar-heatmap` with an inlined SVG
implementation. Renders pixel-identically to `main`, drops the
`onMounted` legend viewBox workaround, and uses tippy's
`createSingleton` for the hover tooltip. Adds an e2e test for tooltip
display.

This is a prereq for migrating tippy.js to
[floating-ui](https://github.com/floating-ui/floating-ui) to avoid
having two tooltip libs active.

<img width="861" height="168" alt="image"
src="https://github.com/user-attachments/assets/99343cf6-6e09-42c7-a80d-63dbf33cf56a"
/>


---
This PR was written with the help of Claude Opus 4.7

---------

Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
Co-authored-by: Nicolas <bircni@icloud.com>
2026-04-20 20:15:45 +02:00

61 lines
1.5 KiB
CSS

#user-heatmap {
width: 100%;
font-size: 9px;
position: relative;
}
.activity-heatmap-container {
container-type: inline-size;
}
@container (width > 0) {
#user-heatmap {
/* Set element to fixed height so that it does not resize after load. The calculation is complex
because the element does not scale with a fixed aspect ratio. */
height: calc((100cqw / 5) - (100cqw / 25) + 20px);
}
}
/* Fallback height adjustment above for browsers that don't support container queries */
@supports not (container-type: inline-size) {
/* Before the Vue component is mounted, show a loading indicator with dummy size */
/* The ratio is guesswork for legacy browsers, new browsers use the "@container" approach above */
#user-heatmap.is-loading {
aspect-ratio: 5.4823972051; /* the size is about 816 x 148.84 */
}
.user.profile #user-heatmap.is-loading {
aspect-ratio: 5.6290608387; /* the size is about 953 x 169.3 */
}
}
#user-heatmap text {
fill: currentcolor !important;
}
#user-heatmap .heatmap-footer {
display: flex;
font-size: 11px;
justify-content: space-between;
}
/* "Less [colors] More" scale */
#user-heatmap .heatmap-legend {
display: flex;
align-items: center;
justify-content: right;
}
#user-heatmap .heatmap-legend-svg {
margin-right: -12px;
}
#user-heatmap .heatmap-legend > div:first-child,
#user-heatmap .heatmap-legend > div:last-child {
display: inline-block;
padding: 0 5px;
}
#user-heatmap .heatmap-day:hover {
outline: 1.5px solid var(--color-text);
}