Skip to content

🎥 Make videos programmatically with React

`@remotion/studio`: Refine inspector property controls (#10685)

Jonny Burgercbd43f125188
diff --git a/.agents/skills/no-pointer/SKILL.md b/.agents/skills/no-pointer/SKILL.md
new file mode 100644
index 0000000000..4739d9ab29
--- /dev/null
+++ b/.agents/skills/no-pointer/SKILL.md
@@ -0,0 +1,57 @@
+---
+name: no-pointer
+description: Apply Remotion Studio's pointerless interaction styling to clickable controls. Use when adding or revising Studio buttons or links that should use the default cursor, brighten on hover, and show focus decoration only for keyboard navigation.
+---
+
+# No Pointer
+
+Use the established Studio interaction convention for clickable controls:
+
+- Set `cursor: 'default'`; do not use `cursor: 'pointer'`.
+- Drive purely visual hover styling through `HOVERABLE_CLASS_NAME` and
+ `hoverableStyle()` from `packages/studio/src/helpers/hoverable.ts`. Do not add
+ React hover state for color or background changes.
+- Keep the background unchanged unless the surrounding component already uses
+ a shared background-hover convention. For a text-only action, use
+ `TRANSPARENT` for both `idleBackground` and `hoverBackground`.
+- Use `LIGHT_TEXT` (`#A6A7A9`) as the idle color and `WHITE` (`white`) as the
+ hover color. Icons and nested text must follow the same state; inspect the
+ element that paints the pixels if the Studio CSS reset blocks inheritance.
+
+## Focus styling
+
+Remove the default outline and pointer-focus shadow, but preserve a visible
+keyboard focus indicator. Add `FOCUS_VISIBLE_ONLY_CLASS_NAME` from
+`packages/studio/src/helpers/hoverable.ts` to the control alongside
+`HOVERABLE_CLASS_NAME`. The shared class implements this pattern:
+
+```css
+.__remotion-focus-visible-only:focus {
+ outline: none;
+ box-shadow: none;
+}
+
+.__remotion-focus-visible-only:focus-visible {
+ box-shadow: ${FOCUS_BOX_SHADOW};
+}
+```
+
+Never remove the `:focus-visible` indicator. Keep hidden actions out of the tab
+order until they are discoverable.
+
+## Verify
+
+In a running Studio, check the control's computed styles in all relevant states:
+
+- idle and hovered cursor: `default`;
+- idle color: `rgb(166, 167, 169)`;
+- hovered color: `rgb(255, 255, 255)`;
+- pointer focus: no outline or box shadow;
+- keyboard `Tab` focus: the standard `FOCUS_BOX_SHADOW` is visible.
+
+For Studio code changes, run:
+
+```bash
+bunx turbo run make --filter='@remotion/studio'
+bunx turbo run lint test --filter='@remotion/studio'
+```
diff --git a/.agents/skills/no-pointer/agents/openai.yaml b/.agents/skills/no-pointer/agents/openai.yaml
new file mode 100644
index 0000000000..f6266a8a06
--- /dev/null
+++ b/.agents/skills/no-pointer/agents/openai.yaml
@@ -0,0 +1,4 @@
+interface:
+ display_name: 'No Pointer'
+ short_description: 'Apply Studio pointerless interaction styling'
+ default_prompt: 'Use $no-pointer to make this Remotion Studio control follow the pointerless hover and keyboard-focus convention.'
diff --git a/packages/example/e2e/inspector-control-layout.test.mts b/packages/example/e2e/inspector-control-layout.test.mts
index 4a299a9449..6561b94c67 100644
--- a/packages/example/e2e/inspector-control-layout.test.mts
+++ b/packages/example/e2e/inspector-control-layout.test.mts
@@ -11,7 +11,6 @@ const getBox = async (locator: Locator) => {
};
const expectInspectorControlsToUseAvailableWidth = async (
- controlsHeader: Locator,
origin: Locator,
destination: Locator,
label: Locator,
@@ -21,7 +20,6 @@ const expectInspectorControlsToUseAvailableWidth = async (
colorButton: Locator,
) => {
const [
- headerBox,
originBox,
destinationBox,
labelBox,
@@ -30,7 +28,6 @@ const expectInspectorControlsToUseAvailableWidth = async (
keyframeButtonBox,
colorButtonBox,
] = await Promise.all([
- getBox(controlsHeader),
getBox(origin),
getBox(destination),
getBox(label),
@@ -41,19 +38,18 @@ const expectInspectorControlsToUseAvailableWidth = async (
]);
for (const fieldBox of [
- originBox,
destinationBox,
labelBox,
labelInputBox,
routeColorBox,
]) {
- expect(Math.abs(fieldBox.x - headerBox.x)).toBeLessThanOrEqual(2);
+ expect(Math.abs(fieldBox.x - originBox.x)).toBeLessThanOrEqual(2);
}
- expect(keyframeButtonBox.x).toBeGreaterThan(
- routeColorBox.x + routeColorBox.width,
+ expect(keyframeButtonBox.x + keyframeButtonBox.width).toBeLessThanOrEqual(
+ routeColorBox.x,
);
- expect(keyframeButtonBox.x).toBeLessThan(colorButtonBox.x);
+ expect(routeColorBox.x + routeColorBox.width).toBeLessThan(colorButtonBox.x);
};
test.describe('Inspector control layout', () => {
@@ -86,7 +82,6 @@ test.describe('Inspector control layout', () => {
await expect(origin).toBeVisible({timeout: 1_000});
}).toPass({timeout: 30_000});
- const controlsHeader = page.getByText('Controls', {exact: true});
const destination = page.getByText('Destination [longitude, latitude]', {
exact: true,
});
@@ -99,7 +94,6 @@ test.describe('Inspector control layout', () => {
const colorButton = page.getByRole('button', {name: '#ff5c4d'});
await expectInspectorControlsToUseAvailableWidth(
- controlsHeader,
origin,
destination,
label,
@@ -112,7 +106,6 @@ test.describe('Inspector control layout', () => {
await page.getByRole('button', {name: '-0.1276', exact: true}).click();
await page.keyboard.press('Escape');
await expectInspectorControlsToUseAvailableWidth(
- controlsHeader,
origin,
destination,
label,
@@ -133,7 +126,6 @@ test.describe('Inspector control layout', () => {
await page.mouse.up();
await expectInspectorControlsToUseAvailableWidth(
- controlsHeader,
origin,
destination,
label,
diff --git a/packages/studio/src/components/InspectorPanel/AlignmentControls.tsx b/packages/studio/src/components/InspectorPanel/AlignmentControls.tsx
index 8442ca00d1..f3b7cd169c 100644
--- a/packages/studio/src/components/InspectorPanel/AlignmentControls.tsx
+++ b/packages/studio/src/components/InspectorPanel/AlignmentControls.tsx
@@ -47,10 +47,9 @@ const iconStyle: React.CSSProperties = {
height: 16,
};
-const verticalDivider: React.CSSProperties = {
+const verticalSpacer: React.CSSProperties = {
width: 1,
height: 16,
- backgroundColor: 'rgba(255, 255, 255, 0.1)',
margin: '0 8px',
};
@@ -313,7 +312,7 @@ export const AlignmentControls: React.FC<{
Icon={AlignRightIcon}
disabled={alignmentDisabled}
/>
- <div style={verticalDivider} />
+ <div style={verticalSpacer} />
<AlignmentButton
title="Align top"
onClick={() => handleAlign('top')}
diff --git a/packages/studio/src/components/NewComposition/InputDragger.tsx b/packages/studio/src/components/NewComposition/InputDragger.tsx
index 7ea93c479f..bbc1cf118e 100644
--- a/packages/studio/src/components/NewComposition/InputDragger.tsx
+++ b/packages/studio/src/components/NewComposition/InputDragger.tsx
@@ -55,6 +55,17 @@ export const inputDraggerContainerStyle: React.CSSProperties = {
padding: '4px 6px',
};
+const compactInputDraggerStyle: React.CSSProperties = {
+ fontSize: 12,
+ lineHeight: '16px',
+ padding: '0 6px',
+};
+
+const compactInputDraggerContainerStyle: React.CSSProperties = {
+ ...inputDraggerContainerStyle,
+ ...compactInputDraggerStyle,
+};
+
const isInt = (num: number) => {
return num % 1 === 0;
};
@@ -448,6 +459,7 @@ const InputDraggerForwardRefFn: React.ForwardRefRenderFunction<
formatterSubtitle,
formatterSubtitleStyle,
buttonStyle,
+ style: inputStyle,
status,
rightAlign,
small,
@@ -480,6 +492,7 @@ const InputDraggerForwardRefFn: React.ForwardRefRenderFunction<
userSelect: 'none',
WebkitUserSelect: 'none',
fontSize: small ? 12 : 14,
+ lineHeight: small ? '16px' : undefined,
fontVariantNumeric: 'tabular-nums',
...formatterStyle,
}),
@@ -713,6 +726,15 @@ const InputDraggerForwardRefFn: React.ForwardRefRenderFunction<
rightAlign={rightAlign}
small={small}
{...props}
+ style={
+ small
+ ? {
+ ...compactInputDraggerStyle,
+ display: 'block',
+ ...inputStyle,
+ }
+ : inputStyle
+ }
type="text"
/>
</HigherZIndex>
@@ -727,8 +749,15 @@ const InputDraggerForwardRefFn: React.ForwardRefRenderFunction<
className={'__remotion_input_dragger'}
style={
buttonStyle
- ? {...inputDraggerContainerStyle, ...buttonStyle}
- : inputDraggerContainerStyle
+ ? {
+ ...(small
+ ? compactInputDraggerContainerStyle
+ : inputDraggerContainerStyle),
+ ...buttonStyle,
+ }
+ : small
+ ? compactInputDraggerContainerStyle
+ : inputDraggerContainerStyle
}
onClick={onClick}
onFocus={onFocus}
diff --git a/packages/studio/src/components/Timeline/TimelineEffectItem.tsx b/packages/studio/src/components/Timeline/TimelineEffectItem.tsx
index ecd30c7288..a31ba2a69e 100644
--- a/packages/studio/src/components/Timeline/TimelineEffectItem.tsx
+++ b/packages/studio/src/components/Timeline/TimelineEffectItem.tsx
@@ -509,7 +509,6 @@ export const TimelineEffectItem: React.FC<{
onSelect={selection.onSelect}
showSelectedBackground
containsSelection={containsSelection}
- isFieldRow={false}
outerHeight={null}
>
<div style={labelContainerStyle}>
diff --git a/packages/studio/src/components/Timeline/TimelineEffectPropItem.tsx b/packages/studio/src/components/Timeline/TimelineEffectPropItem.tsx
index 0f2d15c316..282acedfac 100644
--- a/packages/studio/src/components/Timeline/TimelineEffectPropItem.tsx
+++ b/packages/studio/src/components/Timeline/TimelineEffectPropItem.tsx
@@ -617,14 +617,12 @@ export const TimelineEffectPropItem: React.FC<{
onDoubleClick={onPropertyDoubleClick}
showSelectedBackground
containsSelection={false}
- isFieldRow
outerHeight={null}
>
<TimelineFieldRowContent
field={field}
rowDepth={rowDepth}
selected={selection.selected}
- keyframeControls={keyframeControls}
>
<TimelineEffectPropValueAtCurrentFrame
field={field}
diff --git a/packages/studio/src/components/Timeline/TimelineExpandedRow.tsx b/packages/studio/src/components/Timeline/TimelineExpandedRow.tsx
index 26776c44c7..3007ba9a0d 100644
--- a/packages/studio/src/components/Timeline/TimelineExpandedRow.tsx
+++ b/packages/studio/src/components/Timeline/TimelineExpandedRow.tsx
@@ -119,7 +119,6 @@ const TimelineExpandedRowInner: React.FC<TimelineExpandedRowProps> = ({
onSelect={selection.onSelect}
showSelectedBackground
containsSelection={false}
- isFieldRow={false}
outerHeight={null}
>
<span style={labelStyle}>{node.label}</span>
@@ -177,7 +176,6 @@ const TimelineExpandedRowInner: React.FC<TimelineExpandedRowProps> = ({
onSelect={selection.onSelect}
showSelectedBackground
containsSelection={false}
- isFieldRow={false}
outerHeight={null}
>
<span style={labelStyle}>{node.label}</span>
diff --git a/packages/studio/src/components/Timeline/TimelineFieldLabel.tsx b/packages/studio/src/components/Timeline/TimelineFieldLabel.tsx
index 96deac61c4..e8664b6582 100644
--- a/packages/studio/src/components/Timeline/TimelineFieldLabel.tsx
+++ b/packages/studio/src/components/Timeline/TimelineFieldLabel.tsx
@@ -1,7 +1,9 @@
import React, {useContext, useMemo} from 'react';
import {WHITE_ALPHA_80} from '../../helpers/colors';
-import {SCHEMA_FIELD_ROW_HEIGHT} from '../../helpers/timeline-layout';
-import {getTimelineFieldLabelRowStyle} from './timeline-field-row-layout';
+import {
+ getTimelineFieldLabelRowStyle,
+ TIMELINE_STACKED_FIELD_HEADER_HEIGHT,
+} from './timeline-field-row-layout';
import {TimelineRowLayoutContext} from './TimelineRowLayoutContext';
import {
getTimelineColor,
@@ -10,6 +12,7 @@ import {
const fieldNameBase: React.CSSProperties = {
fontSize: 12,
+ lineHeight: `${TIMELINE_STACKED_FIELD_HEADER_HEIGHT}px`,
color: WHITE_ALPHA_80,
userSelect: 'none',
whiteSpace: 'nowrap',
@@ -35,7 +38,9 @@ export const TimelineFieldLabel: React.FC<{
selected && highlightSelectedLabel,
true,
),
- ...(stacked ? {flex: `0 0 ${SCHEMA_FIELD_ROW_HEIGHT}px`} : null),
+ ...(stacked
+ ? {flex: `0 0 ${TIMELINE_STACKED_FIELD_HEADER_HEIGHT}px`}
+ : null),
alignSelf: 'stretch',
}),
[basePadding, highlightSelectedLabel, rowDepth, selected, stacked],
diff --git a/packages/studio/src/components/Timeline/TimelineFieldRowContent.tsx b/packages/studio/src/components/Timeline/TimelineFieldRowContent.tsx
index bbf7c296f0..6907256a03 100644
--- a/packages/studio/src/components/Timeline/TimelineFieldRowContent.tsx
+++ b/packages/studio/src/components/Timeline/TimelineFieldRowContent.tsx
@@ -1,41 +1,27 @@
import React, {useContext} from 'react';
-import {
- SCHEMA_FIELD_ROW_HEIGHT,
- type SchemaFieldInfo,
-} from '../../helpers/timeline-layout';
+import type {SchemaFieldInfo} from '../../helpers/timeline-layout';
import {
isTimelineFieldStacked,
- timelineCompactStackedFieldValueColumnStyle,
timelineFieldValueColumnStyle,
timelineStackedFieldContentStyle,
} from './timeline-field-row-layout';
import {TimelineFieldLabel} from './TimelineFieldLabel';
-import {TimelineRowKeyframeControlsColumn} from './TimelineRowChrome';
-import {TimelineRowLayoutContext} from './TimelineRowLayoutContext';
+import {TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING} from './TimelineSelection';
import {Transform3DModeContext} from './Transform3DModeContext';
-const stackedHeaderStyle: React.CSSProperties = {
- display: 'flex',
- flex: `0 0 ${SCHEMA_FIELD_ROW_HEIGHT}px`,
- minWidth: 0,
-};
-
-const stackedLabelStyle: React.CSSProperties = {
- flex: 1,
- minWidth: 0,
+const stackedValueStyle: React.CSSProperties = {
+ ...timelineFieldValueColumnStyle,
+ paddingLeft: TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING,
};
export const TimelineFieldRowContent: React.FC<{
readonly field: SchemaFieldInfo;
readonly rowDepth: number;
readonly selected: boolean;
- readonly keyframeControls: React.ReactNode;
readonly children: React.ReactNode;
-}> = ({field, rowDepth, selected, keyframeControls, children}) => {
+}> = ({field, rowDepth, selected, children}) => {
const transform3DMode = useContext(Transform3DModeContext);
- const {keyframeControlsPlacement} = useContext(TimelineRowLayoutContext);
const stacked = isTimelineFieldStacked({field, transform3DMode});
- const compactStacked = stacked && field.typeName !== 'text-content';
const label = (
<TimelineFieldLabel
rowDepth={rowDepth}
@@ -45,35 +31,15 @@ export const TimelineFieldRowContent: React.FC<{
/>
);
const value = (
- <div
- style={
- compactStacked
- ? timelineCompactStackedFieldValueColumnStyle
- : timelineFieldValueColumnStyle
- }
- >
+ <div style={stacked ? stackedValueStyle : timelineFieldValueColumnStyle}>
{children}
</div>
);
- const controls =
- keyframeControlsPlacement === 'after-label' ? (
- <TimelineRowKeyframeControlsColumn depth={rowDepth}>
- {keyframeControls}
- </TimelineRowKeyframeControlsColumn>
- ) : null;
-
if (stacked) {
return (
<div style={timelineStackedFieldContentStyle}>
- {controls ? (
- <div style={stackedHeaderStyle}>
- <div style={stackedLabelStyle}>{label}</div>
- {controls}
- </div>
- ) : (
- label
- )}
+ {label}
{value}
</div>
);
@@ -82,7 +48,6 @@ export const TimelineFieldRowContent: React.FC<{
return (
<>
{label}
- {controls}
{value}
</>
);
diff --git a/packages/studio/src/components/Timeline/TimelinePrimitiveFieldValue.tsx b/packages/studio/src/components/Timeline/TimelinePrimitiveFieldValue.tsx
index 855ffaf1cb..bf8ccf17dd 100644
--- a/packages/studio/src/components/Timeline/TimelinePrimitiveFieldValue.tsx
+++ b/packages/studio/src/components/Timeline/TimelinePrimitiveFieldValue.tsx
@@ -81,16 +81,14 @@ export const TimelinePrimitiveFieldValue: React.FC<{
}) => {
if (field.typeName === 'number') {
return (
- <span>
- <TimelineNumberField
- effectiveValue={effectiveValue}
- field={field}
- onDragEnd={onDragEnd}
- onDragValueChange={onDragValueChange}
- onSave={onSave}
- propStatus={propStatus}
- />
- </span>
+ <TimelineNumberField
+ effectiveValue={effectiveValue}
+ field={field}
+ onDragEnd={onDragEnd}
+ onDragValueChange={onDragValueChange}
+ onSave={onSave}
+ propStatus={propStatus}
+ />
);
}
diff --git a/packages/studio/src/components/Timeline/TimelineRotationField.tsx b/packages/studio/src/components/Timeline/TimelineRotationField.tsx
index 219bd2bfe5..2b748269ca 100644
--- a/packages/studio/src/components/Timeline/TimelineRotationField.tsx
+++ b/packages/studio/src/components/Timeline/TimelineRotationField.tsx
@@ -28,10 +28,8 @@ const containerStyle: React.CSSProperties = {
};
const compactDraggerStyle: React.CSSProperties = {
- paddingBottom: 2,
paddingLeft: 2,
paddingRight: 2,
- paddingTop: 2,
};
const ROTATION_LABELS = ['X', 'Y', 'Z'] as const;
diff --git a/packages/studio/src/components/Timeline/TimelineRowChrome.tsx b/packages/studio/src/components/Timeline/TimelineRowChrome.tsx
index 429010ed15..d3218e0f58 100644
--- a/packages/studio/src/components/Timeline/TimelineRowChrome.tsx
+++ b/packages/studio/src/components/Timeline/TimelineRowChrome.tsx
@@ -72,7 +72,6 @@ export const TimelineRowChrome: React.FC<{
readonly showSelectedBackground: boolean;
readonly containsSelection: boolean;
readonly hovered?: boolean;
- readonly isFieldRow: boolean;
// When set, the chrome is wrapped in an outer container of this height with a
// bottom track separator. The background highlight and click target span the
// outer (used by sequence rows whose layer is taller than the chrome row).
@@ -96,7 +95,6 @@ export const TimelineRowChrome: React.FC<{
showSelectedBackground,
containsSelection,
hovered = false,
- isFieldRow,
outerHeight,
onDragLeave,
onDragOver,
@@ -105,12 +103,9 @@ export const TimelineRowChrome: React.FC<{
onPointerEnter,
onPointerLeave,
}) => {
- const {
- basePadding,
- keyframeControlsPlacement,
- rowBorderRadius,
- rowHorizontalMargin,
- } = useContext(TimelineRowLayoutContext);
+ const {basePadding, rowBorderRadius, rowHorizontalMargin} = useContext(
+ TimelineRowLayoutContext,
+ );
const selectedBackground = useContext(TimelineRowSelectedBackgroundContext);
const indentWidth = getTimelineRowIndentWidth(depth);
@@ -206,25 +201,21 @@ export const TimelineRowChrome: React.FC<{
};
}, [outerHeight, highlightBackground]);
- const shouldRenderLeftChrome =
- !isFieldRow || keyframeControlsPlacement === 'before-label';
const chrome = (
<>
- {shouldRenderLeftChrome ? (
- keyframeControls ? (
- <TimelineRowKeyframeControlsColumn depth={depth}>
- {keyframeControls}
- </TimelineRowKeyframeControlsColumn>
- ) : (
- <div style={leftChromeStyle}>
- <div style={chromeColumnStyle}>
- {eye}
- {indentWidth > 0 ? <Padder depth={depth} /> : null}
- {arrow}
- </div>
+ {keyframeControls ? (
+ <TimelineRowKeyframeControlsColumn depth={depth}>
+ {keyframeControls}
+ </TimelineRowKeyframeControlsColumn>
+ ) : (
+ <div style={leftChromeStyle}>
+ <div style={chromeColumnStyle}>
+ {eye}
+ {indentWidth > 0 ? <Padder depth={depth} /> : null}
+ {arrow}
</div>
- )
- ) : null}
+ </div>
+ )}
{children}
</>
);
diff --git a/packages/studio/src/components/Timeline/TimelineRowLayoutContext.ts b/packages/studio/src/components/Timeline/TimelineRowLayoutContext.ts
index 9e15876f92..f647dfba3b 100644
--- a/packages/studio/src/components/Timeline/TimelineRowLayoutContext.ts
+++ b/packages/studio/src/components/Timeline/TimelineRowLayoutContext.ts
@@ -1,5 +1,4 @@
import {createContext} from 'react';
-import {INSPECTOR_PANEL_HORIZONTAL_PADDING} from '../InspectorPanelLayout';
import {
INSPECTOR_ROW_BASE_PADDING,
TIMELINE_ROW_BASE_PADDING,
@@ -9,7 +8,6 @@ type TimelineRowLayout = {
readonly basePadding: number;
readonly highlightSelectedLabel: boolean;
readonly keyframeControlsPadding: number;
- readonly keyframeControlsPlacement: 'before-label' | 'after-label';
readonly rowBorderRadius: number;
readonly rowHorizontalMargin: number;
};
@@ -18,16 +16,14 @@ export const INSPECTOR_TIMELINE_ROW_LAYOUT: TimelineRowLayout = {
basePadding: INSPECTOR_ROW_BASE_PADDING,
highlightSelectedLabel: false,
keyframeControlsPadding: 0,
- keyframeControlsPlacement: 'after-label',
rowBorderRadius: 4,
- rowHorizontalMargin: INSPECTOR_PANEL_HORIZONTAL_PADDING,
+ rowHorizontalMargin: 4,
};
export const TimelineRowLayoutContext = createContext<TimelineRowLayout>({
basePadding: TIMELINE_ROW_BASE_PADDING,
highlightSelectedLabel: true,
keyframeControlsPadding: TIMELINE_ROW_BASE_PADDING,
- keyframeControlsPlacement: 'before-label',
rowBorderRadius: 0,
rowHorizontalMargin: 0,
});
diff --git a/packages/studio/src/components/Timeline/TimelineScaleField.tsx b/packages/studio/src/components/Timeline/TimelineScaleField.tsx
index 466269bbff..0dddf8d53b 100644
--- a/packages/studio/src/components/Timeline/TimelineScaleField.tsx
+++ b/packages/studio/src/components/Timeline/TimelineScaleField.tsx
@@ -18,19 +18,15 @@ import {timelineLayerIconContainer} from './TimelineLayerEye';
import {Transform3DModeContext} from './Transform3DModeContext';
const leftDraggerStyle: React.CSSProperties = {
- paddingBottom: 2,
paddingLeft: 0,
- paddingTop: 2,
textAlign: 'left',
- width: 52,
+ width: 40,
};
const rightDraggerStyle: React.CSSProperties = {
- paddingBottom: 2,
paddingRight: 0,
- paddingTop: 2,
textAlign: 'left',
- width: 52,
+ width: 40,
};
const containerStyle: React.CSSProperties = {
diff --git a/packages/studio/src/components/Timeline/TimelineSchemaField.tsx b/packages/studio/src/components/Timeline/TimelineSchemaField.tsx
index d6876c2fa4..67147d1d51 100644
--- a/packages/studio/src/components/Timeline/TimelineSchemaField.tsx
+++ b/packages/studio/src/components/Timeline/TimelineSchemaField.tsx
@@ -5,7 +5,17 @@ import type {
SequencePropsSubscriptionKey,
} from 'remotion';
import type {CodePosition} from '../../error-overlay/react-overlay/utils/get-source-map';
-import {LIGHT_TEXT, WHITE_ALPHA_40} from '../../helpers/colors';
+import {
+ LIGHT_TEXT,
+ TRANSPARENT,
+ WHITE,
+ WHITE_ALPHA_40,
+} from '../../helpers/colors';
+import {
+ FOCUS_VISIBLE_ONLY_CLASS_NAME,
+ HOVERABLE_CLASS_NAME,
+ hoverableStyle,
+} from '../../helpers/hoverable';
import type {
SchemaFieldInfo,
TimelineFieldOnDragValueChange,
@@ -43,7 +53,12 @@ const computedValue: React.CSSProperties = {
};
const fixLinkBase: React.CSSProperties = {
- color: LIGHT_TEXT,
+ ...hoverableStyle({
+ idleBackground: TRANSPARENT,
+ hoverBackground: TRANSPARENT,
+ idleColor: LIGHT_TEXT,
+ hoverColor: WHITE,
+ }),
display: 'inline-block',
fontSize: 10,
fontStyle: 'normal',
@@ -54,7 +69,7 @@ const fixLinkBase: React.CSSProperties = {
appearance: 'none',
background: 'none',
border: 'none',
- cursor: 'pointer',
+ cursor: 'default',
padding: 0,
};
@@ -102,6 +117,7 @@ export const UnsupportedStatus: React.FC<{
{onFix ? (
<button
type="button"
+ className={`${FOCUS_VISIBLE_ONLY_CLASS_NAME} ${HOVERABLE_CLASS_NAME}`}
style={fixLink}
title="Fix computed Studio value"
onClick={(event) => {
diff --git a/packages/studio/src/components/Timeline/TimelineSequenceItem.tsx b/packages/studio/src/components/Timeline/TimelineSequenceItem.tsx
index 0f0003d4eb..b52f93f5ec 100644
--- a/packages/studio/src/components/Timeline/TimelineSequenceItem.tsx
+++ b/packages/studio/src/components/Timeline/TimelineSequenceItem.tsx
@@ -1244,7 +1244,6 @@ const TimelineSequenceItemInner: React.FC<{
showSelectedBackground
containsSelection={containsSelection}
hovered={hovered}
- isFieldRow={false}
outerHeight={outerHeight}
onDragLeave={canDropEffect ? onEffectDragLeave : undefined}
onDragOver={canDropEffect ? onEffectDragOver : undefined}
diff --git a/packages/studio/src/components/Timeline/TimelineSequencePropItem.tsx b/packages/studio/src/components/Timeline/TimelineSequencePropItem.tsx
index 50e68db8c6..367d324b4d 100644
--- a/packages/studio/src/components/Timeline/TimelineSequencePropItem.tsx
+++ b/packages/studio/src/components/Timeline/TimelineSequencePropItem.tsx
@@ -649,14 +649,12 @@ export const TimelineSequencePropItem: React.FC<{
onDoubleClick={onPropertyDoubleClick}
showSelectedBackground
containsSelection={false}
- isFieldRow
outerHeight={null}
>
<TimelineFieldRowContent
field={field}
rowDepth={rowDepth}
selected={selection.selected}
- keyframeControls={keyframeControls}
>
{fieldValue}
</TimelineFieldRowContent>
diff --git a/packages/studio/src/components/Timeline/TimelineTransformOriginField.tsx b/packages/studio/src/components/Timeline/TimelineTransformOriginField.tsx
index b6e5dfaaee..6f1529bad0 100644
--- a/packages/studio/src/components/Timeline/TimelineTransformOriginField.tsx
+++ b/packages/studio/src/components/Timeline/TimelineTransformOriginField.tsx
@@ -22,15 +22,11 @@ import {
import {Transform3DModeContext} from './Transform3DModeContext';
const leftDraggerStyle: React.CSSProperties = {
- paddingBottom: 2,
paddingLeft: 0,
- paddingTop: 2,
};
const rightDraggerStyle: React.CSSProperties = {
- paddingBottom: 2,
paddingRight: 0,
- paddingTop: 2,
};
const containerStyle: React.CSSProperties = {
diff --git a/packages/studio/src/components/Timeline/TimelineTranslateField.tsx b/packages/studio/src/components/Timeline/TimelineTranslateField.tsx
index 7383a10e48..9239516f8f 100644
--- a/packages/studio/src/components/Timeline/TimelineTranslateField.tsx
+++ b/packages/studio/src/components/Timeline/TimelineTranslateField.tsx
@@ -12,15 +12,11 @@ import {parseTranslate, serializeTranslate} from './timeline-translate-utils';
import {Transform3DModeContext} from './Transform3DModeContext';
const leftDraggerStyle: React.CSSProperties = {
- paddingBottom: 2,
paddingLeft: 0,
- paddingTop: 2,
};
const rightDraggerStyle: React.CSSProperties = {
- paddingBottom: 2,
paddingRight: 0,
- paddingTop: 2,
};
const containerStyle: React.CSSProperties = {
diff --git a/packages/studio/src/components/Timeline/timeline-field-row-layout.ts b/packages/studio/src/components/Timeline/timeline-field-row-layout.ts
index 3a23e40223..e0c9d17ad2 100644
--- a/packages/studio/src/components/Timeline/timeline-field-row-layout.ts
+++ b/packages/studio/src/components/Timeline/timeline-field-row-layout.ts
@@ -5,6 +5,8 @@ import {
} from '../../helpers/timeline-layout';
import {getTimelineFieldLabelFlexBasis} from './timeline-row-layout';
+export const TIMELINE_STACKED_FIELD_HEADER_HEIGHT = 14;
+
export const isTimelineFieldStacked = ({
field,
transform3DMode,
@@ -45,18 +47,12 @@ export const timelineFieldValueColumnStyle: React.CSSProperties = {
paddingRight: EXPANDED_SECTION_PADDING_RIGHT,
};
-export const timelineCompactStackedFieldValueColumnStyle: React.CSSProperties =
- {
- ...timelineFieldValueColumnStyle,
- marginBottom: -3,
- position: 'relative',
- top: -3,
- };
-
export const timelineStackedFieldContentStyle: React.CSSProperties = {
alignSelf: 'stretch',
+ boxSizing: 'border-box',
display: 'flex',
flex: 1,
flexDirection: 'column',
minWidth: 0,
+ paddingBlock: 3,
};
diff --git a/packages/studio/src/components/Timeline/timeline-field-utils.ts b/packages/studio/src/components/Timeline/timeline-field-utils.ts
index 99710650e0..8b50b6c229 100644
--- a/packages/studio/src/components/Timeline/timeline-field-utils.ts
+++ b/packages/studio/src/components/Timeline/timeline-field-utils.ts
@@ -57,7 +57,5 @@ export const draggerStyle: React.CSSProperties = {
};
export const leftAlignedDraggerStyle: React.CSSProperties = {
- paddingBottom: 2,
paddingLeft: 0,
- paddingTop: 2,
};
diff --git a/packages/studio/src/helpers/hoverable.ts b/packages/studio/src/helpers/hoverable.ts
index 333389757d..28d85817b2 100644
--- a/packages/studio/src/helpers/hoverable.ts
+++ b/packages/studio/src/helpers/hoverable.ts
@@ -11,6 +11,7 @@ import {TRANSPARENT} from './colors';
export const HOVERABLE_CLASS_NAME = '__remotion-hoverable';
export const HOVER_GROUP_CLASS_NAME = '__remotion-hover-group';
export const HOVER_GROUP_REVEAL_CLASS_NAME = '__remotion-hover-group-reveal';
+export const FOCUS_VISIBLE_ONLY_CLASS_NAME = '__remotion-focus-visible-only';
const BG_VARIABLE = '--remotion-hoverable-bg';
const HOVER_BG_VARIABLE = '--remotion-hoverable-hover-bg';
diff --git a/packages/studio/src/helpers/inject-css.ts b/packages/studio/src/helpers/inject-css.ts
index b1761a846b..b8088c6c40 100644
--- a/packages/studio/src/helpers/inject-css.ts
+++ b/packages/studio/src/helpers/inject-css.ts
@@ -8,7 +8,7 @@ import {
TRANSPARENT,
WHITE,
} from './colors';
-import {makeHoverableCSS} from './hoverable';
+import {FOCUS_VISIBLE_ONLY_CLASS_NAME, makeHoverableCSS} from './hoverable';
const makeDefaultGlobalCSS = () => {
const dragAreaFactor = 2;
@@ -64,7 +64,7 @@ const makeDefaultGlobalCSS = () => {
input:focus,
textarea:focus,
- button:focus:not(.__remotion_input_dragger):not(.__remotion_color_swatch):not(.__remotion-inspector-section-title):not(.__remotion-timeline-expand-arrow-button),
+ button:focus:not(.__remotion_input_dragger):not(.__remotion_color_swatch):not(.__remotion-inspector-section-title):not(.${FOCUS_VISIBLE_ONLY_CLASS_NAME}):not(.__remotion-timeline-expand-arrow-button),
a:focus {
outline: none;
box-shadow: ${FOCUS_BOX_SHADOW};
@@ -73,6 +73,7 @@ const makeDefaultGlobalCSS = () => {
.__remotion-composition-selector-item:focus,
.__remotion-inspector-quick-action:focus,
.__remotion-inspector-section-title:focus,
+ .${FOCUS_VISIBLE_ONLY_CLASS_NAME}:focus,
.__remotion-timeline-expand-arrow-button:focus {
outline: none;
box-shadow: none;
@@ -81,6 +82,7 @@ const makeDefaultGlobalCSS = () => {
.__remotion-composition-selector-item:focus-visible,
.__remotion-inspector-quick-action:focus-visible,
.__remotion-inspector-section-title:focus-visible,
+ .${FOCUS_VISIBLE_ONLY_CLASS_NAME}:focus-visible,
.__remotion-timeline-expand-arrow-button:focus-visible {
box-shadow: ${FOCUS_BOX_SHADOW};
}
diff --git a/packages/studio/src/icons/align-center-horizontal.tsx b/packages/studio/src/icons/align-center-horizontal.tsx
index af63720b00..19cd21f814 100644
--- a/packages/studio/src/icons/align-center-horizontal.tsx
+++ b/packages/studio/src/icons/align-center-horizontal.tsx
@@ -13,12 +13,7 @@ export const AlignCenterHorizontalIcon: React.FC<SVGProps<SVGSVGElement>> = (
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
- <path
- d="M8 2V14"
- stroke={color}
- strokeOpacity="0.5"
- strokeLinecap="square"
- />
+ <path d="M8 2V14" stroke={color} strokeLinecap="square" />
<line x1="3" y1="6" x2="12" y2="6" stroke={color} strokeWidth="2" />
<line x1="4" y1="10" x2="11" y2="10" stroke={color} strokeWidth="2" />
</svg>
diff --git a/packages/studio/src/icons/align-left.tsx b/packages/studio/src/icons/align-left.tsx
index 5a74adcad8..311a0b38b2 100644
--- a/packages/studio/src/icons/align-left.tsx
+++ b/packages/studio/src/icons/align-left.tsx
@@ -6,12 +6,7 @@ export const AlignLeftIcon: React.FC<SVGProps<SVGSVGElement>> = (props) => {
return (
<svg {...props} viewBox="0 0 16 16" fill="none">
- <path
- d="M2 2L2 14"
- stroke={color}
- strokeOpacity="0.5"
- strokeLinecap="square"
- />
+ <path d="M2 2L2 14" stroke={color} strokeLinecap="square" />
<line x1="4" y1="6" x2="13" y2="6" stroke={color} strokeWidth="2" />
<line x1="4" y1="10" x2="11" y2="10" stroke={color} strokeWidth="2" />
</svg>
diff --git a/packages/studio/src/icons/align-right.tsx b/packages/studio/src/icons/align-right.tsx
index 9f05b52949..f3d9f1a02e 100644
--- a/packages/studio/src/icons/align-right.tsx
+++ b/packages/studio/src/icons/align-right.tsx
@@ -6,12 +6,7 @@ export const AlignRightIcon: React.FC<SVGProps<SVGSVGElement>> = (props) => {
return (
<svg {...props} viewBox="0 0 16 16" fill="none">
- <path
- d="M14 2V14"
- stroke={color}
- strokeOpacity="0.5"
- strokeLinecap="square"
- />
+ <path d="M14 2V14" stroke={color} strokeLinecap="square" />
<line x1="3" y1="6" x2="12" y2="6" stroke={color} strokeWidth="2" />
<line x1="5" y1="10" x2="12" y2="10" stroke={color} strokeWidth="2" />
</svg>