Skip to content

The design language that makes your AI harness better at design.

JavaScript

Fix live edit badge button sizing (#191)

Abdul Wahab3f8d002b7606
diff --git a/.agents/skills/impeccable/scripts/live-browser.js b/.agents/skills/impeccable/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/.agents/skills/impeccable/scripts/live-browser.js
+++ b/.agents/skills/impeccable/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/.claude/skills/impeccable/scripts/live-browser.js b/.claude/skills/impeccable/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/.claude/skills/impeccable/scripts/live-browser.js
+++ b/.claude/skills/impeccable/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/.cursor/skills/impeccable/scripts/live-browser.js b/.cursor/skills/impeccable/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/.cursor/skills/impeccable/scripts/live-browser.js
+++ b/.cursor/skills/impeccable/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/.gemini/skills/impeccable/scripts/live-browser.js b/.gemini/skills/impeccable/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/.gemini/skills/impeccable/scripts/live-browser.js
+++ b/.gemini/skills/impeccable/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/.github/skills/impeccable/scripts/live-browser.js b/.github/skills/impeccable/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/.github/skills/impeccable/scripts/live-browser.js
+++ b/.github/skills/impeccable/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/.kiro/skills/impeccable/scripts/live-browser.js b/.kiro/skills/impeccable/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/.kiro/skills/impeccable/scripts/live-browser.js
+++ b/.kiro/skills/impeccable/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/.opencode/skills/impeccable/scripts/live-browser.js b/.opencode/skills/impeccable/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/.opencode/skills/impeccable/scripts/live-browser.js
+++ b/.opencode/skills/impeccable/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/.pi/skills/impeccable/scripts/live-browser.js b/.pi/skills/impeccable/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/.pi/skills/impeccable/scripts/live-browser.js
+++ b/.pi/skills/impeccable/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/.qoder/skills/impeccable/scripts/live-browser.js b/.qoder/skills/impeccable/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/.qoder/skills/impeccable/scripts/live-browser.js
+++ b/.qoder/skills/impeccable/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/.rovodev/skills/impeccable/scripts/live-browser.js b/.rovodev/skills/impeccable/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/.rovodev/skills/impeccable/scripts/live-browser.js
+++ b/.rovodev/skills/impeccable/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/.trae-cn/skills/impeccable/scripts/live-browser.js b/.trae-cn/skills/impeccable/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/.trae-cn/skills/impeccable/scripts/live-browser.js
+++ b/.trae-cn/skills/impeccable/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/.trae/skills/impeccable/scripts/live-browser.js b/.trae/skills/impeccable/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/.trae/skills/impeccable/scripts/live-browser.js
+++ b/.trae/skills/impeccable/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/plugin/skills/impeccable/scripts/live-browser.js b/plugin/skills/impeccable/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/plugin/skills/impeccable/scripts/live-browser.js
+++ b/plugin/skills/impeccable/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/skill/scripts/live-browser.js b/skill/scripts/live-browser.js
index eff3ea39a..9b2d24f83 100644
--- a/skill/scripts/live-browser.js
+++ b/skill/scripts/live-browser.js
@@ -3854,14 +3854,19 @@
const HAIRLINE = P.hairline;
const calloutStyle = (color, borderColor) => ({
fontFamily: FONT,
- fontSize: '0.625rem',
+ fontSize: '10px',
fontWeight: '600',
+ lineHeight: '16px',
letterSpacing: '0.06em',
color: color,
background: SURFACE,
padding: '2px 8px',
border: '1px solid ' + (borderColor || color),
borderRadius: '6px',
+ boxSizing: 'border-box',
+ minHeight: '22px',
+ margin: '0',
+ appearance: 'none',
whiteSpace: 'nowrap',
boxShadow: '0 4px 16px oklch(0% 0 0 / 0.16), 0 1px 3px oklch(0% 0 0 / 0.08)',
cursor: 'pointer',
diff --git a/tests/live-browser-regression.test.mjs b/tests/live-browser-regression.test.mjs
index cd52e6bf2..cabe0bf3c 100644
--- a/tests/live-browser-regression.test.mjs
+++ b/tests/live-browser-regression.test.mjs
@@ -116,6 +116,32 @@ describe('live-browser.js regression guards', () => {
);
});
+ it('pins edit badge button metrics instead of inheriting host button chrome', () => {
+ const start = SOURCE.indexOf('const calloutStyle = (color, borderColor) => ({');
+ const end = SOURCE.indexOf(' });', start);
+ const calloutStyle = SOURCE.slice(start, end);
+ assert.match(
+ calloutStyle,
+ /fontSize: '10px'/,
+ 'edit badge controls should not scale from host rem settings',
+ );
+ assert.match(
+ calloutStyle,
+ /lineHeight: '16px'/,
+ 'edit badge controls need the same 22px button height on pages with or without button resets',
+ );
+ assert.match(
+ calloutStyle,
+ /boxSizing: 'border-box'/,
+ 'edit badge controls should include padding and border in their rendered dimensions',
+ );
+ assert.doesNotMatch(
+ calloutStyle,
+ /fontSize: '0\.625rem'/,
+ 'edit badge controls should not depend on the host root font-size',
+ );
+ });
+
it('does not shadow the global live state when storing Apply state', () => {
assert.doesNotMatch(
SOURCE,