diff --git a/src/lib/components/stats/AtRules.svelte b/src/lib/components/stats/AtRules.svelte
index 647d27b..f89456d 100644
--- a/src/lib/components/stats/AtRules.svelte
+++ b/src/lib/components/stats/AtRules.svelte
@@ -30,26 +30,32 @@
Composition
-
+ {#if atrules.total > 0}
+
+ {/if}
-
- )
- .map(([atrule_name, locations]) => ({
- value: `@${atrule_name}`,
- count: locations.length,
- locations
- }))
- .sort((a, b) => b.count - a.count)}
- column_headers={['Atrule name', 'Count']}
- node_type="atrule"
- />
+ {#if atrules.total > 0}
+
+ )
+ .map(([atrule_name, locations]) => ({
+ value: `@${atrule_name}`,
+ count: locations.length,
+ locations
+ }))
+ .sort((a, b) => b.count - a.count)}
+ column_headers={['Atrule name', 'Count']}
+ node_type="atrule"
+ />
+ {:else}
+ No atrules found
+ {/if}
diff --git a/src/lib/components/stats/Report.svelte b/src/lib/components/stats/Report.svelte
index 26daa7d..0c42dcf 100644
--- a/src/lib/components/stats/Report.svelte
+++ b/src/lib/components/stats/Report.svelte
@@ -31,6 +31,7 @@
.group {
display: grid;
gap: var(--space-8);
+ container-type: inline-size;
@media (min-width: 66rem) {
gap: var(--space-16);
diff --git a/src/lib/components/stats/Selectors.svelte b/src/lib/components/stats/Selectors.svelte
index a050349..943349a 100644
--- a/src/lib/components/stats/Selectors.svelte
+++ b/src/lib/components/stats/Selectors.svelte
@@ -21,7 +21,12 @@
interface ValueCountPanelProps {
panel_id: string
title: string
- data: { total: number; totalUnique: number; uniquenessRatio: number; uniqueWithLocations: Record }
+ data: {
+ total: number
+ totalUnique: number
+ uniquenessRatio: number
+ uniqueWithLocations: Record
+ }
list_id: string
empty_message: string
sort_options?: (typeof alphabetical_sorting)[]
@@ -103,7 +108,14 @@
}
-{#snippet value_count_panel({ panel_id, title, data, list_id, empty_message, sort_options = [alphabetical_sorting] }: ValueCountPanelProps)}
+{#snippet value_count_panel({
+ panel_id,
+ title,
+ data,
+ list_id,
+ empty_message,
+ sort_options = [alphabetical_sorting]
+}: ValueCountPanelProps)}
{title}
diff --git a/src/lib/css/style.css b/src/lib/css/style.css
index 16da124..303a854 100644
--- a/src/lib/css/style.css
+++ b/src/lib/css/style.css
@@ -577,14 +577,52 @@
.report-section {
display: grid;
- /* Expensive elements to render, so enable content-visibility */
- content-visibility: auto;
+
+ /* Only apply when no target inside, otherwise :target styles get clipped */
+ &:not(:has(:target)) {
+ /* Expensive elements to render, so enable content-visibility */
+ content-visibility: auto;
+ }
/* Making this larger than 24rem will cause horizontal overflows */
grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr));
gap: var(--space-4);
align-items: start;
margin-top: var(--space-4);
+
+ @container (min-width: 33rem) {
+ gap: var(--space-6);
+ }
+
+ @container (min-width: 55rem) {
+ gap: var(--space-8);
+ }
+
+ /* Use as progressive enhancement until we have grid-lanes */
+ @supports (grid-template-rows: masonry) and (not (display: grid-lanes)) {
+ grid-template-rows: masonry;
+ }
+
+ @supports (display: grid-lanes) {
+ display: grid-lanes;
+ }
+
+ & :target {
+ scroll-margin: var(--space-8);
+ outline: 4px dashed var(--fg-400);
+ outline-offset: 4px;
+ animation-delay: 1s;
+ animation-fill-mode: forwards;
+ animation-duration: 2s;
+ animation-name: target-highlight;
+ animation-timing-function: ease-in-out;
+ }
+ }
+
+ @keyframes target-highlight {
+ to {
+ outline-color: transparent;
+ }
}
.report-section-full-width {