MCPcopy Create free account
hub / github.com/codeaashu/claude-code / applyMarginStyles

Function applyMarginStyles

src/ink/styles.ts:454–482  ·  view source on GitHub ↗
(node: LayoutNode, style: Styles)

Source from the content-addressed store, hash-verified

452}
453
454const applyMarginStyles = (node: LayoutNode, style: Styles): void => {
455 if ('margin' in style) {
456 node.setMargin(LayoutEdge.All, style.margin ?? 0)
457 }
458
459 if ('marginX' in style) {
460 node.setMargin(LayoutEdge.Horizontal, style.marginX ?? 0)
461 }
462
463 if ('marginY' in style) {
464 node.setMargin(LayoutEdge.Vertical, style.marginY ?? 0)
465 }
466
467 if ('marginLeft' in style) {
468 node.setMargin(LayoutEdge.Start, style.marginLeft || 0)
469 }
470
471 if ('marginRight' in style) {
472 node.setMargin(LayoutEdge.End, style.marginRight || 0)
473 }
474
475 if ('marginTop' in style) {
476 node.setMargin(LayoutEdge.Top, style.marginTop || 0)
477 }
478
479 if ('marginBottom' in style) {
480 node.setMargin(LayoutEdge.Bottom, style.marginBottom || 0)
481 }
482}
483
484const applyPaddingStyles = (node: LayoutNode, style: Styles): void => {
485 if ('padding' in style) {

Callers 1

stylesFunction · 0.85

Calls 1

setMarginMethod · 0.45

Tested by

no test coverage detected