MCPcopy Index your code
hub / github.com/proksh/atomize / findRoundedDirection

Function findRoundedDirection

src/style-functions/findRoundedDirection.js:4–95  ·  view source on GitHub ↗
(value, themeValues = {})

Source from the content-addressed store, hash-verified

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

Callers 5

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

Calls 2

makeResponsiveFunction · 0.85
arrayKeyMapToObjectFunction · 0.85

Tested by

no test coverage detected