Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions UNRELEASED-v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Use [the changelog guidelines](/documentation/Versioning%20and%20changelog.md) t
- Removed the border-radius() function and replaced any instances with tokens ([#4793](https://github.com/Shopify/polaris-react/pull/4793))
- Removed the shadow() function (replaced any instances with tokens) and renamed shadow legacy tokens ([#4823](https://github.com/Shopify/polaris-react/pull/4823))
- Removed the ms-high-contrast-color() function and replaced any instances with values ([#4938](https://github.com/Shopify/polaris-react/pull/4938))
- Removed the font-family() function and replaced any instances with tokens ([#4940](https://github.com/Shopify/polaris-react/pull/4940))

### New components

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppProvider/AppProvider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body {
html,
body,
button {
font-family: font-family();
font-family: var(--p-font-family-sans);
}

html {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ const mockTokens: Tokens = {
motion: mockTokenGroup,
// Note: We don't need to assign mock values to the remaining static tokens.
depth: {},
fontSize: {},
legacyTokens: {},
lineHeight: {},
shape: {},
spacing: {},
typography: {},
Expand Down
2 changes: 1 addition & 1 deletion src/components/KeyboardKey/KeyboardKey.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $key-base-height: 24px;
0 var(--p-space-05) 0 0 var(--p-surface),
0 var(--p-space-05) 0 1px var(--p-border-subdued);
border-radius: var(--p-border-radius-1);
font-family: font-family();
font-family: var(--p-font-family-sans);
font-size: 12px;
font-weight: var(--p-font-weight-medium);
line-height: $key-base-height;
Expand Down
4 changes: 2 additions & 2 deletions src/components/TextField/TextField.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ $prefix-horizontal-spacing: var(--p-space-2);
padding: control-vertical-padding() $backdrop-horizontal-spacing;
background: none;
border: border(transparent);
font-family: font-family();
font-family: var(--p-font-family-sans);
appearance: none;
caret-color: var(--p-text);
color: var(--p-text);
Expand Down Expand Up @@ -302,5 +302,5 @@ $prefix-horizontal-spacing: var(--p-space-2);
}

.monospaced {
font-family: font-family($family: 'monospace');
font-family: var(--p-font-family-mono);
}
1 change: 0 additions & 1 deletion src/styles/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
@import './foundation/utilities';
@import './foundation/borders';
@import './foundation/layout';
@import './foundation/typography';
@import './foundation/focus-ring';
@import './foundation/accessibility';

Expand Down
1 change: 0 additions & 1 deletion src/styles/_public-api.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
@import './foundation/utilities';
@import './foundation/borders';
@import './foundation/layout';
@import './foundation/typography';
@import './foundation/focus-ring';

@import './shared/accessibility';
Expand Down
33 changes: 0 additions & 33 deletions src/styles/foundation/_typography.scss

This file was deleted.

15 changes: 0 additions & 15 deletions src/tokens/token-groups/font-size.json

This file was deleted.

9 changes: 0 additions & 9 deletions src/tokens/token-groups/line-height.json

This file was deleted.

27 changes: 26 additions & 1 deletion src/tokens/token-groups/typography.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
{
"font-family-sans": "-apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif",
"font-family-mono": "ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace",

"font-size-1": "12px",
"font-size-2": "13px",
"font-size-3": "14px",
"font-size-4": "15px",
"font-size-5": "16px",
"font-size-6": "17px",
"font-size-7": "20px",
"font-size-8": "21px",
"font-size-9": "24px",
"font-size-10": "26px",
"font-size-11": "27px",
"font-size-12": "28px",
"font-size-13": "42px",

"font-weight-regular": "400",
"font-weight-medium": "500",
"font-weight-semibold": "600",
"font-weight-bold": "700"
"font-weight-bold": "700",

"line-height-1": "16px",
"line-height-2": "20px",
"line-height-3": "24px",
"line-height-4": "28px",
"line-height-5": "32px",
"line-height-6": "36px",
"line-height-7": "44px"
}
8 changes: 1 addition & 7 deletions src/tokens/tokens.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import depth from './token-groups/depth.json';
import legacyTokens from './token-groups/legacy-tokens.json';
import darkColorScheme from './token-groups/color.dark.json';
import fontSize from './token-groups/font-size.json';
import lightColorScheme from './token-groups/color.light.json';
import lineHeight from './token-groups/line-height.json';
import motion from './token-groups/motion.json';
import shape from './token-groups/shape.json';
import spacing from './token-groups/spacing.json';
Expand Down Expand Up @@ -51,9 +49,7 @@ const colorSchemes: ColorSchemes = {
export interface Tokens {
depth: TokenGroup;
colorSchemes: ColorSchemes;
fontSize: TokenGroup;
legacyTokens: TokenGroup;
lineHeight: TokenGroup;
motion: TokenGroup;
shape: TokenGroup;
spacing: TokenGroup;
Expand All @@ -64,12 +60,10 @@ export interface Tokens {
export const tokens: Tokens = {
colorSchemes,
depth,
fontSize: tokensToRems(fontSize),
legacyTokens: tokensToRems(legacyTokens),
lineHeight: tokensToRems(lineHeight),
motion,
shape: tokensToRems(shape),
spacing: tokensToRems(spacing),
typography,
typography: tokensToRems(typography),
zIndex,
};