3 // suggestedClassName is optional
4 const deprecatedClassNames = [
6 deprecatedClassName: 'mauto',
7 suggestedClassName: 'm-auto',
10 deprecatedClassName: 'center',
11 suggestedClassName: 'mx-auto',
14 deprecatedClassName: 'mxauto',
15 suggestedClassName: 'mx-auto',
18 deprecatedClassName: 'myauto',
19 suggestedClassName: 'my-auto',
22 deprecatedClassName: 'mtauto',
23 suggestedClassName: 'mt-auto',
26 deprecatedClassName: 'mrauto',
27 suggestedClassName: 'mr-auto',
30 deprecatedClassName: 'mbauto',
31 suggestedClassName: 'mb-auto',
34 deprecatedClassName: 'mlauto',
35 suggestedClassName: 'ml-auto',
38 deprecatedClassName: 'wauto',
39 suggestedClassName: 'w-auto',
42 deprecatedClassName: 'hauto',
43 suggestedClassName: 'h-auto',
46 deprecatedClassName: 'h0',
47 suggestedClassName: 'h-0',
50 deprecatedClassName: 'h100',
51 suggestedClassName: 'h-full',
54 deprecatedClassName: 'opacity-on-hover',
55 suggestedClassName: 'group-hover:opacity-100',
58 deprecatedClassName: 'opacity-on-hover-container',
59 suggestedClassName: 'group-hover-opacity-container',
62 deprecatedClassName: 'text-underline-on-hover',
63 suggestedClassName: 'hover:text-underline',
66 deprecatedClassName: 'opacity-on-focus',
67 suggestedClassName: 'opacity-0 focus:opacity-100',
70 deprecatedClassName: 'hide-on-hover',
71 suggestedClassName: 'group-hover:hidden',
74 deprecatedClassName: 'hide-on-hover-container',
75 suggestedClassName: 'group-hover-hide-container',
78 deprecatedClassName: 'on-hover-opacity-100',
79 suggestedClassName: '',
82 deprecatedClassName: 'flex-justify-start',
83 suggestedClassName: 'justify-start',
86 deprecatedClassName: 'flex-justify-center',
87 suggestedClassName: 'justify-center',
90 deprecatedClassName: 'flex-justify-end',
91 suggestedClassName: 'justify-end',
94 deprecatedClassName: 'flex-justify-space-between',
95 suggestedClassName: 'justify-space-between',
98 deprecatedClassName: 'flex-justify-space-around',
99 suggestedClassName: 'justify-space-around',
102 deprecatedClassName: 'flex-justify-space-evenly',
103 suggestedClassName: 'justify-space-evenly',
106 deprecatedClassName: 'flex-align-items-start',
107 suggestedClassName: 'items-start',
110 deprecatedClassName: 'flex-align-items-center',
111 suggestedClassName: 'items-center',
114 deprecatedClassName: 'flex-align-items-end',
115 suggestedClassName: 'items-end',
118 deprecatedClassName: 'flex-align-items-baseline',
119 suggestedClassName: 'items-baseline',
122 deprecatedClassName: 'flex-align-items-stretch',
123 suggestedClassName: 'items-stretch',
126 deprecatedClassName: 'flex-align-items-inherit',
127 suggestedClassName: 'items-inherit',
130 deprecatedClassName: 'flex-align-self-start',
131 suggestedClassName: 'self-start',
134 deprecatedClassName: 'flex-align-self-center',
135 suggestedClassName: 'self-center',
138 deprecatedClassName: 'flex-align-self-end',
139 suggestedClassName: 'self-end',
142 deprecatedClassName: 'flex-align-self-baseline',
143 suggestedClassName: 'self-baseline',
146 deprecatedClassName: 'flex-align-self-stretch',
147 suggestedClassName: 'self-stretch',
150 deprecatedClassName: 'flex-align-self-inherit',
151 suggestedClassName: 'self-inherit',
154 deprecatedClassName: 'flex-item-fluid-auto',
155 suggestedClassName: 'flex-auto',
158 deprecatedClassName: 'flex-item-fluid',
159 suggestedClassName: 'flex-1',
162 deprecatedClassName: 'flex-item-noflex',
163 suggestedClassName: 'flex-none',
166 deprecatedClassName: 'flex-item-grow',
167 suggestedClassName: 'grow',
170 deprecatedClassName: 'flex-item-grow-2',
171 suggestedClassName: 'grow-2',
174 deprecatedClassName: 'flex-item-nogrow',
175 suggestedClassName: 'grow-0',
178 deprecatedClassName: 'flex-item-grow-custom',
179 suggestedClassName: 'grow-custom',
182 deprecatedClassName: 'flex-item-shrink',
183 suggestedClassName: 'shrink',
186 deprecatedClassName: 'flex-item-noshrink',
187 suggestedClassName: 'shrink-0',
190 deprecatedClassName: 'flex-flex-children',
191 suggestedClassName: 'flex and *:flex',
194 deprecatedClassName: 'flex-items-center',
195 suggestedClassName: '*:items-center',
198 deprecatedClassName: 'inline-flex-vcenter',
199 suggestedClassName: 'inline-flex and *:self-center',
202 deprecatedClassName: 'flex-item-centered-vert',
203 suggestedClassName: 'self-center and my-auto',
206 deprecatedClassName: 'flex-no-min-children',
207 suggestedClassName: 'flex and *:min-size-auto',
210 deprecatedClassName: 'hidden-empty',
211 suggestedClassName: 'empty:hidden',
214 deprecatedClassName: 'scroll-if-needed',
215 suggestedClassName: 'overflow-auto',
218 deprecatedClassName: 'scroll-horizontal-if-needed',
219 suggestedClassName: 'overflow-x-auto',
222 deprecatedClassName: 'no-scroll',
223 suggestedClassName: 'overflow-hidden',
226 deprecatedClassName: 'ratio-container-square',
227 suggestedClassName: 'ratio-square',
230 deprecatedClassName: 'ratio-container-16-9',
231 suggestedClassName: 'ratio-16/9',
234 deprecatedClassName: 'ratio-container-5-1',
235 suggestedClassName: 'ratio-5/1',
238 deprecatedClassName: 'no-pointer-events',
239 suggestedClassName: 'pointer-events-none',
242 deprecatedClassName: 'increase-click-surface',
243 suggestedClassName: 'expand-click-area',
252 url: 'https://design-system.protontech.ch',
255 create: (context) => {
258 const { value } = node;
259 if (!value || !value.split) {
263 const classes = new Set(value.split(' '));
265 deprecatedClassNames.forEach(({ deprecatedClassName, suggestedClassName }) => {
266 if (!classes.has(deprecatedClassName)) {
270 const messageDeprecated = `"${deprecatedClassName}" has been deprecated.`;
271 const messageSuggested = suggestedClassName && `Please use "${suggestedClassName}" instead.`;
272 const message = `${messageDeprecated} ${messageSuggested}`;