Skip to content

Commit 37f3e2e

Browse files
lgriffeealex-pageaaronccasanova
authored
Remove v10 legacy custom properties (#8374)
### WHY are these changes introduced? Fixes #8405 <!-- link to issue if one exists --> Closes #4826 ### WHAT is this pull request doing? Removes the legacy custom properties outlined in #8405 from v11. --------- Co-authored-by: Alex Page <19199063+alex-page@users.noreply.github.com> Co-authored-by: Aaron Casanova <32409546+aaronccasanova@users.noreply.github.com>
1 parent 4c04912 commit 37f3e2e

File tree

32 files changed

+953
-632
lines changed

32 files changed

+953
-632
lines changed

documentation/guides/migrating-from-v10-to-v11.md

Lines changed: 253 additions & 0 deletions
Large diffs are not rendered by default.

polaris-codemods/src/codemods/v9-scss-replace-color/transform.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import type {FileInfo, API, Options} from 'jscodeshift';
22
import type {Plugin} from 'postcss';
33
import postcss from 'postcss';
44
import valueParser from 'postcss-value-parser';
5-
import {colors as tokenColors, createVar} from '@shopify/polaris-tokens';
5+
import {colors as tokenColors} from './v10-legacy-colors';
6+
import {createVar} from '@shopify/polaris-tokens';
67

78
import type {NamespaceOptions} from '../../utilities/sass';
89
import {

polaris-tokens/src/token-groups/colors.ts renamed to polaris-codemods/src/codemods/v9-scss-replace-color/v10-legacy-colors.ts

Lines changed: 1 addition & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -1,172 +1,4 @@
1-
import type {MetadataProperties} from '../types';
2-
3-
export type ColorsBackgroundTokenAlias =
4-
| 'background'
5-
| 'background-hovered'
6-
| 'background-pressed'
7-
| 'background-selected';
8-
9-
export type ColorsActionTokenAlias =
10-
| 'action-critical'
11-
| 'action-critical-depressed'
12-
| 'action-critical-disabled'
13-
| 'action-critical-hovered'
14-
| 'action-critical-pressed'
15-
| 'action-primary'
16-
| 'action-primary-depressed'
17-
| 'action-primary-disabled'
18-
| 'action-primary-hovered'
19-
| 'action-primary-pressed'
20-
| 'action-secondary'
21-
| 'action-secondary-depressed'
22-
| 'action-secondary-disabled'
23-
| 'action-secondary-hovered'
24-
| 'action-secondary-hovered-dark'
25-
| 'action-secondary-pressed'
26-
| 'action-secondary-pressed-dark';
27-
28-
export type ColorsSurfaceTokenAlias =
29-
| 'surface'
30-
| 'surface-attention'
31-
| 'surface-critical'
32-
| 'surface-critical-subdued'
33-
| 'surface-critical-subdued-depressed'
34-
| 'surface-critical-subdued-hovered'
35-
| 'surface-critical-subdued-pressed'
36-
| 'surface-dark'
37-
| 'surface-depressed'
38-
| 'surface-disabled'
39-
| 'surface-highlight'
40-
| 'surface-highlight-subdued'
41-
| 'surface-highlight-subdued-hovered'
42-
| 'surface-highlight-subdued-pressed'
43-
| 'surface-hovered'
44-
| 'surface-hovered-dark'
45-
| 'surface-neutral'
46-
| 'surface-neutral-disabled'
47-
| 'surface-neutral-hovered'
48-
| 'surface-neutral-pressed'
49-
| 'surface-neutral-subdued'
50-
| 'surface-neutral-subdued-dark'
51-
| 'surface-pressed'
52-
| 'surface-pressed-dark'
53-
| 'surface-primary-selected'
54-
| 'surface-primary-selected-hovered'
55-
| 'surface-primary-selected-pressed'
56-
| 'surface-search-field'
57-
| 'surface-search-field-dark'
58-
| 'surface-selected'
59-
| 'surface-selected-hovered'
60-
| 'surface-selected-pressed'
61-
| 'surface-subdued'
62-
| 'surface-success'
63-
| 'surface-success-subdued'
64-
| 'surface-success-subdued-hovered'
65-
| 'surface-success-subdued-pressed'
66-
| 'surface-warning'
67-
| 'surface-warning-subdued'
68-
| 'surface-warning-subdued-hovered'
69-
| 'surface-warning-subdued-pressed';
70-
71-
export type ColorsBackdropTokenAlias = 'backdrop';
72-
73-
export type ColorsOverlayTokenAlias = 'overlay';
74-
75-
export type ColorsBorderTokenAlias =
76-
| 'border'
77-
| 'border-on-dark'
78-
| 'border-neutral-subdued'
79-
| 'border-hovered'
80-
| 'border-disabled'
81-
| 'border-subdued'
82-
| 'border-depressed'
83-
| 'border-shadow'
84-
| 'border-shadow-subdued'
85-
| 'border-critical'
86-
| 'border-critical-subdued'
87-
| 'border-critical-disabled'
88-
| 'border-warning'
89-
| 'border-warning-subdued'
90-
| 'border-highlight'
91-
| 'border-highlight-subdued'
92-
| 'border-success'
93-
| 'border-success-subdued';
94-
95-
export type ColorsTokenName =
96-
| ColorsBackgroundTokenAlias
97-
| ColorsActionTokenAlias
98-
| ColorsSurfaceTokenAlias
99-
| ColorsBackdropTokenAlias
100-
| ColorsOverlayTokenAlias
101-
| ColorsBorderTokenAlias
102-
| 'decorative-five-icon'
103-
| 'decorative-five-surface'
104-
| 'decorative-five-text'
105-
| 'decorative-four-icon'
106-
| 'decorative-four-surface'
107-
| 'decorative-four-text'
108-
| 'decorative-one-icon'
109-
| 'decorative-one-surface'
110-
| 'decorative-one-text'
111-
| 'decorative-three-icon'
112-
| 'decorative-three-surface'
113-
| 'decorative-three-text'
114-
| 'decorative-two-icon'
115-
| 'decorative-two-surface'
116-
| 'decorative-two-text'
117-
| 'divider-dark'
118-
| 'divider'
119-
| 'focused'
120-
| 'hint-from-direct-light'
121-
| 'icon-attention'
122-
| 'icon-critical'
123-
| 'icon-disabled'
124-
| 'icon-highlight'
125-
| 'icon-hovered'
126-
| 'icon-on-critical'
127-
| 'icon-on-dark'
128-
| 'icon-on-interactive'
129-
| 'icon-on-primary'
130-
| 'icon-pressed'
131-
| 'icon-subdued'
132-
| 'icon-success'
133-
| 'icon-warning'
134-
| 'icon'
135-
| 'interactive-critical-disabled'
136-
| 'interactive-critical-hovered'
137-
| 'interactive-critical-pressed'
138-
| 'interactive-critical'
139-
| 'interactive-disabled'
140-
| 'interactive-hovered'
141-
| 'interactive-on-dark'
142-
| 'interactive-pressed-on-dark'
143-
| 'interactive-pressed'
144-
| 'interactive'
145-
| 'shadow-color-picker-dragger'
146-
| 'shadow-color-picker'
147-
| 'text'
148-
| 'text-critical'
149-
| 'text-disabled'
150-
| 'text-highlight'
151-
| 'text-on-critical'
152-
| 'text-on-dark'
153-
| 'text-on-interactive'
154-
| 'text-on-primary'
155-
| 'text-primary-hovered'
156-
| 'text-primary-pressed'
157-
| 'text-primary'
158-
| 'text-subdued-on-dark'
159-
| 'text-subdued'
160-
| 'text-success'
161-
| 'text-warning';
162-
163-
export type ColorsTokenGroup = {
164-
[TokenName in ColorsTokenName]: string;
165-
};
166-
167-
export const colors: {
168-
[TokenName in ColorsTokenName]: MetadataProperties;
169-
} = {
1+
export const colors = {
1702
background: {
1713
value: 'rgba(246, 246, 247, 1)',
1724
description:

polaris-for-vscode/src/server.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@ import type {
1515
} from 'vscode-languageserver/node';
1616
import {TextDocument} from 'vscode-languageserver-textdocument';
1717

18-
const excludedTokenGroupNames = [
19-
'colors',
20-
'depth',
21-
'legacy',
22-
'spacing',
23-
'shape',
24-
] as const;
18+
const excludedTokenGroupNames = [] as const;
2519

2620
type ExcludedTokenGroupName = typeof excludedTokenGroupNames[number];
2721

0 commit comments

Comments
 (0)