Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function TemplateOverviewSkeleton() {
return (
<div className="flex flex-col gap-8">
<OverviewSection label="Template" divider={false}>
<div className="flex flex-wrap items-center justify-between gap-x-6 gap-y-2">
<div className="flex flex-col gap-1">
<Skeleton className="h-8 w-40" />
<Skeleton className="h-5 w-56" />
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import type { ReactNode } from 'react'
import type { CSSProperties, ReactNode } from 'react'
import type { TemplateDetail } from '@/core/modules/templates/models'
import { getTemplateDisplayName } from '@/features/dashboard/templates/helpers'
import { useClipboard } from '@/lib/hooks/use-clipboard'
Expand Down Expand Up @@ -35,8 +35,11 @@ export function TemplateSection({ template, teamSlug }: TemplateSectionProps) {

return (
<OverviewSection label="Template" divider={false}>
<div className="flex flex-wrap items-center justify-between gap-x-6 gap-y-2">
<h2 className="prose-value-big font-mono uppercase tracking-tight break-all">
<div className="@container flex flex-col gap-1">
Comment thread
drankou marked this conversation as resolved.
<h2
style={{ '--char-count': displayName.length } as CSSProperties}
className="prose-value-big-fit font-mono uppercase tracking-tight break-all"
>
{displayName}
</h2>
<TemplateIdCopy templateID={template.templateID} />
Expand Down
13 changes: 13 additions & 0 deletions src/styles/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,19 @@
font-weight: 700 !important;
}

/* Scales a monospace value down by character count to fit its container's
* inline size, avoiding line wrap. Requires `--char-count` and a container
* query context (e.g. Tailwind's `@container`). 0.6 ≈ glyph advance per em. */
@utility prose-value-big-fit {
font-size: clamp(
0.9375rem,
calc(100cqi / (var(--char-count, 1) * 0.6)),
2rem
) !important;
line-height: 1.1 !important;
font-weight: 700 !important;
}

/* Loader utilities */
@utility loader {
display: inline-flex;
Expand Down
Loading