|
56 | 56 | 24 8 |
57 | 57 | 12))}) |
58 | 58 |
|
59 | | -(defn style-container |
| 59 | +(defn container-styles |
60 | 60 | [{:keys [size disabled? border-radius background-color border-color icon-only? icon-top |
61 | | - icon-left icon-right]}] |
62 | | - (merge {:height size |
63 | | - :align-items :center |
64 | | - :justify-content :center |
65 | | - :flex-direction (if icon-top :column :row) |
66 | | - :padding-horizontal (when-not (or icon-only? icon-left icon-right) |
67 | | - (case size |
68 | | - 56 (if border-color 10 11) |
69 | | - 40 16 |
70 | | - 32 12 |
71 | | - 24 7 |
72 | | - 16)) |
73 | | - :padding-left (when-not (or icon-only? icon-left) |
74 | | - (case size |
75 | | - 56 nil |
76 | | - 40 16 |
77 | | - 32 12 |
78 | | - 24 8 |
79 | | - 16)) |
80 | | - :padding-right (when-not (or icon-only? icon-right) |
81 | | - (case size |
82 | | - 56 nil |
83 | | - 40 16 |
84 | | - 32 12 |
85 | | - 24 8 |
86 | | - 16)) |
87 | | - :padding-top (when-not (or icon-only? icon-left icon-right) |
88 | | - (case size |
89 | | - 56 0 |
90 | | - 40 (if border-color 8 9) |
91 | | - 32 (if border-color 4 5) |
92 | | - 24 0 |
93 | | - (if border-color 8 9))) |
94 | | - :padding-bottom (when-not (or icon-only? icon-left icon-right) |
95 | | - (case size |
96 | | - 56 0 |
97 | | - 40 9 |
98 | | - 32 5 |
99 | | - 24 0 |
100 | | - 9)) |
101 | | - :overflow :hidden |
102 | | - :background-color (if disabled? (colors/alpha background-color 0.3) background-color) |
103 | | - :border-radius (if border-radius |
104 | | - border-radius |
105 | | - (case size |
106 | | - 56 12 |
107 | | - 40 12 |
108 | | - 32 10 |
109 | | - 24 8 |
110 | | - 12)) |
111 | | - :border-color border-color |
112 | | - :border-width (when border-color 1)} |
113 | | - (when icon-only? |
114 | | - {:width size}) |
115 | | - (when border-color |
116 | | - {:border-color border-color |
117 | | - :border-width 1}))) |
| 61 | + icon-left icon-right inner-style]}] |
| 62 | + [{:height size |
| 63 | + :align-items :center |
| 64 | + :justify-content :center |
| 65 | + :flex-direction (if icon-top :column :row) |
| 66 | + :padding-horizontal (when-not (or icon-only? icon-left icon-right) |
| 67 | + (case size |
| 68 | + 56 (if border-color 10 11) |
| 69 | + 40 16 |
| 70 | + 32 12 |
| 71 | + 24 7 |
| 72 | + 16)) |
| 73 | + :padding-left (when-not (or icon-only? icon-left) |
| 74 | + (case size |
| 75 | + 56 nil |
| 76 | + 40 16 |
| 77 | + 32 12 |
| 78 | + 24 8 |
| 79 | + 16)) |
| 80 | + :padding-right (when-not (or icon-only? icon-right) |
| 81 | + (case size |
| 82 | + 56 nil |
| 83 | + 40 16 |
| 84 | + 32 12 |
| 85 | + 24 8 |
| 86 | + 16)) |
| 87 | + :padding-top (when-not (or icon-only? icon-left icon-right) |
| 88 | + (case size |
| 89 | + 56 0 |
| 90 | + 40 (if border-color 8 9) |
| 91 | + 32 (if border-color 4 5) |
| 92 | + 24 0 |
| 93 | + (if border-color 8 9))) |
| 94 | + :padding-bottom (when-not (or icon-only? icon-left icon-right) |
| 95 | + (case size |
| 96 | + 56 0 |
| 97 | + 40 9 |
| 98 | + 32 5 |
| 99 | + 24 0 |
| 100 | + 9)) |
| 101 | + :overflow :hidden |
| 102 | + :background-color (if disabled? (colors/alpha background-color 0.3) background-color) |
| 103 | + :border-radius (if border-radius |
| 104 | + border-radius |
| 105 | + (case size |
| 106 | + 56 12 |
| 107 | + 40 12 |
| 108 | + 32 10 |
| 109 | + 24 8 |
| 110 | + 12)) |
| 111 | + :border-color border-color |
| 112 | + :border-width (when border-color 1)} |
| 113 | + (when icon-only? |
| 114 | + {:width size}) |
| 115 | + (when border-color |
| 116 | + {:border-color border-color |
| 117 | + :border-width 1}) |
| 118 | + inner-style]) |
0 commit comments