2 const deprecatedClasses
= [
4 pattern
: /\b(on-(tiny-mobile|mobile|tablet|desktop)-)?[m][btlrxy]?\d+(-\d+)?\b/,
6 `"${match}" is deprecated. Please migrate to the new margin utilities https://design-system.protontech.ch/?path=/docs/css-utilities-margin--margin`,
9 pattern
: /\b(on-(tiny-mobile|mobile|tablet|desktop)-)?[p][btlrxy]?\d+(-\d+)?\b/,
10 getMessage
: (match
) =>
11 `"${match}" is deprecated. Please migrate to the new padding utilities https://design-system.protontech.ch/?path=/docs/css-utilities-padding--padding`,
14 pattern
: /\b.*flex-gap.*\b/,
15 getMessage
: (match
) =>
16 `"${match}" is deprecated. Please migrate to the new gap utilities https://design-system.protontech.ch/?path=/docs/css-utilities-gap--gap`,
25 'The old spacing system classes are deprecated, please use the new mobile-first spacing system.',
26 url
: 'https://design-system.protontech.ch/?path=/docs/css-utilities-margin--margin',
29 create
: (context
) => {
32 const { value
} = node
;
33 if (!value
|| !value
.split
) {
37 const classes
= new Set(value
.split(' '));
38 classes
.forEach((className
) => {
39 deprecatedClasses
.forEach(({ pattern
, getMessage
}) => {
40 const match
= pattern
.exec(className
);
43 const message
= getMessage(match
[0]);