@@ -2,23 +2,27 @@ module Lumi.Components.Border where
22
33import Prelude
44
5- import Color (cssStringHSLA )
5+ import Color (toHexString )
66import Lumi.Components.Color (colors )
77import JSS (JSS , jss )
88import React.Basic (Component , JSX , createComponent , element , makeStateless )
99import React.Basic.DOM (unsafeCreateDOMComponent )
1010
1111data BorderStyle
12- = Top
13- | Bottom
12+ = SquareTop
13+ | SquareBottom
1414 | Round
1515 | Square
16+ | Top
17+ | Bottom
1618
1719toStyle :: BorderStyle -> String
18- toStyle Top = " top"
19- toStyle Bottom = " bottom"
20+ toStyle SquareTop = " square- top"
21+ toStyle SquareBottom = " square- bottom"
2022toStyle Round = " round"
2123toStyle Square = " square"
24+ toStyle Top = " top"
25+ toStyle Bottom = " bottom"
2226
2327component :: Component BorderProps
2428component = createComponent " Border"
@@ -53,6 +57,20 @@ borderRound children =
5357 , borderStyle: Round
5458 }
5559
60+ borderSquareTop :: JSX -> JSX
61+ borderSquareTop children =
62+ border
63+ { children
64+ , borderStyle: SquareTop
65+ }
66+
67+ borderSquareBottom :: JSX -> JSX
68+ borderSquareBottom children =
69+ border
70+ { children
71+ , borderStyle: SquareBottom
72+ }
73+
5674borderTop :: JSX -> JSX
5775borderTop children =
5876 border
@@ -72,24 +90,41 @@ styles :: JSS
7290styles = jss
7391 { " @global" :
7492 { " lumi-border" :
75- { border: " 1px solid " <> cssStringHSLA colors.black3
93+ { borderColor: toHexString colors.black3
94+ , borderStyle: " solid"
95+ , borderWidth: " 1px"
96+ , padding: " 16px"
7697 , overflow: " hidden"
7798 , " &[data-border-style='round']" :
78- { borderRadius: " 5px" }
99+ { borderRadius: " 5px"
100+ }
79101 , " &[data-border-style='square']" :
80- { borderRadius: " 0px" }
81- , " &[data-border-style='top']" :
102+ { borderRadius: " 0px"
103+ }
104+ , " &[data-border-style='square-bottom']" :
82105 { borderTopRightRadius: " 5px"
83106 , borderTopLeftRadius: " 5px"
84107 , borderBottomRightRadius: " 0px"
85108 , borderBottomLeftRadius: " 0px"
86109 }
87- , " &[data-border-style='bottom ']" :
110+ , " &[data-border-style='square-top ']" :
88111 { borderTopRightRadius: " 0px"
89112 , borderTopLeftRadius: " 0px"
90113 , borderBottomRightRadius: " 5px"
91114 , borderBottomLeftRadius: " 5px"
92115 }
116+ , " &[data-border-style='top']" :
117+ { border: " inherit"
118+ , borderTop: " 1px solid " <> toHexString colors.black3
119+ , paddingLeft: " 0px"
120+ , paddingRight: " 0px"
121+ }
122+ , " &[data-border-style='bottom']" :
123+ { border: " inherit"
124+ , borderBottom: " 1px solid " <> toHexString colors.black3
125+ , paddingLeft: " 0px"
126+ , paddingRight: " 0px"
127+ }
93128 }
94129 }
95130 }
0 commit comments