Skip to content

Commit 5c0cd36

Browse files
committed
feat: expose a few more sass variables add background-clip
1 parent f28aba6 commit 5c0cd36

File tree

5 files changed

+33
-25
lines changed

5 files changed

+33
-25
lines changed

packages/react-widgets/src/scss/calendar.scss

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ $cell-color: $btn-color !default;
2828
$cell-border-color: null !default;
2929
$cell-border-radius: $btn-border-radius !default;
3030

31+
$cell-hover-bg: $btn-hover-bg !default;
32+
$cell-hover-border-color: $btn-hover-border-color !default;
33+
$cell-hover-color: $btn-hover-color !default;
34+
35+
$cell-active-bg: $btn-active-bg !default;
36+
$cell-active-border-color: $btn-active-border-color !default;
37+
$cell-active-color: $btn-active-color !default;
38+
3139
$cell-select-color: list.$selected-color !default;
3240
$cell-select-border-color: list.$selected-border-color !default;
3341
$cell-select-bg: list.$selected-bg !default;
@@ -67,17 +75,10 @@ $cell-select-bg: list.$selected-bg !default;
6775

6876
.rw-cell,
6977
.rw-calendar-btn {
70-
line-height: 2em;
71-
border-radius: $btn-border-radius;
78+
background-clip: $widget-background-clip;
7279

7380
@include mixins.focus();
7481

75-
&:hover {
76-
background-color: $btn-hover-bg;
77-
}
78-
&:active {
79-
background-color: $btn-active-bg;
80-
}
8182
// TODO: normal button disabled
8283
&:disabled,
8384
&.rw-state-disabled {
@@ -87,7 +88,16 @@ $cell-select-bg: list.$selected-bg !default;
8788
}
8889

8990
.rw-calendar-btn {
91+
line-height: 2em;
92+
border-radius: $btn-border-radius;
9093
border-color: $btn-border-color;
94+
95+
&:hover {
96+
background-color: $btn-hover-bg;
97+
}
98+
&:active {
99+
background-color: $btn-active-bg;
100+
}
91101
}
92102

93103
.rw-calendar-btn-left,
@@ -162,6 +172,13 @@ $cell-select-bg: list.$selected-bg !default;
162172
padding: $cell-padding;
163173
outline: none;
164174

175+
&:hover {
176+
background-color: $cell-hover-bg;
177+
}
178+
&:active {
179+
background-color: $cell-active-bg;
180+
}
181+
165182
&.rw-state-selected {
166183
background-color: $cell-select-bg;
167184
border-color: $cell-select-border-color;
@@ -191,6 +208,7 @@ $cell-select-bg: list.$selected-bg !default;
191208

192209
.rw-calendar-transition-next {
193210
-webkit-backface-visibility: hidden;
211+
backface-visibility: hidden;
194212

195213
.rw-calendar-transition-top & {
196214
@include _translate(0, -100%);
@@ -212,6 +230,7 @@ $cell-select-bg: list.$selected-bg !default;
212230

213231
.rw-calendar-transition-prev {
214232
-webkit-backface-visibility: hidden;
233+
backface-visibility: hidden;
215234
position: absolute;
216235
left: 0;
217236
top: 0;

packages/react-widgets/src/scss/list.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ $optgroup-font-weight: bold !default;
4848
color: $color;
4949
cursor: pointer;
5050
border: 1px solid transparent;
51+
background-clip: $widget-background-clip;
5152

5253
&:hover,
5354
[data-intent='keyboard'] &.rw-state-focus:not(.rw-state-selected) {

packages/react-widgets/src/scss/popup.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ $zindex-focused: $zindex + 1 !default;
5050
border-radius: $border-radius;
5151
box-shadow: $box-shadow;
5252
border: $border 1px solid;
53+
background-clip: $widget-background-clip;
5354
background: $bg;
5455

5556
& .rw-list {

packages/react-widgets/src/scss/variables.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ $widget-focus-color: rgba(0, 123, 255, 0.25) !default;
4343
$widget-focus-box-shadow: 0 0 0 $widget-focus-width $widget-focus-color !default;
4444
$widget-focus-transition: box-shadow 0.15s ease-in-out !default;
4545

46+
$widget-background-clip: border-box;
47+
4648
//
4749
// Buttons
4850
//

packages/react-widgets/src/scss/widget.scss

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
display: inline-flex;
3030
align-items: center;
3131
justify-content: center;
32+
background-clip: $widget-background-clip;
3233
cursor: pointer;
3334

3435
&:focus {
@@ -182,6 +183,7 @@ fieldset[disabled] .rw-widget {
182183
color: $input-color;
183184
background-color: $input-bg;
184185
box-shadow: $input-box-shadow;
186+
background-clip: $widget-background-clip;
185187

186188
// Listbox is also the rw-widget
187189
&.rw-state-disabled,
@@ -206,28 +208,11 @@ fieldset[disabled] .rw-widget {
206208
.rw-detect-autofill {
207209
@include mixins.btn-input-reset;
208210
@include mixins.input-base;
209-
210-
// &:autofill,
211-
// &:-webkit-autofill {
212-
// border-radius: 30px;
213-
// animation-name: react-widgets-autofill-start;
214-
215-
// // Make the backgound color become yellow _really slowly_
216-
// transition: background-color 50000s ease-in-out 0s;
217-
// }
218-
219-
// &:not(:autofill),
220-
// &:not(:-webkit-autofill) {
221-
// animation-name: react-widgets-autofill-cancel;
222-
// }
223211
}
224212

225213
.rw-detect-autofill:-webkit-autofill {
226-
// height: 50px;
227214
animation-name: react-widgets-autofill-start;
228215
animation-duration: 0.01ms;
229-
// animation-delay: 0.01ms;
230-
// transition: background-color 50000s ease-in-out 0s;
231216
}
232217

233218
.rw-detect-autofill:not(:-webkit-autofill) {

0 commit comments

Comments
 (0)