MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / convertToPaddings

Function convertToPaddings

packages/core/ui/styling/style-properties.ts:239–257  ·  view source on GitHub ↗
(value: string | CoreTypes.LengthType)

Source from the content-addressed store, hash-verified

237}
238
239function convertToPaddings(value: string | CoreTypes.LengthType): [CssProperty<Style, CoreTypes.LengthType>, CoreTypes.LengthType][] {
240 if (typeof value === 'string' && value !== 'auto') {
241 const thickness = parseShorthandPositioning(value);
242
243 return [
244 [paddingTopProperty, Length.parse(thickness.top)],
245 [paddingRightProperty, Length.parse(thickness.right)],
246 [paddingBottomProperty, Length.parse(thickness.bottom)],
247 [paddingLeftProperty, Length.parse(thickness.left)],
248 ];
249 } else {
250 return [
251 [paddingTopProperty, value],
252 [paddingRightProperty, value],
253 [paddingBottomProperty, value],
254 [paddingLeftProperty, value],
255 ];
256 }
257}
258
259function convertToTransform(value: string): [CssAnimationProperty<any, any>, any][] {
260 if (value === unsetValue) {

Callers

nothing calls this directly

Calls 2

parseMethod · 0.65

Tested by

no test coverage detected