studio-css-reset

โดย remotion-dev

แนวทางสำหรับการเปลี่ยนแปลง UI ของ Remotion Studio ที่การรีเซ็ต CSS ทั่วโลกส่งผลต่อองค์ประกอบที่ซ้อนกัน ใช้เมื่อแก้ไข packages/studio UI โดยเฉพาะเมื่อเพิ่ม wrapper…

npx skills add https://github.com/remotion-dev/remotion --skill studio-css-reset

Studio CSS Reset

Remotion Studio's reset targets both the reset container and every descendant. A child does not necessarily inherit the visual styles of its parent: the reset may give that child its own computed value instead.

Diagnose the affected element

Inspect the element that actually paints the pixels, not only its parent:

  • For text, inspect the span, div, or other text wrapper.
  • For SVG icons, inspect the painted path, circle, or rect as well as the outer svg.
  • Compare computed styles in every relevant state: idle, hovered, selected, focused, and disabled.
  • Check whether the value comes from an inline style, SVG presentation attribute, inheritance, or the .css-reset, .css-reset * rule.

Apply explicit local styles

Do not assume that styling the row, button, or outer SVG is enough.

For text wrappers, explicitly set the visual properties the component depends on, such as:

const labelStyle: React.CSSProperties = {
	fontFamily: 'inherit',
	fontSize: 13,
	lineHeight: 'normal',
	color: 'inherit',
};

Use color: 'inherit' only when the styled element directly paints the text. It does not protect deeper descendants that receive their own reset value.

For SVG icons, remember that fill="currentColor" resolves against the computed color of the painted SVG element. If the reset sets color: white on the inner <path>, setting color: 'inherit' only on the outer <svg> will not fix it. Pass the concrete state color to the component that renders the painted element:

<AssetFileIcon color={hovered || selected ? WHITE : LIGHT_TEXT} />

Prefer a concrete fill, stroke, or color prop when the icon has state-dependent colors. Use currentColor only after confirming that the painted descendants inherit the intended color.

Preserve compact row layout

When adding icon-and-label markup:

  • Give icons fixed dimensions and flexShrink: 0.
  • Give labels minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', and whiteSpace: 'nowrap' when truncation is required.
  • Confirm that wrappers do not change row height, spacing, or the ellipsis behavior.

Prefer fixing a shared Studio component once when the same row or icon pattern is reused.

Verify the result

Do not stop after checking that the code compiles. In a running Studio, inspect the computed style of the element that paints the pixels in both idle and interactive states. Confirm that labels and icons change together and that selection does not mask a broken hover state.

For Studio code changes, run at least:

bunx turbo run make --filter='@remotion/studio'
bunx turbo run lint test --filter='@remotion/studio'

Skills เพิ่มเติมจาก remotion-dev

pr-name
remotion-dev
การตั้งชื่อที่ถูกต้องสำหรับ PR
official
pr-ready
remotion-dev
แก้ไข CI ที่ล้มเหลว, แก้ไขความขัดแย้งในการรวมโค้ด, หรือการเปลี่ยนแปลงในสาขาท้องถิ่นเพื่อเตรียม PR ให้พร้อม
official
release
remotion-dev
ปล่อยเวอร์ชัน Remotion ใหม่
official
remotion-captions
remotion-dev
การจัดการกับคำบรรยายใน Remotion
official
remotion-create
remotion-dev
กำลังสร้างวิดีโอ Remotion ใหม่
official
video-report
remotion-dev
สร้างรายงานเกี่ยวกับวิดีโอ
official
add-bug
remotion-dev
เพิ่มรายการบั๊ก Remotion ใหม่ไปยัง packages/bugs/api/[v].ts ใช้เมื่อผู้ใช้อธิบายบั๊กและเวอร์ชัน Remotion ที่ได้รับผลกระทบซึ่งควรแสดงผ่านทาง…
official
add-cli-option
remotion-dev
เพิ่มตัวเลือก CLI หรือการกำหนดค่า Remotion ใหม่ โดยการสร้าง AnyRemotionOption, ลงทะเบียนการแยกวิเคราะห์ CLI, เชื่อมต่อตัวตั้งค่าการกำหนดค่า และอัปเดตเอกสาร ใช้เมื่อ...
official