Skip to content
Back to skills

Ztx14 Curated Resizeobserver Container Adaptation

ASecurity

Use ResizeObserver carefully when a component's geometry and hit testing depend on its own container dimensions.

  • 14 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
developmentjavascriptjavatestingapi

Works with

  • api

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add Realjustawall/Perfect-AI --skill ztx14-curated-resizeobserver-container-adaptation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ztx14 Curated Resizeobserver Container Adaptation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ztx14 Curated Resizeobserver Container Adaptation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/realjustawall-ztx14-curated-resizeobserver-container-adaptation/badge)](https://www.skillsdirectory.com/skills/realjustawall-ztx14-curated-resizeobserver-container-adaptation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ztx14-curated-resizeobserver-container-adaptation
description: Use ResizeObserver carefully when a component's geometry and hit testing depend on its own container dimensions.
---

# Adapt isometric layout to its container, not just the viewport

> Curated implementation skill. Inspect the installed project and actual component source before changing behavior. Do not assume latest APIs are installed. Preserve unrelated files and existing component ownership.

## When to use
Use when a figure is embedded in a resizable card, side panel, split view, modal, or dashboard tile whose size can change independently of the window.

## Procedure
1. Prefer CSS layout/container queries for purely visual responsive changes. Use `ResizeObserver` only when JavaScript geometry, scale, projection or interaction coordinates genuinely depend on measured size.
2. Observe a stable root element and read the relevant content/border box dimensions consistently.
3. Batch measurements and state updates; do not update style synchronously in a way that causes a resize-observer loop.
4. Handle initial zero-size states and avoid dividing by zero. Recompute scale and coordinate mapping together.
5. Disconnect on cleanup and debounce only if profiling proves necessary; ResizeObserver already reports changes efficiently.
6. Re-run hit testing and screenshot tests at narrow, wide, short-height and container-only resize cases.

## Primary references
- [resize-observer](https://developer.mozilla.org/en-US/docs/Web/API/Resize_Observer_API)
- [tailwind-responsive](https://tailwindcss.com/docs/responsive-design)
- [pointer-events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events)

## Completion evidence
- State what was inspected, what changed, and which checks actually ran. Never report unrun tests or unverified browser behavior as passing.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.