Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

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.

Repozytorium
svelte-skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

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

  1. Step 1: Measure BEFORE (while original code is still in place)
  2. Step 2: Make the code change
  3. Step 3: Measure AFTER
  4. Step 4: Compare and report
  5. Step 5: Investigate any diff
  6. Common traps when replacing HTML elements
  7. NEVER
Sekcje z nagłówków SKILL.md, w oryginale · 77 linii, 490 słów
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

RepozytoriumWynikLicencja
Ta strona · fubits1/svelte-skills100MIT
bitovi/ai-enablement-prompts100MIT
masamunecode/claude-pixel-perfect-skill90MIT

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.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.