rsuite 5.48.1 → 5.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/Cascader/styles/index.less +5 -4
- package/DatePicker/styles/index.less +18 -11
- package/DateRangeInput/package.json +7 -0
- package/DateRangePicker/styles/index.less +20 -0
- package/Dropdown/styles/index.less +5 -4
- package/Dropdown/styles/mixin.less +0 -11
- package/InputGroup/styles/index.less +1 -0
- package/Picker/styles/index.less +51 -24
- package/Picker/styles/mixin.less +17 -13
- package/README.md +34 -24
- package/Sidenav/styles/index.less +2 -0
- package/TagInput/styles/index.less +1 -1
- package/cjs/AutoComplete/AutoComplete.js +25 -26
- package/cjs/Calendar/Calendar.d.ts +5 -1
- package/cjs/Calendar/CalendarContainer.d.ts +7 -1
- package/cjs/Calendar/CalendarContainer.js +11 -4
- package/cjs/Calendar/CalendarHeader.js +2 -0
- package/cjs/Calendar/MonthDropdown.js +7 -2
- package/cjs/Calendar/MonthDropdownItem.js +2 -2
- package/cjs/Calendar/Table.js +6 -1
- package/cjs/Calendar/TimeDropdown.js +17 -10
- package/cjs/Calendar/types.d.ts +1 -0
- package/cjs/Cascader/Cascader.js +46 -48
- package/cjs/CheckPicker/CheckPicker.d.ts +2 -2
- package/cjs/CheckPicker/CheckPicker.js +33 -36
- package/cjs/CheckTreePicker/CheckTreePicker.js +61 -64
- package/cjs/CustomProvider/CustomProvider.d.ts +13 -0
- package/cjs/CustomProvider/CustomProvider.js +2 -2
- package/cjs/DateInput/DateField.d.ts +9 -31
- package/cjs/DateInput/DateField.js +61 -12
- package/cjs/DateInput/DateInput.d.ts +7 -2
- package/cjs/DateInput/DateInput.js +74 -92
- package/cjs/DateInput/index.d.ts +4 -0
- package/cjs/DateInput/index.js +19 -1
- package/cjs/DateInput/useDateInputState.d.ts +7 -31
- package/cjs/DateInput/useDateInputState.js +39 -15
- package/cjs/DateInput/useIsFocused.d.ts +7 -0
- package/cjs/DateInput/useIsFocused.js +28 -0
- package/cjs/DateInput/useKeyboardInputEvent.d.ts +10 -0
- package/cjs/DateInput/useKeyboardInputEvent.js +44 -0
- package/cjs/DateInput/utils.d.ts +23 -1
- package/cjs/DateInput/utils.js +155 -51
- package/cjs/DatePicker/DatePicker.d.ts +25 -8
- package/cjs/DatePicker/DatePicker.js +208 -241
- package/cjs/DatePicker/Toolbar.js +5 -22
- package/cjs/DatePicker/utils.d.ts +5 -1
- package/cjs/DatePicker/utils.js +17 -1
- package/cjs/DateRangeInput/DateRangeInput.d.ts +29 -0
- package/cjs/DateRangeInput/DateRangeInput.js +244 -0
- package/cjs/DateRangeInput/index.d.ts +3 -0
- package/cjs/DateRangeInput/index.js +9 -0
- package/cjs/DateRangeInput/utils.d.ts +61 -0
- package/cjs/DateRangeInput/utils.js +146 -0
- package/cjs/DateRangePicker/Calendar.js +24 -23
- package/cjs/DateRangePicker/DateRangePicker.d.ts +18 -4
- package/cjs/DateRangePicker/DateRangePicker.js +251 -203
- package/cjs/DateRangePicker/types.d.ts +11 -3
- package/cjs/DateRangePicker/utils.d.ts +2 -1
- package/cjs/DateRangePicker/utils.js +7 -5
- package/cjs/FormControl/FormControl.d.ts +11 -1
- package/cjs/FormControl/FormControl.js +6 -5
- package/cjs/Input/Input.d.ts +11 -0
- package/cjs/Input/Input.js +11 -8
- package/cjs/InputPicker/InputPicker.js +62 -63
- package/cjs/MultiCascader/MultiCascader.js +40 -42
- package/cjs/Overlay/OverlayTrigger.d.ts +3 -0
- package/cjs/Overlay/OverlayTrigger.js +5 -0
- package/cjs/Picker/PickerIndicator.d.ts +10 -0
- package/cjs/Picker/PickerIndicator.js +49 -0
- package/cjs/Picker/PickerLabel.d.ts +9 -0
- package/cjs/Picker/PickerLabel.js +23 -0
- package/cjs/Picker/PickerToggle.d.ts +17 -22
- package/cjs/Picker/PickerToggle.js +52 -177
- package/cjs/Picker/index.d.ts +3 -0
- package/cjs/Picker/index.js +10 -1
- package/cjs/Picker/usePickerRef.d.ts +19 -0
- package/cjs/Picker/usePickerRef.js +88 -0
- package/cjs/Picker/utils.d.ts +5 -9
- package/cjs/Picker/utils.js +22 -89
- package/cjs/SelectPicker/SelectPicker.d.ts +2 -2
- package/cjs/SelectPicker/SelectPicker.js +39 -42
- package/cjs/TreePicker/TreePicker.js +72 -75
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +3 -1
- package/cjs/locales/index.d.ts +2 -2
- package/cjs/utils/constants.d.ts +2 -1
- package/cjs/utils/constants.js +1 -0
- package/cjs/utils/dateUtils.d.ts +0 -1
- package/cjs/utils/dateUtils.js +0 -6
- package/cjs/utils/getStringLength.d.ts +2 -0
- package/cjs/utils/getStringLength.js +18 -0
- package/cjs/utils/index.d.ts +3 -0
- package/cjs/utils/index.js +11 -2
- package/cjs/utils/useCustom.js +1 -1
- package/cjs/utils/useIsomorphicLayoutEffect.d.ts +3 -0
- package/cjs/utils/useIsomorphicLayoutEffect.js +9 -0
- package/dist/rsuite-no-reset-rtl.css +140 -207
- package/dist/rsuite-no-reset-rtl.min.css +1 -1
- package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
- package/dist/rsuite-no-reset.css +140 -207
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +140 -75
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +140 -75
- package/dist/rsuite.js +4833 -258
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.css.map +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/AutoComplete/AutoComplete.js +28 -29
- package/esm/Calendar/Calendar.d.ts +5 -1
- package/esm/Calendar/CalendarContainer.d.ts +7 -1
- package/esm/Calendar/CalendarContainer.js +12 -5
- package/esm/Calendar/CalendarHeader.js +2 -0
- package/esm/Calendar/MonthDropdown.js +7 -2
- package/esm/Calendar/MonthDropdownItem.js +2 -2
- package/esm/Calendar/Table.js +6 -1
- package/esm/Calendar/TimeDropdown.js +17 -10
- package/esm/Calendar/types.d.ts +1 -0
- package/esm/Cascader/Cascader.js +49 -51
- package/esm/CheckPicker/CheckPicker.d.ts +2 -2
- package/esm/CheckPicker/CheckPicker.js +36 -39
- package/esm/CheckTreePicker/CheckTreePicker.js +64 -67
- package/esm/CustomProvider/CustomProvider.d.ts +13 -0
- package/esm/CustomProvider/CustomProvider.js +3 -3
- package/esm/DateInput/DateField.d.ts +9 -31
- package/esm/DateInput/DateField.js +61 -12
- package/esm/DateInput/DateInput.d.ts +7 -2
- package/esm/DateInput/DateInput.js +77 -95
- package/esm/DateInput/index.d.ts +4 -0
- package/esm/DateInput/index.js +4 -0
- package/esm/DateInput/useDateInputState.d.ts +7 -31
- package/esm/DateInput/useDateInputState.js +41 -18
- package/esm/DateInput/useIsFocused.d.ts +7 -0
- package/esm/DateInput/useIsFocused.js +22 -0
- package/esm/DateInput/useKeyboardInputEvent.d.ts +10 -0
- package/esm/DateInput/useKeyboardInputEvent.js +38 -0
- package/esm/DateInput/utils.d.ts +23 -1
- package/esm/DateInput/utils.js +150 -51
- package/esm/DatePicker/DatePicker.d.ts +25 -8
- package/esm/DatePicker/DatePicker.js +211 -244
- package/esm/DatePicker/Toolbar.js +5 -22
- package/esm/DatePicker/utils.d.ts +5 -1
- package/esm/DatePicker/utils.js +16 -1
- package/esm/DateRangeInput/DateRangeInput.d.ts +29 -0
- package/esm/DateRangeInput/DateRangeInput.js +237 -0
- package/esm/DateRangeInput/index.d.ts +3 -0
- package/esm/DateRangeInput/index.js +3 -0
- package/esm/DateRangeInput/utils.d.ts +61 -0
- package/esm/DateRangeInput/utils.js +137 -0
- package/esm/DateRangePicker/Calendar.js +25 -23
- package/esm/DateRangePicker/DateRangePicker.d.ts +18 -4
- package/esm/DateRangePicker/DateRangePicker.js +253 -205
- package/esm/DateRangePicker/types.d.ts +11 -3
- package/esm/DateRangePicker/utils.d.ts +2 -1
- package/esm/DateRangePicker/utils.js +7 -5
- package/esm/FormControl/FormControl.d.ts +11 -1
- package/esm/FormControl/FormControl.js +4 -3
- package/esm/Input/Input.d.ts +11 -0
- package/esm/Input/Input.js +12 -9
- package/esm/InputPicker/InputPicker.js +64 -65
- package/esm/MultiCascader/MultiCascader.js +43 -45
- package/esm/Overlay/OverlayTrigger.d.ts +3 -0
- package/esm/Overlay/OverlayTrigger.js +5 -0
- package/esm/Picker/PickerIndicator.d.ts +10 -0
- package/esm/Picker/PickerIndicator.js +43 -0
- package/esm/Picker/PickerLabel.d.ts +9 -0
- package/esm/Picker/PickerLabel.js +17 -0
- package/esm/Picker/PickerToggle.d.ts +17 -22
- package/esm/Picker/PickerToggle.js +54 -179
- package/esm/Picker/index.d.ts +3 -0
- package/esm/Picker/index.js +3 -0
- package/esm/Picker/usePickerRef.d.ts +19 -0
- package/esm/Picker/usePickerRef.js +82 -0
- package/esm/Picker/utils.d.ts +5 -9
- package/esm/Picker/utils.js +24 -90
- package/esm/SelectPicker/SelectPicker.d.ts +2 -2
- package/esm/SelectPicker/SelectPicker.js +42 -45
- package/esm/TreePicker/TreePicker.js +75 -78
- package/esm/index.d.ts +2 -0
- package/esm/index.js +1 -0
- package/esm/locales/index.d.ts +2 -2
- package/esm/utils/constants.d.ts +2 -1
- package/esm/utils/constants.js +1 -0
- package/esm/utils/dateUtils.d.ts +0 -1
- package/esm/utils/dateUtils.js +0 -5
- package/esm/utils/getStringLength.d.ts +2 -0
- package/esm/utils/getStringLength.js +13 -0
- package/esm/utils/index.d.ts +3 -0
- package/esm/utils/index.js +4 -1
- package/esm/utils/useCustom.js +2 -2
- package/esm/utils/useIsomorphicLayoutEffect.d.ts +3 -0
- package/esm/utils/useIsomorphicLayoutEffect.js +4 -0
- package/package.json +1 -1
- package/styles/color-modes/dark.less +1 -0
- package/styles/color-modes/high-contrast.less +1 -0
- package/styles/color-modes/light.less +1 -0
- package/styles/mixins/combobox.less +10 -0
- package/styles/normalize.less +230 -231
package/esm/utils/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { default as scrollTopAnimation } from './scrollTopAnimation';
|
|
|
24
24
|
export { default as appendTooltip } from './appendTooltip';
|
|
25
25
|
export { default as render } from './render';
|
|
26
26
|
export { default as safeSetSelection } from './safeSetSelection';
|
|
27
|
+
export { default as getStringLength } from './getStringLength';
|
|
27
28
|
/** Hooks **/
|
|
28
29
|
export { default as useClassNames } from './useClassNames';
|
|
29
30
|
export { default as useEventListener } from './useEventListener';
|
|
@@ -42,3 +43,5 @@ export { default as useWillUnmount } from './useWillUnmount';
|
|
|
42
43
|
export { default as useUpdateEffect } from './useUpdateEffect';
|
|
43
44
|
export { default as useIsMounted } from './useIsMounted';
|
|
44
45
|
export { default as useMount } from './useMount';
|
|
46
|
+
export { default as useUniqueId } from './useUniqueId';
|
|
47
|
+
export { default as useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';
|
package/esm/utils/index.js
CHANGED
|
@@ -27,6 +27,7 @@ export { default as scrollTopAnimation } from './scrollTopAnimation';
|
|
|
27
27
|
export { default as appendTooltip } from './appendTooltip';
|
|
28
28
|
export { default as render } from './render';
|
|
29
29
|
export { default as safeSetSelection } from './safeSetSelection';
|
|
30
|
+
export { default as getStringLength } from './getStringLength';
|
|
30
31
|
|
|
31
32
|
/** Hooks **/
|
|
32
33
|
export { default as useClassNames } from './useClassNames';
|
|
@@ -45,4 +46,6 @@ export { default as useUpdatedRef } from './useUpdatedRef';
|
|
|
45
46
|
export { default as useWillUnmount } from './useWillUnmount';
|
|
46
47
|
export { default as useUpdateEffect } from './useUpdateEffect';
|
|
47
48
|
export { default as useIsMounted } from './useIsMounted';
|
|
48
|
-
export { default as useMount } from './useMount';
|
|
49
|
+
export { default as useMount } from './useMount';
|
|
50
|
+
export { default as useUniqueId } from './useUniqueId';
|
|
51
|
+
export { default as useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';
|
package/esm/utils/useCustom.js
CHANGED
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
import { useContext, useCallback } from 'react';
|
|
4
4
|
import defaultLocale from '../locales/default';
|
|
5
5
|
import { CustomContext } from '../CustomProvider/CustomProvider';
|
|
6
|
-
import { format, parse } from '../utils/dateUtils';
|
|
6
|
+
import { format, parse, isValid } from '../utils/dateUtils';
|
|
7
7
|
var mergeObject = function mergeObject(list) {
|
|
8
8
|
return list.reduce(function (a, b) {
|
|
9
9
|
a = _extends({}, a, b);
|
|
@@ -39,7 +39,7 @@ function useCustom(keys, overrideLocale) {
|
|
|
39
39
|
}
|
|
40
40
|
var defaultFormatDate = useCallback(function (date, formatStr) {
|
|
41
41
|
var _locale$Calendar;
|
|
42
|
-
return format(date, formatStr, {
|
|
42
|
+
return format(isValid(date) ? date : new Date(), formatStr, {
|
|
43
43
|
locale: locale === null || locale === void 0 ? void 0 : (_locale$Calendar = locale.Calendar) === null || _locale$Calendar === void 0 ? void 0 : _locale$Calendar.dateLocale
|
|
44
44
|
});
|
|
45
45
|
}, [(_locale$Calendar2 = locale.Calendar) === null || _locale$Calendar2 === void 0 ? void 0 : _locale$Calendar2.dateLocale]);
|
package/package.json
CHANGED
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
--rs-color-focus-ring: 0 0 0 3px rgb(from var(--rs-gray-500) r g b / 25%);
|
|
80
80
|
--rs-state-focus-shadow: 0 0 0 3px rgb(from var(--rs-gray-500) r g b / 25%);
|
|
81
81
|
--rs-state-focus-outline: 3px solid rgb(from var(--rs-gray-500) r g b / 25%);
|
|
82
|
+
--rs-state-error-outline: 3px solid rgb(from var(--rs-color-red) r g b / 25%);
|
|
82
83
|
--rs-shadow-overlay: 0 4px 4px rgba(0, 0, 0, 0.12), 0 0 10px rgba(0, 0, 0, 0.06);
|
|
83
84
|
|
|
84
85
|
// Button
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
--rs-state-focus-shadow: 0 0 0 3px var(--rs-gray-900), 0 0 0 5px var(--rs-gray-0);
|
|
81
81
|
--rs-state-focus-shadow-slim: 0 0 0 2px var(--rs-gray-0);
|
|
82
82
|
--rs-state-focus-outline: 3px solid rgb(from var(--rs-primary-500) r g b / 25%);
|
|
83
|
+
--rs-state-error-outline: 3px solid rgb(from var(--rs-color-red) r g b / 25%);
|
|
83
84
|
--rs-shadow-overlay: 0 4px 4px rgba(0, 0, 0, 0.12), 0 0 10px rgba(0, 0, 0, 0.06);
|
|
84
85
|
|
|
85
86
|
// Button
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
--rs-color-focus-ring: rgb(from var(--rs-primary-500) r g b / 25%);
|
|
87
87
|
--rs-state-focus-shadow: 0 0 0 3px rgb(from var(--rs-primary-500) r g b / 25%);
|
|
88
88
|
--rs-state-focus-outline: 3px solid rgb(from var(--rs-primary-500) r g b / 25%);
|
|
89
|
+
--rs-state-error-outline: 3px solid rgb(from var(--rs-color-red) r g b / 25%);
|
|
89
90
|
--rs-shadow-overlay: 0 4px 4px rgba(0, 0, 0, 0.12), 0 0 10px rgba(0, 0, 0, 0.06);
|
|
90
91
|
|
|
91
92
|
// Button
|
package/styles/normalize.less
CHANGED
|
@@ -6,243 +6,242 @@
|
|
|
6
6
|
// Heads up! This reset may cause conflicts with some third-party widgets.
|
|
7
7
|
// For recommendations on resolving such conflicts, see
|
|
8
8
|
// http://getbootstrap.com/getting-started/#third-box-sizing
|
|
9
|
-
* {
|
|
9
|
+
*[class*='rs-'] {
|
|
10
10
|
box-sizing: border-box;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
*::before,
|
|
14
|
-
*::after {
|
|
15
|
-
box-sizing: border-box;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
body {
|
|
19
|
-
// Remove default margin.
|
|
20
|
-
margin: 0;
|
|
21
|
-
// Optimize for the retina screen
|
|
22
|
-
-webkit-font-smoothing: antialiased;
|
|
23
|
-
-moz-osx-font-smoothing: grayscale;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Address `[hidden]` styling not present in IE 10.
|
|
27
|
-
// Hide the `template` element in IE 10/11, Safari, and Firefox < 22.
|
|
28
|
-
[hidden],
|
|
29
|
-
template {
|
|
30
|
-
display: none;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Links
|
|
34
|
-
// ==========================================================================
|
|
35
|
-
|
|
36
|
-
// Remove the gray background color from active links in IE 10.
|
|
37
|
-
a {
|
|
38
|
-
background-color: transparent;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Improve readability of focused elements when they are also in an
|
|
42
|
-
// active/hover state.
|
|
43
|
-
a:active,
|
|
44
|
-
a:hover {
|
|
45
|
-
outline: 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Text-level semantics
|
|
49
|
-
// ==========================================================================
|
|
50
|
-
|
|
51
|
-
// Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
|
|
52
|
-
b,
|
|
53
|
-
strong {
|
|
54
|
-
font-weight: bold;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Prevent `sub` and `sup` affecting `line-height` in all browsers.
|
|
58
|
-
sub,
|
|
59
|
-
sup {
|
|
60
|
-
font-size: 75%;
|
|
61
|
-
line-height: 0;
|
|
62
|
-
position: relative;
|
|
63
|
-
vertical-align: baseline;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
sup {
|
|
67
|
-
top: -0.5em;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
sub {
|
|
71
|
-
bottom: -0.25em;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Embedded content
|
|
75
|
-
// ==========================================================================
|
|
76
|
-
|
|
77
|
-
// Remove border when inside `a` element in IE 10.
|
|
78
|
-
img {
|
|
79
|
-
border: 0;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Correct overflow not hidden in IE 10/11.
|
|
83
|
-
svg:not(:root) {
|
|
84
|
-
overflow: hidden;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Address differences between Firefox and other browsers.
|
|
88
|
-
hr {
|
|
89
|
-
box-sizing: content-box;
|
|
90
|
-
height: 0;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// Contain overflow in all browsers.
|
|
94
|
-
pre {
|
|
95
|
-
overflow: auto;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Forms
|
|
99
|
-
// ==========================================================================
|
|
100
|
-
|
|
101
|
-
// Known limitation: by default, Chrome and Safari on OS X allow very limited
|
|
102
|
-
// styling of `select`, unless a `border` property is set.
|
|
103
|
-
|
|
104
|
-
// 1. Correct color not being inherited.
|
|
105
|
-
// Known issue: affects color of disabled elements.
|
|
106
|
-
// 2. Correct font properties not being inherited.
|
|
107
|
-
// 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
|
|
108
|
-
button,
|
|
109
|
-
input,
|
|
110
|
-
optgroup,
|
|
111
|
-
select,
|
|
112
|
-
textarea {
|
|
113
|
-
color: inherit; // 1
|
|
114
|
-
font: inherit; // 2
|
|
115
|
-
margin: 0; // 3
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// Address `overflow` set to `hidden` in IE 10/11.
|
|
119
|
-
button {
|
|
120
|
-
overflow: visible;
|
|
121
|
-
}
|
|
122
11
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Address inconsistent `text-transform` inheritance for `button` and `select`.
|
|
129
|
-
// All other form control elements do not inherit `text-transform` values.
|
|
130
|
-
// Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
|
|
131
|
-
// Correct `select` style inheritance in Firefox.
|
|
132
|
-
button,
|
|
133
|
-
select {
|
|
134
|
-
text-transform: none;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
|
138
|
-
// and `video` controls.
|
|
139
|
-
// 2. Correct inability to style clickable `input` types in iOS.
|
|
140
|
-
// 3. Improve usability and consistency of cursor style between image-type
|
|
141
|
-
// `input` and others.
|
|
142
|
-
button,
|
|
143
|
-
html input[type='button'],
|
|
144
|
-
input[type='reset'],
|
|
145
|
-
input[type='submit'] {
|
|
146
|
-
-webkit-appearance: button; // 2
|
|
147
|
-
cursor: pointer; // 3
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Re-set default cursor for disabled elements.
|
|
151
|
-
button[disabled],
|
|
152
|
-
html input[disabled] {
|
|
153
|
-
cursor: not-allowed;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// Remove inner padding and border in Firefox 4+.
|
|
157
|
-
button::-moz-focus-inner,
|
|
158
|
-
input::-moz-focus-inner {
|
|
159
|
-
border: 0;
|
|
160
|
-
padding: 0;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Address Firefox 4+ setting `line-height` on `input` using `!important` in
|
|
164
|
-
// the UA stylesheet.
|
|
165
|
-
input {
|
|
166
|
-
line-height: normal;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// It's recommended that you don't attempt to style these elements.
|
|
170
|
-
// Firefox's implementation doesn't respect box-sizing, padding, or width.
|
|
171
|
-
//
|
|
172
|
-
// 1. Address box sizing set to `content-box` in IE 10.
|
|
173
|
-
// 2. Remove excess padding in IE 10.
|
|
174
|
-
input[type='checkbox'],
|
|
175
|
-
input[type='radio'] {
|
|
176
|
-
box-sizing: border-box; // 1
|
|
177
|
-
padding: 0; // 2
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// Fix the cursor style for Chrome's increment/decrement buttons. For certain
|
|
181
|
-
// `font-size` values of the `input`, it causes the cursor style of the
|
|
182
|
-
// decrement button to change from `default` to `text`.
|
|
183
|
-
input[type='number']::-webkit-inner-spin-button,
|
|
184
|
-
input[type='number']::-webkit-outer-spin-button {
|
|
185
|
-
height: auto;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// Remove default vertical scrollbar in IE 10/11.
|
|
189
|
-
textarea {
|
|
190
|
-
overflow: auto;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// Tables
|
|
194
|
-
// ==========================================================================
|
|
195
|
-
|
|
196
|
-
// Remove most spacing between table cells.
|
|
197
|
-
table {
|
|
198
|
-
border-collapse: collapse;
|
|
199
|
-
border-spacing: 0;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
td,
|
|
203
|
-
th {
|
|
204
|
-
padding: 0;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Remove tabIndex component outline
|
|
208
|
-
[tabindex='-1'] {
|
|
209
|
-
outline: none;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// Remove Default button Style
|
|
213
|
-
input[type='button'],
|
|
214
|
-
input[type='submit'],
|
|
215
|
-
input[type='reset'],
|
|
216
|
-
button {
|
|
217
|
-
border-width: 0;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// Remove IE10's “clear field” X button on certain inputs
|
|
221
|
-
input::-ms-clear {
|
|
222
|
-
display: none;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Remove File button Style
|
|
226
|
-
input[type='file']::-webkit-file-upload-button,
|
|
227
|
-
input[type='file']::-ms-browse {
|
|
228
|
-
border-width: 0;
|
|
229
|
-
background: transparent;
|
|
230
|
-
color: currentColor;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
// Reset fonts for relevant elements
|
|
234
|
-
input,
|
|
235
|
-
button,
|
|
236
|
-
select,
|
|
237
|
-
textarea {
|
|
238
|
-
font-family: inherit;
|
|
239
|
-
font-size: inherit;
|
|
240
|
-
line-height: inherit;
|
|
12
|
+
&::before,
|
|
13
|
+
&::after {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
241
16
|
}
|
|
242
17
|
|
|
243
18
|
// import reset styles
|
|
244
19
|
& when (@enable-css-reset = true) {
|
|
20
|
+
body {
|
|
21
|
+
// Remove default margin.
|
|
22
|
+
margin: 0;
|
|
23
|
+
// Optimize for the retina screen
|
|
24
|
+
-webkit-font-smoothing: antialiased;
|
|
25
|
+
-moz-osx-font-smoothing: grayscale;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Address `[hidden]` styling not present in IE 10.
|
|
29
|
+
// Hide the `template` element in IE 10/11, Safari, and Firefox < 22.
|
|
30
|
+
[hidden],
|
|
31
|
+
template {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Links
|
|
36
|
+
// ==========================================================================
|
|
37
|
+
|
|
38
|
+
// Remove the gray background color from active links in IE 10.
|
|
39
|
+
a {
|
|
40
|
+
background-color: transparent;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Improve readability of focused elements when they are also in an
|
|
44
|
+
// active/hover state.
|
|
45
|
+
a:active,
|
|
46
|
+
a:hover {
|
|
47
|
+
outline: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Text-level semantics
|
|
51
|
+
// ==========================================================================
|
|
52
|
+
|
|
53
|
+
// Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
|
|
54
|
+
b,
|
|
55
|
+
strong {
|
|
56
|
+
font-weight: bold;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Prevent `sub` and `sup` affecting `line-height` in all browsers.
|
|
60
|
+
sub,
|
|
61
|
+
sup {
|
|
62
|
+
font-size: 75%;
|
|
63
|
+
line-height: 0;
|
|
64
|
+
position: relative;
|
|
65
|
+
vertical-align: baseline;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
sup {
|
|
69
|
+
top: -0.5em;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
sub {
|
|
73
|
+
bottom: -0.25em;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Embedded content
|
|
77
|
+
// ==========================================================================
|
|
78
|
+
|
|
79
|
+
// Remove border when inside `a` element in IE 10.
|
|
80
|
+
img {
|
|
81
|
+
border: 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Correct overflow not hidden in IE 10/11.
|
|
85
|
+
svg:not(:root) {
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Address differences between Firefox and other browsers.
|
|
90
|
+
hr {
|
|
91
|
+
box-sizing: content-box;
|
|
92
|
+
height: 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Contain overflow in all browsers.
|
|
96
|
+
pre {
|
|
97
|
+
overflow: auto;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Forms
|
|
101
|
+
// ==========================================================================
|
|
102
|
+
|
|
103
|
+
// Known limitation: by default, Chrome and Safari on OS X allow very limited
|
|
104
|
+
// styling of `select`, unless a `border` property is set.
|
|
105
|
+
|
|
106
|
+
// 1. Correct color not being inherited.
|
|
107
|
+
// Known issue: affects color of disabled elements.
|
|
108
|
+
// 2. Correct font properties not being inherited.
|
|
109
|
+
// 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
|
|
110
|
+
button,
|
|
111
|
+
input,
|
|
112
|
+
optgroup,
|
|
113
|
+
select,
|
|
114
|
+
textarea {
|
|
115
|
+
color: inherit; // 1
|
|
116
|
+
font: inherit; // 2
|
|
117
|
+
margin: 0; // 3
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Address `overflow` set to `hidden` in IE 10/11.
|
|
121
|
+
button {
|
|
122
|
+
overflow: visible;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Remove border radius in Chrome 62+
|
|
126
|
+
button {
|
|
127
|
+
border-radius: 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Address inconsistent `text-transform` inheritance for `button` and `select`.
|
|
131
|
+
// All other form control elements do not inherit `text-transform` values.
|
|
132
|
+
// Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
|
|
133
|
+
// Correct `select` style inheritance in Firefox.
|
|
134
|
+
button,
|
|
135
|
+
select {
|
|
136
|
+
text-transform: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
|
140
|
+
// and `video` controls.
|
|
141
|
+
// 2. Correct inability to style clickable `input` types in iOS.
|
|
142
|
+
// 3. Improve usability and consistency of cursor style between image-type
|
|
143
|
+
// `input` and others.
|
|
144
|
+
button,
|
|
145
|
+
html input[type='button'],
|
|
146
|
+
input[type='reset'],
|
|
147
|
+
input[type='submit'] {
|
|
148
|
+
-webkit-appearance: button; // 2
|
|
149
|
+
cursor: pointer; // 3
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Re-set default cursor for disabled elements.
|
|
153
|
+
button[disabled],
|
|
154
|
+
html input[disabled] {
|
|
155
|
+
cursor: not-allowed;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Remove inner padding and border in Firefox 4+.
|
|
159
|
+
button::-moz-focus-inner,
|
|
160
|
+
input::-moz-focus-inner {
|
|
161
|
+
border: 0;
|
|
162
|
+
padding: 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Address Firefox 4+ setting `line-height` on `input` using `!important` in
|
|
166
|
+
// the UA stylesheet.
|
|
167
|
+
input {
|
|
168
|
+
line-height: normal;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// It's recommended that you don't attempt to style these elements.
|
|
172
|
+
// Firefox's implementation doesn't respect box-sizing, padding, or width.
|
|
173
|
+
//
|
|
174
|
+
// 1. Address box sizing set to `content-box` in IE 10.
|
|
175
|
+
// 2. Remove excess padding in IE 10.
|
|
176
|
+
input[type='checkbox'],
|
|
177
|
+
input[type='radio'] {
|
|
178
|
+
box-sizing: border-box; // 1
|
|
179
|
+
padding: 0; // 2
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Fix the cursor style for Chrome's increment/decrement buttons. For certain
|
|
183
|
+
// `font-size` values of the `input`, it causes the cursor style of the
|
|
184
|
+
// decrement button to change from `default` to `text`.
|
|
185
|
+
input[type='number']::-webkit-inner-spin-button,
|
|
186
|
+
input[type='number']::-webkit-outer-spin-button {
|
|
187
|
+
height: auto;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Remove default vertical scrollbar in IE 10/11.
|
|
191
|
+
textarea {
|
|
192
|
+
overflow: auto;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Tables
|
|
196
|
+
// ==========================================================================
|
|
197
|
+
|
|
198
|
+
// Remove most spacing between table cells.
|
|
199
|
+
table {
|
|
200
|
+
border-collapse: collapse;
|
|
201
|
+
border-spacing: 0;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
td,
|
|
205
|
+
th {
|
|
206
|
+
padding: 0;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Remove tabIndex component outline
|
|
210
|
+
[tabindex='-1'] {
|
|
211
|
+
outline: none;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Remove Default button Style
|
|
215
|
+
input[type='button'],
|
|
216
|
+
input[type='submit'],
|
|
217
|
+
input[type='reset'],
|
|
218
|
+
button {
|
|
219
|
+
border-width: 0;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Remove IE10's “clear field” X button on certain inputs
|
|
223
|
+
input::-ms-clear {
|
|
224
|
+
display: none;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Remove File button Style
|
|
228
|
+
input[type='file']::-webkit-file-upload-button,
|
|
229
|
+
input[type='file']::-ms-browse {
|
|
230
|
+
border-width: 0;
|
|
231
|
+
background: transparent;
|
|
232
|
+
color: currentColor;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Reset fonts for relevant elements
|
|
236
|
+
input,
|
|
237
|
+
button,
|
|
238
|
+
select,
|
|
239
|
+
textarea {
|
|
240
|
+
font-family: inherit;
|
|
241
|
+
font-size: inherit;
|
|
242
|
+
line-height: inherit;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
245
|
@import 'scaffolding';
|
|
246
246
|
@import 'typography';
|
|
247
247
|
}
|
|
248
|
-
|