-
Notifications
You must be signed in to change notification settings - Fork 41
/
tailwind.config.js
159 lines (153 loc) · 4.12 KB
/
tailwind.config.js
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
const extendConfig = require('@ably/ui/tailwind.extend.js');
const apiReferenceSpecificColors = {
'api-reference-attribute-highlight': '#ffe6dc',
'api-reference-attribute-border': '#ff9e7a',
};
const highlightColors = {
'notification-background': '#0073e6',
'active-language-button': '#ff5416',
'disabled-tab-button': '#979798',
};
const legacyBrandColors = {
'brand-black': '#161616',
'brand-richOrange': '#ed760a',
};
// Remove this when ably-ui 14 lands, along with the Status component
const statusColors = {
'status-operational': '#00e80b',
'status-minor': '#f8c100',
'status-major': '#ff723f',
'status-critical': '#e40000',
'status-unknown': '#c6ced9',
};
const safelistStandard = ['mb-40', 'mb-32', 'mb-24', 'pt-128', 'pt-96', 'px-16', 'h-full', 'mx-8', 'transform'];
const safelistGreedy = [/^docs-.*/, /^col-span-.*/, /^rotate-/];
module.exports = extendConfig((ablyUIConfig) => ({
...ablyUIConfig,
purge: {
content: ['./src/**/*.{js,jsx,ts,tsx}', './node_modules/@ably/ui/**/*', ...ablyUIConfig.purge.content],
safelist: {
...ablyUIConfig.purge.safelist,
standard: [
...Object.keys(apiReferenceSpecificColors).map((c) => `bg-${c}`),
...Object.keys(highlightColors).map((c) => `bg-${c}`),
...safelistStandard,
],
greedy: [...ablyUIConfig.purge.options.safelist.greedy, ...safelistGreedy],
},
},
theme: {
...ablyUIConfig.theme,
boxShadow: {
...ablyUIConfig.theme.boxShadow,
'container-avoid-left': '40px 40px 40px 0px rgba(0,0,0,0.1)',
'container-hover': '0px 24px 32px rgba(0, 0, 0, 0.05)',
'container-levitate': '0px 4px 10px rgba(0, 0, 0, 0.06)',
},
spacing: {
...ablyUIConfig.theme.spacing,
2: '0.125rem',
8: '0.5rem',
12: '0.75rem',
13: '0.8125rem',
22: '1.375rem',
30: '1.875rem',
38: '2.375rem',
40: '2.5rem',
78: '4.875rem',
112: '7rem',
128: '8rem',
140: '8.75rem',
200: '12.5rem',
240: '15rem',
244: '15.25rem',
300: '18.75rem',
320: '20rem',
420: '26.25rem',
'adapt-homepage-link-medium': 'calc(9% - 2.5rem)',
'adapt-homepage-link-large': 'calc(0.75rem + 4%)',
full: '100%',
},
screens: {
...ablyUIConfig.theme.screens,
'2xl': '1920px',
},
extend: {
...ablyUIConfig.theme.extend,
lineHeight: {
...ablyUIConfig.theme.lineHeight,
normal: 'var(--lh-normal)',
},
width: {
...ablyUIConfig.theme.extend.width,
24: '1.5rem',
100: '6.25rem',
140: '8.75rem',
160: '10rem',
244: '15.25rem',
},
minWidth: {
...ablyUIConfig.theme.extend.minWidth,
24: '1.5rem',
100: '6.25rem',
140: '8.75rem',
170: '10.625rem',
610: '38.125rem',
},
maxWidth: {
...ablyUIConfig.theme.extend.maxWidth,
24: '1.5rem',
100: '6.25rem',
140: '8.75rem',
400: '25rem',
512: '32rem',
820: '51.25rem',
1264: '79rem',
1312: '82rem',
},
colors: {
...apiReferenceSpecificColors,
...highlightColors,
...legacyBrandColors,
...statusColors,
},
gridRowStart: {
9: '9',
10: '10',
11: '11',
12: '12',
13: '13',
14: '14',
15: '15',
16: '16',
17: '17',
},
gridTemplateColumns: {
layout: 'minmax(200px, 924px) 200px',
'large-layout': 'minmax(200px, 924px) 200px',
'two-col-layout': 'minmax(200px, 1104px)',
'header-layout': '173px minmax(200px, 400px) 1fr',
'footer-layout': '244px auto',
},
rotate: {
...ablyUIConfig.theme.extend.rotate,
270: '270deg',
},
zIndex: {
...ablyUIConfig.theme.extend.zIndex,
1: '1',
},
fontSize: {
...ablyUIConfig.theme.extend.fontSize,
16: ['16px', '18px'],
},
},
},
variants: {
...ablyUIConfig.variants,
extend: {
...ablyUIConfig.variants.extend,
margin: ['first', 'last'],
},
},
}));