mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-01 20:29:00 +00:00
perf(markers): keep the CSS note short — comments ship to the browser
The long explanation inside the css`` template cost 518 gzipped bytes in the initial chunk: the template minifier leaves comments in this file, so every character of them is downloaded by every user. The reasoning now lives in docs/DEVELOPMENT.md and in the commit above; the stylesheet keeps one line and the issue number. Measured: 300 577 B with the long notes, 300 111 B with the short ones, 300 059 B on dev before the fix. Issue: #524 User-Visible: no
This commit is contained in:
@@ -209,11 +209,7 @@ export const devicesStyles = css`
|
||||
border-radius: 9999px;
|
||||
background: transparent;
|
||||
box-shadow: var(--device-shell-shadow);
|
||||
/* #524: тень оболочки выражена в --dev-size, а он — в cqw. Пока
|
||||
box-shadow стоял в переходах, любой пересчёт контейнерных запросов
|
||||
запускал некомпозируемый переход на КАЖДОМ маркере: на плане владельца
|
||||
61 штука разом роняли Firefox до 9,4 к/с. Сама тень не изменилась —
|
||||
она просто применяется сразу. */
|
||||
/* no box-shadow here: cqw-sized, restarts on every container resize (#524) */
|
||||
transition: border-color .15s, opacity .2s;
|
||||
pointer-events: auto;
|
||||
/* Normative production fallback: never add a per-marker backdrop blur. */
|
||||
@@ -266,9 +262,7 @@ export const devicesStyles = css`
|
||||
var(--device-core-inset-shadow),
|
||||
0 0 0 var(--device-ring-width) var(--device-ring-color);
|
||||
line-height: 0;
|
||||
/* #524: то же и у ядра — кольцо выделения и внутренняя тень заданы
|
||||
через --dev-size. Кольцо появляется мгновенно; плавное стоило бы
|
||||
перерисовки кадра на каждый маркер при каждом пересчёте контейнера. */
|
||||
/* same rule as the shell: the ring is cqw-sized, so it applies at once (#524) */
|
||||
transition: background .15s, color .15s, opacity .2s;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user