@@ -2,18 +2,29 @@ import { getCommonRadius } from "../../common/commonRadius";
22import { formatWithJSX } from "../../common/parseJSX" ;
33
44export const htmlBorderRadius = ( node : SceneNode , isJsx : boolean ) : string [ ] => {
5+ let comp : string [ ] = [ ] ;
6+
7+ if (
8+ "children" in node &&
9+ node . children . length > 0 &&
10+ "clipsContent" in node &&
11+ node . clipsContent === true
12+ ) {
13+ comp . push ( formatWithJSX ( "overflow" , isJsx , "hidden" ) ) ;
14+ }
15+
516 if ( node . type === "ELLIPSE" ) {
6- return [ formatWithJSX ( "border-radius" , isJsx , 9999 ) ] ;
17+ comp . push ( formatWithJSX ( "border-radius" , isJsx , 9999 ) ) ;
18+ return comp ;
719 }
820
921 const radius = getCommonRadius ( node ) ;
1022
11- let comp : string [ ] = [ ] ;
1223 let singleCorner : number = 0 ;
1324
1425 if ( "all" in radius ) {
1526 if ( radius . all === 0 ) {
16- return [ ] ;
27+ return comp ;
1728 }
1829 singleCorner = radius . all ;
1930 comp . push ( formatWithJSX ( "border-radius" , isJsx , radius . all ) ) ;
@@ -41,14 +52,6 @@ export const htmlBorderRadius = (node: SceneNode, isJsx: boolean): string[] => {
4152 }
4253 }
4354
44- if (
45- "children" in node &&
46- "clipsContent" in node &&
47- node . children . length > 0 &&
48- node . clipsContent === true
49- ) {
50- comp . push ( formatWithJSX ( "overflow" , isJsx , "hidden" ) ) ;
51- }
52-
55+ console . log ( "comp was" , comp ) ;
5356 return comp ;
5457} ;
0 commit comments