-
Notifications
You must be signed in to change notification settings - Fork 100
/
reset.treat.ts
117 lines (103 loc) · 1.8 KB
/
reset.treat.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import { style } from 'sku/treat';
import { hideFocusRingsDataAttribute } from '../components/private/hideFocusRings/hideFocusRingsDataAttribute';
export const base = style({
margin: 0,
padding: 0,
border: 0,
boxSizing: 'border-box',
fontSize: '100%',
font: 'inherit',
verticalAlign: 'baseline',
WebkitTapHighlightColor: 'transparent',
selectors: {
[`[${hideFocusRingsDataAttribute}] &`]: {
outline: 'none',
},
},
});
// HTML5 display-role reset for older browsers
const block = style({
display: 'block',
});
const body = style({
lineHeight: 1,
});
const list = style({
listStyle: 'none',
});
const quote = style({
quotes: 'none',
selectors: {
'&:before, &:after': {
content: "''",
},
},
});
const table = style({
borderCollapse: 'collapse',
borderSpacing: 0,
});
const appearance = style({
appearance: 'none',
});
const field = [block, appearance];
// Custom reset rules
const mark = style({
backgroundColor: 'transparent',
color: 'inherit',
});
const select = [
...field,
style({
selectors: {
'&::-ms-expand': {
display: 'none',
},
},
}),
];
const input = [
...field,
style({
selectors: {
'&::-ms-clear': {
display: 'none',
},
'&::-webkit-search-cancel-button': {
WebkitAppearance: 'none',
},
},
}),
];
const button = style({
background: 'none',
});
const a = style({
textDecoration: 'none',
color: 'inherit',
});
export const element = {
article: block,
aside: block,
details: block,
figcaption: block,
figure: block,
footer: block,
header: block,
hgroup: block,
menu: block,
nav: block,
section: block,
ul: list,
ol: list,
blockquote: quote,
q: quote,
body,
a,
table,
mark,
select,
button,
textarea: field,
input,
};