File tree Expand file tree Collapse file tree
builder-css-styles/border-radius
designto-token/token-container Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,10 +60,11 @@ export function borderRadius(r: BorderRadiusManifest): CSSProperties {
6060 "border-radius" : px ( r . all ) ,
6161 } ;
6262 } else {
63- console . warn ( "elliptical border radius not supported" ) ;
63+ // example - https://codepen.io/Mahe76/pen/ExZbdro
6464 return {
65- "border-radius" : px ( r . all . x ) ,
65+ "border-radius" : ` ${ px ( r . all . x ) } / ${ px ( r . all . y ) } ` ,
6666 } ;
67+ // TODO: support short handed version - `50%`
6768 }
6869 } else {
6970 return {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { tokenizeBackground } from "../token-background";
44import { BoxShape } from "@reflect-ui/core/lib/box-shape" ;
55import { keyFromNode } from "../key" ;
66import { tokenizeBorder } from "../token-border" ;
7- import { BoxShadowManifest } from "@reflect-ui/core" ;
7+ import { BorderRadius , BoxShadowManifest } from "@reflect-ui/core" ;
88
99function fromRectangle ( rect : nodes . ReflectRectangleNode ) : core . Container {
1010 const container = new core . Container ( {
@@ -30,7 +30,7 @@ function fromEllipse(ellipse: nodes.ReflectEllipseNode): core.Container {
3030 height : ellipse . height ,
3131 boxShadow : ellipse . shadows as BoxShadowManifest [ ] ,
3232 border : tokenizeBorder . fromNode ( ellipse ) ,
33- borderRadius : { all : Math . max ( ellipse . width , ellipse . height ) / 2 } ,
33+ borderRadius : BorderRadius . all ( { x : ellipse . width , y : ellipse . height } ) , // this is equivalant to css "50%"
3434 background : tokenizeBackground . fromFills ( ellipse . fills ) ,
3535 } ) ;
3636
You can’t perform that action at this time.
0 commit comments