@@ -13,17 +13,17 @@ class BrowserButton extends ImmutableComponent {
13
13
styles . browserButton ,
14
14
this . props . primaryColor && [ styles . browserButton_default , styles . browserButton_primaryColor ] ,
15
15
this . props . secondaryColor && [ styles . browserButton_default , styles . browserButton_secondaryColor ] ,
16
+ this . props . subtleItem && [ styles . browserButton_default , styles . browserButton_subtleItem ] ,
16
17
this . props . extensionItem && styles . browserButton_extensionItem ,
17
18
this . props . groupedItem && styles . browserButton_groupedItem ,
18
19
this . props . notificationItem && styles . browserButton_notificationItem
19
20
// TODO: These are other button styles app-wise
20
21
// that needs to be refactored and included in this file
21
22
// .............................................
22
- // this.props.smallItem && styles.browserButton_actionItem ,
23
+ // this.props.smallItem && styles.browserButton_smallItem ,
23
24
// this.props.actionItem && styles.browserButton_actionItem,
24
25
// this.props.navItem && styles.browserButton_navItem,
25
26
// this.props.panelItem && styles.browserButton_panelItem,
26
- // this.props.subtleItem && styles.browserButton_subtleItem
27
27
]
28
28
}
29
29
render ( ) {
@@ -46,18 +46,19 @@ class BrowserButton extends ImmutableComponent {
46
46
}
47
47
}
48
48
49
+ const buttonSize = '25px'
50
+
49
51
const styles = StyleSheet . create ( {
50
52
browserButton : {
51
53
margin : '0 3px' ,
52
54
whiteSpace : 'nowrap' ,
53
55
outline : 'none' ,
54
56
cursor : 'default' ,
55
57
display : 'inline-block' ,
56
- lineHeight : '25px' ,
57
- height : '25px' ,
58
- width : '25px' ,
58
+ lineHeight : buttonSize ,
59
+ height : buttonSize ,
60
+ width : buttonSize ,
59
61
fontSize : '13px' ,
60
- color : globalStyles . button . default . color ,
61
62
borderRadius : '2px' ,
62
63
textAlign : 'center' ,
63
64
transition : '.1s opacity, .1s background' ,
@@ -68,49 +69,71 @@ const styles = StyleSheet.create({
68
69
backgroundImage : 'none' ,
69
70
backgroundColor : globalStyles . button . default . backgroundColor ,
70
71
border : 'none' ,
72
+
73
+ // cf: https://github.com/brave/browser-laptop/blob/548e11b1c889332fadb379237555625ad2a3c845/less/button.less#L49
74
+ color : globalStyles . button . color ,
75
+
71
76
':hover' : {
72
77
color : globalStyles . button . default . hoverColor
73
78
}
74
79
} ,
80
+
75
81
// applies for primary and white buttons
76
82
browserButton_default : {
83
+ // cf: https://github.com/brave/browser-laptop/blob/548e11b1c889332fadb379237555625ad2a3c845/less/button.less#L92
84
+ color : globalStyles . button . default . color ,
85
+
77
86
position : 'relative' ,
78
87
boxShadow : globalStyles . button . default . boxShadow ,
79
88
cursor : 'pointer' ,
80
89
lineHeight : 1.25 ,
81
90
width : 'auto' ,
82
91
height : 'auto' ,
83
- minWidth : '78px' ,
84
- fontSize : '13px' ,
85
- padding : '7px 20px' ,
92
+ fontSize : globalStyles . spacing . defaultFontSize ,
93
+
94
+ // cf: https://github.com/brave/browser-laptop/blob/548e11b1c889332fadb379237555625ad2a3c845/less/button.less#L94-L95
95
+ paddingTop : '5px' ,
96
+ paddingBottom : '5px' ,
97
+
98
+ // cf: https://github.com/brave/browser-laptop/blob/548e11b1c889332fadb379237555625ad2a3c845/less/button.less#L105-L106
99
+ paddingRight : '16px' ,
100
+ paddingLeft : '16px' ,
101
+
102
+ // cf: https://github.com/brave/browser-laptop/blob/548e11b1c889332fadb379237555625ad2a3c845/less/button.less#L98
103
+ minWidth : `calc(${ globalStyles . spacing . defaultFontSize } * 6)` , // issue #6384
104
+
86
105
':active' : {
87
106
// push the button down when active
88
107
bottom : '-1px'
89
108
}
90
109
} ,
110
+
91
111
browserButton_primaryColor : {
92
112
background : globalStyles . button . primary . background ,
93
113
borderLeft : '2px solid transparent' ,
94
114
borderRight : '2px solid transparent' ,
95
115
borderTop : `2px solid ${ globalStyles . button . primary . gradientColor1 } ` ,
96
116
borderBottom : `2px solid ${ globalStyles . button . primary . gradientColor2 } ` ,
97
- color : globalStyles . button . primary . color ,
98
117
cursor : 'pointer' ,
118
+
99
119
':hover' : {
100
120
border : `2px solid ${ globalStyles . button . primary . borderHoverColor } ` ,
101
121
color : globalStyles . button . primary . hoverColor
102
122
}
103
123
} ,
124
+
104
125
browserButton_secondaryColor : {
105
126
background : globalStyles . button . secondary . background ,
106
127
border : '1px solid white' ,
107
128
color : globalStyles . button . secondary . color ,
108
129
cursor : 'pointer' ,
130
+
109
131
':hover' : {
110
132
border : `1px solid ${ globalStyles . button . secondary . borderHoverColor } ` ,
111
133
color : globalStyles . button . secondary . hoverColor
112
134
}
113
135
} ,
136
+
114
137
browserButton_extensionItem : {
115
138
WebkitAppRegion : 'no-drag' ,
116
139
backgroundSize : 'contain' ,
@@ -119,20 +142,42 @@ const styles = StyleSheet.create({
119
142
opacity : '0.85' ,
120
143
backgroundRepeat : 'no-repeat'
121
144
} ,
145
+
122
146
browserButton_groupedItem : {
123
147
// Legacy LESS inside ledger is too nested
124
148
// and this style won't have effect without using !important
149
+ //
125
150
// TODO: remove !important and check advancedSettings.js
126
151
// once preferences is fully refactored
127
152
marginRight : '4px !important' ,
128
153
marginLeft : '4px !important'
129
154
} ,
155
+
130
156
browserButton_notificationItem : {
131
157
fontSize : '13px' ,
132
158
marginRight : '10px' ,
133
159
padding : '2px 15px' ,
134
160
textTransform : 'capitalize' ,
135
161
width : 'auto'
162
+ } ,
163
+
164
+ browserButton_subtleItem : {
165
+ background : globalStyles . button . subtle . backgroundColor ,
166
+
167
+ // cf: https://github.com/brave/browser-laptop/blob/548e11b1c889332fadb379237555625ad2a3c845/less/button.less#L152
168
+ fontSize : '14px' ,
169
+
170
+ // Adding box-shadow:none to cancel the box-shadow specified on browserButton_default
171
+ // On button.less, box-shadow is only speficied to .primaryButton and .whiteButton
172
+ // cf:
173
+ // https://github.com/brave/browser-laptop/blob/548e11b1c889332fadb379237555625ad2a3c845/less/button.less#L114
174
+ // https://github.com/brave/browser-laptop/blob/548e11b1c889332fadb379237555625ad2a3c845/less/button.less#L137
175
+ boxShadow : 'none' ,
176
+
177
+ // Cancel pushing down the button to make the button subtle
178
+ ':active' : {
179
+ bottom : 0
180
+ }
136
181
}
137
182
} )
138
183
0 commit comments