MCPcopy
hub / github.com/proksh/atomize / findBorder

Function findBorder

src/style-functions/findBorder.js:6–114  ·  view source on GitHub ↗
(border, borderColor, themeColors)

Source from the content-addressed store, hash-verified

4import arrayKeyMapToObject from "./arrayKeyMapToObject";
5
6const findBorder = (border, borderColor, themeColors) => {
7 if (!border) {
8 return;
9 }
10
11 const property = "border";
12
13 let style = [];
14
15 if (
16 typeof (
17 border.x ||
18 border.y ||
19 border.b ||
20 border.t ||
21 border.l ||
22 border.r
23 ) === "undefined"
24 ) {
25 style.push(
26 makeResponsiveBorder(border, property, themeColors, borderColor)
27 );
28 } else {
29 // If x direction exist
30 if (border.x != "undefined") {
31 style.push(
32 makeResponsiveBorder(
33 border.x,
34 `${property}-left`,
35 themeColors,
36 borderColor
37 )
38 );
39 style.push(
40 makeResponsiveBorder(
41 border.x,
42 `${property}-right`,
43 themeColors,
44 borderColor
45 )
46 );
47 }
48 // If y direction exist
49 if (border.y != "undefined") {
50 style.push(
51 makeResponsiveBorder(
52 border.y,
53 `${property}-top`,
54 themeColors,
55 borderColor
56 )
57 );
58 style.push(
59 makeResponsiveBorder(
60 border.y,
61 `${property}-bottom`,
62 themeColors,
63 borderColor

Callers 5

computeImageStyleFunction · 0.85
computeDivStyleFunction · 0.85
computeButtonStyleFunction · 0.85
computeDivStyleFunction · 0.85
computeTextStyleFunction · 0.85

Calls 2

makeResponsiveBorderFunction · 0.85
arrayKeyMapToObjectFunction · 0.85

Tested by

no test coverage detected