skills/print-css/SKILL.md
Write production-ready print stylesheets. Covers @page rules, page breaks, visibility, color management, typography, images, links, tables, and framework-specific gotchas for Next.js/React/Tailwind. Use when the user asks to add print styles, make a page printable, or create a print-friendly layout.
npx skillsauth add baphomet480/claude-skills print-cssInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a print stylesheet specialist. You write @media print styles that make web pages look intentional on paper -- not like someone hit Cmd+P on a web page.
Every print stylesheet follows this structure, in order:
@media print {
/* 1. Page setup */
@page { size: letter; margin: 0.5in 0.6in; }
/* 2. Force color reproduction */
* {
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
}
/* 3. Base typography */
body {
background: white !important;
color: #1a1a1a !important;
font-size: 10.5pt;
line-height: 1.6;
}
/* 4. Kill web-only elements */
nav, .no-print, footer, .cookie-banner { display: none !important; }
/* 5. Kill animations */
*, *::before, *::after {
animation: none !important;
transition: none !important;
}
/* 6. Flatten layouts */
/* ... framework-specific resets ... */
/* 7. Page break control */
h1, h2, h3 { page-break-after: avoid; break-after: avoid-page; }
tr, img, blockquote { page-break-inside: avoid; break-inside: avoid-page; }
p { orphans: 3; widows: 3; }
/* 8. Images */
img { max-width: 100%; max-height: 3in; }
/* 9. Links */
a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
a[href^="#"]::after { content: ""; }
/* 10. Tables */
thead { display: table-header-group; }
tfoot { display: table-footer-group; }
}
@page {
size: letter; /* or: A4, 210mm 297mm, landscape */
margin: 0.5in 0.6in; /* top/bottom left/right */
}
@page :first {
margin-top: 1in; /* extra space for cover page */
}
Available sizes: letter (8.5x11in), A4 (210x297mm), A3, A5, legal, or explicit dimensions.
Gotchas:
Use both legacy and modern properties for maximum browser support:
/* Prevent breaking inside an element */
.card, tr, figure {
page-break-inside: avoid;
break-inside: avoid-page;
}
/* Force a break before a section */
.chapter {
page-break-before: always;
break-before: page;
}
/* Prevent a break right after a heading */
h1, h2, h3 {
page-break-after: avoid;
break-after: avoid-page;
}
Prevent stranded lines at page boundaries:
p {
orphans: 3; /* minimum lines at bottom of page */
widows: 3; /* minimum lines at top of next page */
}
Gotchas:
page-break-inside: avoid does not work reliably on flex or grid containers. Switch to display: block in print.break-inside: avoid can push content to the next page unpredictably.@media print {
nav,
.sidebar,
.cookie-banner,
.social-share,
.comments,
.ads,
.chat-widget,
.search-bar,
.no-print {
display: none !important;
}
}
.print-only {
display: none; /* hidden on screen */
}
@media print {
.print-only {
display: block; /* visible on paper */
}
}
Use display: none !important (not visibility: hidden) -- visibility preserves layout space and wastes paper.
Controls whether the browser can optimize colors for print:
* {
-webkit-print-color-adjust: exact !important; /* Safari/older Chrome */
print-color-adjust: exact !important; /* standard */
}
exact -- preserves declared colors (even if ink-heavy)economy (default) -- browser may strip backgrounds, adjust colorsRemap web colors to print-friendly equivalents:
@media print {
body {
background: white !important;
color: #1a1a1a !important;
}
/* Vibrant accent becomes muted for paper */
.text-coral { color: #A03030 !important; }
/* Dark backgrounds become white with borders */
.dark-card {
background: white !important;
border: 1px solid #ccc !important;
}
}
Rule of thumb: If it's readable on white paper at arm's length, it works.
Points render consistently across browsers and printers:
@media print {
body {
font-size: 10.5pt;
line-height: 1.6;
}
h1 { font-size: 24pt; }
h2 { font-size: 18pt; }
h3 { font-size: 14pt; }
code { font-size: 9pt; }
}
Serif fonts are more readable on paper:
@media print {
body { font-family: Georgia, 'Times New Roman', serif; }
code, pre { font-family: 'Courier New', monospace; }
}
Gotchas:
@media print {
img {
max-width: 100%;
max-height: 3in; /* prevent full-page images */
}
/* Hide decorative images */
.hero-image,
.background-image,
.decorative {
display: none !important;
}
/* Remove gradient overlays that hide content */
[class*="bg-gradient"][class*="absolute"] {
display: none !important;
}
}
Gotchas:
print-color-adjust: exact or move content to <img> tags.srcset may not load correctly in print preview.@media print {
a[href^="http"]::after {
content: " (" attr(href) ")";
font-size: 0.8em;
color: #666;
}
/* Don't show URLs on anchor links */
a[href^="#"]::after { content: ""; }
/* Don't show URLs on links that already describe their destination */
a.no-print-url::after { content: ""; }
}
Gotcha: attr(href) shows the full URL, which can be very long. Consider truncating with max-width and overflow: hidden on the ::after pseudo-element, or use custom content for known links.
@media print {
/* Repeat header on each page */
thead { display: table-header-group; }
tfoot { display: table-footer-group; }
/* Prevent row splitting */
tr {
page-break-inside: avoid;
break-inside: avoid-page;
}
/* Ensure borders print */
table { border-collapse: collapse; width: 100%; }
th, td {
border: 1px solid #000;
padding: 4pt 6pt;
}
}
next/image with fill breaks in print:
@media print {
/* next/image fill uses absolute positioning -- force to static */
[data-nimg="fill"],
img[style*="position: absolute"] {
position: static !important;
width: 100% !important;
height: auto !important;
}
/* Fix fill containers */
[style*="position: relative"] {
position: relative !important;
overflow: visible !important;
}
}
Where to put print styles: Use @media print in globals.css, not component-scoped styles. Print styles need global scope to override everything.
Discussion: vercel/next.js#23039
@media print blocks normally.@media print {
/* Kill viewport height constraints */
.min-h-screen, .min-h-svh, .h-screen { min-height: auto !important; height: auto !important; }
/* Dark mode on paper = unreadable */
.dark { background: white !important; color: #1a1a1a !important; }
/* Opacity renders poorly on paper */
[class*="opacity-"] { opacity: 1 !important; }
/* Fixed elements don't print */
.fixed { position: static !important; }
/* Overflow hidden clips content at page breaks */
.overflow-hidden { overflow: visible !important; }
}
Flex and grid containers do not handle page breaks correctly. Flatten them:
@media print {
.flex, .grid { display: block !important; }
/* Or selectively: keep horizontal flex but allow breaking */
.flex-col { display: block !important; }
}
Exception: Short flex rows (nav items, button groups) can remain flex if they fit on one line and you use page-break-inside: avoid.
Limitations: Does not show page breaks, @page rules, or PDF headers/footers.
Before declaring print styles complete:
Add these to your project for print control:
.no-print { } /* hidden in print via @media print */
.print-only { display: none; } /* hidden on screen, shown in print */
.print-break-before { } /* page break before this element */
.print-break-after { } /* page break after this element */
.no-print-url { } /* suppress URL display on this link */
@media print {
.no-print { display: none !important; }
.print-only { display: block !important; }
.print-break-before { page-break-before: always !important; break-before: page !important; }
.print-break-after { page-break-after: always !important; break-after: page !important; }
}
development
Sets up, configures, and optimizes Google Analytics 4 (GA4) properties. Evaluates websites for proper GA4 implementation, tracking codes, and configuration improvements. Uses the Google Analytics Admin API for programmatic setup or provides manual integration paths via gtag.js or Next.js Third Parties.
development
Open-source intelligence on people, companies, domains, and B2B accounts. Use when the user wants to investigate, vet, research, or build a dossier on a target — phrases like "OSINT", "due diligence", "background check", "research this person", "look into [company/domain]", "vet this prospect/vendor", "what does X do", "is this account worth pursuing", "find me a contact at", "who's the buyer for", or any open-source investigation task. Disambiguates identities before reporting and grades every claim by independent source count.
development
Generate, edit, describe, restyle, restore, thumbnail, and batch-process images using xAI (Grok) or OpenAI image APIs and GPT-4o vision. Default provider is xAI ($0.02/image flat rate). Use this skill whenever the user asks to generate, create, make, draw, or design an image or picture using AI, or wants to edit, modify, transform, restyle, composite, or inpaint an existing image. Also handles image description and alt-text generation, background removal, style transfer, photo restoration, thumbnail creation, and batch generation from JSON manifests. Trigger when the user mentions DALL-E, gpt-image, Grok image, xAI image, OpenAI image generation, or wants AI-generated visuals for any purpose (logos, mockups, illustrations, thumbnails, icons, concept art, memes). Also trigger for batch image generation, generating a set or series of images, processing multiple images from a manifest, or creating consistent image collections. If the user says "make me an image of...", "generate a picture", "edit this photo to...", "describe this image", "remove the background", "make this look like watercolor", "restore this old photo", "create a thumbnail", "generate a batch of images", or "process this image manifest", this is the skill to use.
testing
Agentic OS Orchestrator. Process and execute tasks from the shared .agent/state/tasks.json queue. Use when the user asks to 'check the queue', 'process tasks', or run the heartbeat.