remotion: Add Visual Mode controls for border properties#9155
remotion: Add Visual Mode controls for border properties#9155sksingh2005 wants to merge 1 commit into
remotion: Add Visual Mode controls for border properties#9155Conversation
There was a problem hiding this comment.
test
Kimi K2 (free via Pullfrog for OSS) | 𝕏
|
Important Add docs and tests for the new Reviewed changes — this PR adds longhand border controls (
|
96e583f to
096bab6
Compare
Adds separate Visual Mode controls for `style.borderWidth`, `style.borderStyle` and `style.borderColor`, as proposed in remotion-dev#8806. Each property maps onto an existing field type (number, enum, color), so no new field type or editor component is needed, and `borderWidth` and `borderColor` are keyframable and can be animated individually. Using the longhand properties rather than the `style.border` shorthand avoids the shorthand's edge cases, which a parser would have to guess at: `border: 0` is a number rather than a string, so it could not be read as a width. Since React does not expand CSS shorthands, the `lower-third` Element is migrated to the longhand properties so its border is readable by the new controls. The rendered output is unchanged. Closes remotion-dev#8806 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
096bab6 to
0d024b9
Compare

Summary
style.borderWidth(number),style.borderStyle(enum) andstyle.borderColor(color) toborderSchema.borderWidthandborderColorare keyframable and can be animated individually;borderStyleis discrete, likestyle.fontWeight.borderStyledefaults tonone, the CSS initial value, and offers all 10 CSS border-style keywords.Interactive.borderSchemaso custom components can opt in, matchingInteractive.textSchema/Interactive.transformSchema.style.bordershorthand, which avoids the shorthand's edge cases — e.g.border: 0is a number rather than a string, so a parser could not read it as a width.lower-thirdElement to longhand, since React does not expand CSS shorthands; rendered output is unchanged.Interactive.borderSchemaininteractive.mdxandinteractivity-schema.mdx.Verification
turbo run make test formatting lintpasses acrossremotion,@remotion/studioand@remotion/studio-shared.packages/coreand keyframability tests in@remotion/studio-shared.borderSchemaemits exactlystyle.borderWidth(number),style.borderStyle(enum, 10 variants) andstyle.borderColor(color).isInteractivitySchemaFieldKeyframablereturnstrueforborderWidthandborderColor,falseforborderStyle.border: 0cannot report a1pxborder: no field defaults to1, and each control reads its own value with no inference.lower-thirdrenders identically, asborderWidth: 1resolves to1px.Related issue - #8806