Use this skill when deciding whether font-size should use rem or px, reviewing Chrome text zoom support, or choosing whether text-dependent spacing and sizing should scale with typography. Apply it when CSS uses blanket rem conversion, root font-size hacks, or relative units such as em and ch without a clear semantic basis.
Ships in kf-global. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
この skill は、font-size を rem にするべきか px にするべきか、その判断条件を揃えるためのものです。
主眼は Chrome の文字拡大機能に耐えることと、文字サイズに本当に従属する値だけを相対単位にすることです。
ブレイクポイントやビューポート基準のレスポンシブ判断は ../kf-g-css-tak-responsive-rules/SKILL.md を優先し、この skill では文字と文字依存寸法に絞って扱います。
font-size を rem と px のどちらで指定するか決めるときpadding gap inline-size block-size などを追従させるべきか判断するときrem の一括変換、:root の font-size ハック、62.5% 運用をレビューするときem ch を使うべき箇所と、単に px のままにすべき箇所を切り分けるときrem」の実装が混ざっていないか確認するときpx を基準に考えるpx を基準に考える。border-radius、なんとなくの固定サイズを、習慣だけで rem にしない。rem を採用しない。rem を使ってよい条件font-size には rem を使ってよい。font-size だけ rem にして終わりではない。文字拡大に伴って増えるべき余白やサイズも、必要に応じて相対値にする。rem を採用するなら、Chrome の文字拡大機能を実際に「極大」まで上げて検証することを必須にする。rem を使う。:root の font-size を絶対値で固定して、見かけだけ rem を使う実装はしない。em と ch を使う条件em は、その要素自身の文字サイズを基準にしたい値へ使う。padding は 1.5 文字分」のように、文字数や文字サイズが意味そのものになっているときは em が自然である。ch は、数字や等幅に近い文字数を基準にしたい幅へ使う。ch を使う。rem にせず em や ch を優先する。px を選び直す条件rem にしたことでレイアウト崩れや可読性低下が起きても、修正責任を持てない。font-size だけでなく、文字拡大で影響を受ける余白やサイズが破綻しないか確認する。block-size、固定 inline-size、overflow: clip、強い切り詰めが、文字の切り取りを起こしていないか確認する。.anti-pattern {
overflow: clip;
block-size: 30px;
font-size: calc(24 / 16 * 1rem);
}
font-size だけ rem 化すると、文字拡大時に読めなくなる。font-size だけ rem にして、周辺の文字依存寸法をすべて px のまま放置しない。rem にしない。:root の font-size をハックしてリキッドレイアウトを組まない。rem() という独自変換関数を安易に作らない。CSS 標準の rem() 関数名と衝突するためである。rem への変換方法rem に直すときは calc() を使い、値の由来を残す。@property --root-font-size {
syntax: "<length>";
inherits: false;
initial-value: 16px;
}
:root {
--to-rem: calc(tan(atan2(1px, var(--root-font-size))) * 1rem);
}
.heading {
font-size: calc(24 * var(--to-rem));
}
:root の font-size を固定するためのものではない。rem px em ch のどれで扱うべきかを明示する。rem を選ぶ場合は、Chrome の文字拡大をどこまで検証するか、どの寸法を追従させるかを明示する。px を選ぶ場合は、なぜ相対単位の基準が成立していないのかを短く説明する。em ch を選ぶ場合は、何を基準にしているのかを要件と結び付けて説明する。font-size だけでなく、文字依存寸法の追従要否を確認したか。rem 化になっていないか。em ch を使うべき局所要件を、安易に rem で潰していないか。What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/kf-global:kf-g-css-tak-font-size-text-zoomfrom kf-global
npx claudepluginhub melumuccu/ai --plugin kf-global14 skills in this plugin
/kf-g-artifacts-creation-rulesMandatory authoring and workflow rules for creating artifacts (HTML documents, reports, specs, visual summaries, and standalone deliverables). Always use this skill before drafting, revising, or archiving any artifact to follow the visual-first layout with diagrams/tables/screenshots, plain high-school-level Japanese vocabulary, short concise sentences, and the local HTML artifact workflow (~/artifacts placement, sequential filename reservation, Tailscale viewer URL linking, and post-task archiving)./kf-g-artifacts-sanitizeUse this skill when creating artifacts. Apply it to revise those artifacts so they read as natural, standalone deliverables and do not leak prompt instructions, conversation history, implementation constraints, or production-process traces./kf-g-css-flex-gridUse this skill when designing, reviewing, or generating CSS layout with display grid or flex. Apply it whenever the user asks about grid-template, grid-area naming, flex-direction, or needs to choose between grid and flex for component or page layout./kf-g-css-spacing-gap-margin-rulesUse this skill when designing, reviewing, or generating CSS spacing rules. Apply it whenever the user asks whether spacing should use gap, margin, or structural empty space, wants to avoid margin-based layout spacing, or needs rules for container-owned spacing in grid or flex layouts./kf-g-css-tak-animationsUI animations necessity judgment, recommendations for motion design, implementation strategies, and performance/accessibility reviews. Targets include hover, active, focus, popover, tooltip, dropdown, dialog, tab, segmented control, card, button, toast, accordion, carousel, scroll-linked animation, View Transitions, and more./kf-g-css-tak-design-system-terminologyUse this skill when defining, reviewing, or correcting design system terminology for CSS, layout, components, and UI concepts. Apply it when names may conflict with Web standards, HTML semantics, or responsibility boundaries.