Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/codegen/__tests__/__snapshots__/codegen.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ exports[`Codegen renders text node with ellipsis props 1`] = `

exports[`Codegen renders text node with single drop shadow 1`] = `
"<Text
boxShadow="2px 4px 6px 0 #00000080"
boxSize="100%"
color="#F00"
fontFamily="Arial"
Expand All @@ -408,7 +407,6 @@ exports[`Codegen renders text node with single drop shadow 1`] = `

exports[`Codegen renders text node with multiple drop shadows 1`] = `
"<Text
boxShadow="1px 2px 3px 0 #F00, 4px 5px 6px 0 #0F0C"
boxSize="100%"
color="#F00"
fontFamily="Arial"
Expand Down Expand Up @@ -3331,7 +3329,6 @@ exports[`render real world component real world $ 99`] = `
return (
<Text
WebkitTextStroke="3px #FFF"
boxShadow="0 0 12px 0 #7C70FF"
color="#4C05FF"
fontFamily="Jalnan 2 TTF"
fontSize="38px"
Expand Down Expand Up @@ -3394,7 +3391,6 @@ exports[`render real world component real world $ 102`] = `
return (
<Text
WebkitTextStroke="2px #FFF"
boxShadow="0 0 12px 0 #7C70FF, 0 10px 24px 0 #FFC9FE66"
color="transparent"
fontFamily="Jalnan Gothic TTF"
fontSize="64px"
Expand Down
8 changes: 7 additions & 1 deletion src/codegen/props/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ export function getEffectProps(
node: SceneNode,
): Record<string, string> | undefined {
if ('effects' in node && node.effects.length > 0) {
return node.effects.reduce(
// TEXT nodes use textShadow for DROP_SHADOW (handled by text-shadow.ts)
const effects =
node.type === 'TEXT'
? node.effects.filter((e) => e.type !== 'DROP_SHADOW')
: node.effects
if (effects.length === 0) return
return effects.reduce(
(acc, effect) => {
const props = _getEffectPropsFromEffect(effect)
for (const [key, value] of Object.entries(props)) {
Expand Down
Loading