pixel-perfect
/pixel-perfect
Wykrywa dryf pikseli i wymusza pomiar po każdej zmianie elementu CSS lub HTML, uruchamiany automatycznie przy edycji CSS i podmianie struktur DOM.
- Autor
- fubits1 ↗
- Repozytorium
- svelte-skills ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 26.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Wykrywa dryf pikseli i wymusza pomiar po każdej zmianie elementu CSS lub HTML, uruchamiany automatycznie przy edycji CSS i podmianie struktur DOM.
Oryginalny opis (EN)
Pixel drift detection, mandatory measurement workflow for any CSS or HTML element change. Auto-invoke when editing CSS, changing HTML elements, or replacing DOM structures.
Jak działa
- Step 1: Measure BEFORE (while original code is still in place)
- Step 2: Make the code change
- Step 3: Measure AFTER
- Step 4: Compare and report
- Step 5: Investigate any diff
- Common traps when replacing HTML elements
- NEVER
Podgląd SKILL.md
---
name: pixel-perfect
description: Pixel drift detection, mandatory measurement workflow for any CSS or HTML element change. Auto-invoke when editing CSS, changing HTML elements, or replacing DOM structures.
user-invocable: true
---
# Pixel-Perfect: Mandatory Measurement Workflow
When making **any** CSS change or HTML element swap (e.g. `<dl>` to `<ul>`, `<div>` to `<section>`), follow this workflow exactly. Screenshots alone prove NOTHING about pixel parity, only measured numbers do.
## Step 1: Measure BEFORE (while original code is still in place)
Use `browser_evaluate` to capture exact values for every affected element:
```js
// Capture dimensions
el.getBoundingClientRect() // width, height, x, y
// Capture computed styles — the ACTUAL rendered values, not what CSS says
getComputedStyle(el).display // may differ from your CSS (global overrides!)
getComputedStyle(el).gap
getComputedStyle(el).margin
getComputedStyle(el).padding
getComputedStyle(el).lineHeight
getComputedStyle(el).fontSize
```
**Store these numbers.** Report them. They are your baseline.
### Critical: Measure ACTUAL computed styles, not what you think the CSS does
Global styles, resets, and browser defaults frequently override scoped CSS. A `<dl>` might render as `display: grid; gap: 16px` even though scoped CSS says `display: flex; gap: 8px`. **Never assume, always measure.**
## Step 2: Make the code change
Edit the HTML/CSS.
## Step 3: Measure AFTER
Navigate to the same page. Measure the **same elements** with `browser_evaluate`. Report the numbers side by side.
### Beware HMR staleness
After `git stash pop`, `git checkout`, or file restoration, the dev server may serve stale CSS. **Touch the file** (`touch path/to/file`) and hard-reload before measuring.
## Step 4: Compare and report
Report a table:
```
| Metric | Before | After | Diff |
| -------------- | ------ | ----- | ---- |
| footer height | 396px | 396px | 0 |
| section height | 98px | 98px | 0 |
```
## Step 5: Investigate any diff
If **any** measurement differs by even 1px:
1. **Do not dismiss it.** Do not say "close enough" or "imperceptible."
2. Investigate the root cause: default margins, line-heights, display mode, gap values, global style overrides.
3. Fix it to 0px diff.
4. Measure again to prove the fix.
## Common traps when replacing HTML elements
| Trap | Example | Fix |
| ----------------------- | ---------------------------------------------------------------- | ------------------------------------------------ |
| Browser default margins | `<ul>` has `margin: 0 0 16px`, `<dl>` has `margin: 1em 0` | Explicitly reset `margin: 0` |
| Browser default padding | `<ul>` has `padding-left: 40px` | Explicitly reset `padding: 0` |
| Default line-height | `<li>` gets `line-height: 1.5` from UA stylesheet | Set `line-height: 1` or match original |
| Global CSS overrides | A global `dl { display: grid }` overrides scoped `display: flex` | Measure computed styles BEFORE changing elements |
| Scoped CSS not matching | Changed `& dl` to `& ul` but Astro scoping attrs differ | Touch file + reload to force CSS rebuild |
## NEVER
- NEVER claim "no visual regression" or "looks identical" from eyeballing screenshots
- NEVER skip the BEFORE measurement: you cannot compare without a baseline
- NEVER report "approximately the same": report exact pixel values
- NEVER proceed if you don't have BEFORE numbers: revert and measure first
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · fubits1/svelte-skills | 100 | MIT |
| bitovi/ai-enablement-prompts | 100 | MIT |
| masamunecode/claude-pixel-perfect-skill | 90 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki 9f2d9b0c31bd (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 96html-css-js
Wspiera tworzenie stron w HTML, CSS i JavaScript: układy responsywne, animacje CSS i interakcje w czystym JS. - 100retro-css-architecture
Porządkuje CSS w stylu 8-bit przez zmienne CSS, fonty pikselowe i responsywną pikselową grafikę przy tworzeniu lub zmianie komponentów retro. - 100figma-to-react
Wyodrębnia projekty Figma do komponentów React lub Next.js z TypeScript i Tailwind CSS, z dokładnością co do piksela. - 90code-style-css
Podpowiada zasady stylu przy edycji CSS, SCSS i bloków stylów w plikach Svelte. - 100html-css-guide
Podaje zasady i dobre praktyki dla HTML i CSS w pracy z AI: semantyczny HTML, dostępność, nowoczesne wzorce CSS i responsywność zgodne ze standardami projektu. - 100vrt-markup-synth
Dostarcza pięć narzędzi do markupu: dopasowanie pikseli, wycinanie komponentów, audyt tokenów, parytet motywów i test długich tekstów.