trailing-icon-alignment

Ensures trailing icons remain visually attached to the last line of text when text wraps. Use when implementing inline text with trailing icons, external link indicators, or when fixing trailing icon alignment issues in wrapped text.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "trailing-icon-alignment" with this command: npx skills add alexcarpenter/resilient-ui/alexcarpenter-resilient-ui-trailing-icon-alignment

Trailing Icon Alignment

Ensures trailing icons always remain visually attached to the last line of text when the text wraps, preventing the icon from being orphaned on a new line.

Rules

  • MUST: Use relative inline-block on the container element
  • MUST: Use padding-right (pr-5 or equivalent) to reserve space for the icon
  • MUST: Use absolute inline positioning on the SVG icon
  • MUST: Use height on the SVG that matches the line height of the text (h-6 or equivalent)
  • NEVER: Place the icon as a flex sibling or block-level sibling — it will not wrap with the text

Implementation

<a href="/" class="relative inline-block pr-5">
  View documentation
  <svg
    class="absolute ml-1 inline h-lh w-4 shrink-0"
    viewBox="0 0 24 24"
    fill="none"
    stroke="currentColor"
    stroke-width="2"
    stroke-linecap="round"
    stroke-linejoin="round"
  >
    <path d="M7 7h10v10" />
    <path d="M7 17 17 7" />
  </svg>
</a>

Key Points

  • inline-block on the container causes the trailing padding and icon to stay attached to the last word, wrapping together as a unit
  • pr-5 (padding-right) must be at least as wide as the icon (w-4) to prevent text overlap
  • absolute positions the icon within its container; inline keeps it participating in the text flow
  • This approach prevents the icon from being orphaned on a new line at narrow widths

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

leading-icon-alignment

No summary provided by upstream source.

Repository SourceNeeds Review
General

yuqing-bitable-and-label

Incrementally sync data from XiaoAi API to Feishu Bitable and optionally auto-label records with machine-based type and sentiment annotations.

Registry SourceRecently Updated
General

张律师综合套装

张律师法律AI中台 - 中国首个开源法律AI技能库,涵盖刑事辩护、民商事诉讼、合同审查全流程

Registry SourceRecently Updated