Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate font custom properties from v11 to v12 #10762

Merged
merged 11 commits into from
Sep 28, 2023
5 changes: 5 additions & 0 deletions .changeset/empty-baboons-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': major
---

Migrated `font` custom properties from v11 to v12
14 changes: 7 additions & 7 deletions documentation/guides/legacy-polaris-v8-public-api.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1046,8 +1046,8 @@ $fixed-element-stacking-order: (
);
$border-radius: if(
$size == 'wide',
var(--p-border-radius-200),
var(--p-border-radius-100)
var(--p-border-radius-2),
var(--p-border-radius-1)
Comment on lines -1049 to +1050
Copy link
Contributor Author

@laurkim laurkim Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are changes from the previous border migration.
I inadvertently updated this file in the border migration PR so I just reverted the changes in this PR.

);
$negative-offset: calc(-1 * #{$offset});

Expand Down Expand Up @@ -1330,7 +1330,7 @@ $nav-min-window: em(layout-width(page-with-nav));
padding: $vertical-padding spacing();
background: var(--p-surface);
box-shadow: var(--p-shadow-button);
border-radius: var(--p-border-radius-100);
border-radius: var(--p-border-radius-1);
color: var(--p-text);
border: 1px solid var(--p-border-neutral-subdued);
border-top-color: var(--p-border-subdued);
Expand Down Expand Up @@ -1562,7 +1562,7 @@ $nav-min-window: em(layout-width(page-with-nav));
position: relative;
border: var(--p-control-border-width) solid var(--p-border);
background-color: var(--p-surface);
border-radius: var(--p-border-radius-100);
border-radius: var(--p-border-radius-1);

&::before {
content: '';
Expand All @@ -1571,7 +1571,7 @@ $nav-min-window: em(layout-width(page-with-nav));
right: calc(-1 * var(--p-control-border-width));
bottom: calc(-1 * var(--p-control-border-width));
left: calc(-1 * var(--p-control-border-width));
border-radius: var(--p-border-radius-100);
border-radius: var(--p-border-radius-1);
background-color: var(--p-interactive);
opacity: 0;
transform: scale(0.25);
Expand Down Expand Up @@ -2133,8 +2133,8 @@ $thumbnail-sizes: (
height: 100%;
display: block;
width: border-width(thicker);
border-top-right-radius: var(--p-border-radius-100);
border-bottom-right-radius: var(--p-border-radius-100);
border-top-right-radius: var(--p-border-radius-1);
border-bottom-right-radius: var(--p-border-radius-1);
}

//
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/playground/DetailsPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.ShopName {
margin-left: var(--p-space-200);
font-weight: var(--p-font-weight-semibold);
font-size: var(--p-font-size-100);
font-size: var(--p-font-size-350);
color: var(--p-color-text-inverse);
}

Expand Down
4 changes: 2 additions & 2 deletions polaris-react/src/components/AppProvider/AppProvider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

html,
body {
font-size: var(--p-font-size-80-experimental);
line-height: var(--p-font-line-height-2);
font-size: var(--p-font-size-325);
line-height: var(--p-font-line-height-500);
font-weight: var(--p-font-weight-regular);
letter-spacing: initial;
color: var(--p-color-text);
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/src/components/Avatar/Avatar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
}

.Text {
font-size: var(--p-font-size-200);
font-size: var(--p-font-size-400);
font-weight: var(--p-font-weight-regular);

&.long {
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
}
}

Expand Down
37 changes: 21 additions & 16 deletions polaris-react/src/components/Button/Button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

.Button {
// stylelint-disable -- Button custom properties
--pc-button-micro-min-height: var(--p-font-line-height-3);
--pc-button-slim-min-height: var(--p-font-line-height-4);
--pc-button-micro-min-height: var(--p-font-line-height-600);
--pc-button-slim-min-height: var(--p-font-line-height-700);
--pc-button-large-min-height: 32px;
--pc-button-vertical-padding: calc(
(36px - var(--p-font-line-height-500) - var(--p-space-050)) / 2
Expand Down Expand Up @@ -67,9 +67,9 @@
}

.Content {
font-size: var(--p-font-size-80-experimental);
font-size: var(--p-font-size-325);
font-weight: var(--p-font-weight-medium);
line-height: var(--p-font-line-height-2);
line-height: var(--p-font-line-height-500);
letter-spacing: initial;
position: relative;
display: flex;
Expand All @@ -82,13 +82,18 @@
transition: transform 75ms cubic-bezier(0.19, 0.91, 0.38, 1);

@media #{$p-breakpoints-md-up} {
font-size: var(--p-font-size-75);
line-height: var(--p-font-line-height-1);
font-size: var(--p-font-size-300);
line-height: var(--p-font-line-height-400);
}

.Button:not(.plain) & {
width: 100%;
}

// stylelint-disable-next-line selector-max-class -- override primary button font weight
.Button.primary & {
font-weight: var(--p-font-weight-semibold);
}
}

.textAlignLeft {
Expand Down Expand Up @@ -606,9 +611,9 @@
> .Content {
// stylelint-disable-next-line -- remove focus-ring mixing
@include no-focus-ring;
font-size: var(--p-font-size-80-experimental);
font-size: var(--p-font-size-325);
font-weight: var(--p-font-weight-regular);
line-height: var(--p-font-line-height-1);
line-height: var(--p-font-line-height-400);
}

&:hover,
Expand Down Expand Up @@ -736,7 +741,7 @@
calc(var(--p-space-300) * -1);

> .Content {
font-size: var(--p-font-size-80-experimental);
font-size: var(--p-font-size-325);
}
}

Expand All @@ -755,8 +760,8 @@
&.iconOnly {
margin: 0;
padding: 0;
min-height: var(--p-font-line-height-2);
min-width: var(--p-font-line-height-2);
min-height: var(--p-font-line-height-500);
min-width: var(--p-font-line-height-500);

svg {
fill: var(--p-color-icon-subdued);
Expand Down Expand Up @@ -864,9 +869,9 @@
min-height: var(--pc-button-micro-min-height);

.Content {
font-size: var(--p-font-size-80-experimental);
font-size: var(--p-font-size-325);
font-weight: var(--p-font-weight-medium);
line-height: var(--p-font-line-height-2);
line-height: var(--p-font-line-height-500);
}

@media #{$p-breakpoints-md-up} {
Expand All @@ -875,7 +880,7 @@
min-height: var(--pc-button-micro-min-height);

.Content {
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
line-height: var(--p-font-line-height-400);
}
}
Expand Down Expand Up @@ -905,13 +910,13 @@
// stylelint-enable polaris/conventions/polaris/custom-property-allowed-list

.Content {
font-size: var(--p-font-size-80-experimental);
font-size: var(--p-font-size-325);
font-weight: var(--p-font-weight-medium);
line-height: var(--p-font-line-height-500);
letter-spacing: initial;

@media #{$p-breakpoints-md-up} {
line-height: var(--p-font-line-height-1);
line-height: var(--p-font-line-height-400);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

.CheckableButton {
color: var(--p-color-text);
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
font-weight: var(--p-font-weight-medium);
line-height: var(--p-font-line-height-400);
letter-spacing: initial;
Expand Down
8 changes: 4 additions & 4 deletions polaris-react/src/components/DatePicker/DatePicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
border: none;
border-radius: var(--p-border-radius-200);
outline: none;
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
text-align: center;
color: var(--p-color-text);
cursor: pointer;
Expand Down Expand Up @@ -147,7 +147,7 @@
.Weekday {
padding: var(--p-space-200);
background: transparent;
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
font-weight: var(--p-font-weight-regular);
color: var(--p-color-text-secondary);
text-align: center;
Expand All @@ -170,8 +170,8 @@
flex: 1 1 auto;
padding-bottom: var(--p-space-100);
text-align: center;
font-size: var(--p-font-size-80-experimental);
line-height: var(--p-font-line-height-2);
font-size: var(--p-font-size-325);
line-height: var(--p-font-line-height-500);
font-weight: var(--p-font-weight-medium);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
border: none;
margin: 0;
text-decoration: none;
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
font-weight: var(--p-font-weight-semibold);
line-height: 1;
cursor: pointer;
Expand Down
6 changes: 3 additions & 3 deletions polaris-react/src/components/Filters/Filters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
}

@media #{$p-breakpoints-md-up} {
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
line-height: var(--p-font-line-height-400);
height: 24px;
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
Expand Down Expand Up @@ -238,7 +238,7 @@
margin-left: var(--p-space-200);

span {
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
font-weight: var(--p-font-weight-medium);
}
}
Expand All @@ -249,7 +249,7 @@
padding-right: var(--p-space-400);

span {
font-size: var(--p-font-size-100);
font-size: var(--p-font-size-350);
font-weight: var(--p-font-weight-medium);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
border-radius: var(--p-border-radius-200);
padding: var(--p-space-100) var(--p-space-300) var(--p-space-100)
var(--p-space-200);
font-size: var(--p-font-size-100);
font-size: var(--p-font-size-350);
display: flex;
align-items: center;
justify-content: flex-start;
Expand Down Expand Up @@ -41,7 +41,7 @@
flex: 1;
color: var(--p-color-text);
margin-left: var(--p-space-050);
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
font-weight: var(--p-font-weight-medium);
line-height: var(--p-font-line-height-1);
line-height: var(--p-font-line-height-400);
}
8 changes: 4 additions & 4 deletions polaris-react/src/components/IndexTable/IndexTable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ $loading-panel-height: 53px;
.TableCell:last-child {
color: var(--p-color-text-secondary);
font-weight: var(--p-font-weight-medium);
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
background-color: var(--p-color-bg-subdued);
border-top: var(--p-border-width-025) solid var(--p-color-border);
border-bottom: var(--p-border-width-025) solid var(--p-color-border);
Expand Down Expand Up @@ -470,7 +470,7 @@ $loading-panel-height: 53px;
text-align: left;
font-weight: var(--p-font-weight-medium);
color: var(--p-color-text-secondary);
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
white-space: nowrap;
border: 0;

Expand Down Expand Up @@ -539,7 +539,7 @@ $loading-panel-height: 53px;
justify-content: center;
font-weight: var(--p-font-weight-medium);
color: var(--p-color-text-secondary);
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
line-height: var(--p-font-line-height-500);

&:hover,
Expand Down Expand Up @@ -992,7 +992,7 @@ $loading-panel-height: 53px;
background: var(--p-color-bg);
padding: var(--p-space-150) var(--p-space-200) var(--p-space-150)
var(--p-space-300);
line-height: var(--p-font-line-height-2);
line-height: var(--p-font-line-height-500);
}

$scroll-bar-size: var(--p-space-200);
Expand Down
6 changes: 3 additions & 3 deletions polaris-react/src/components/KeyboardKey/KeyboardKey.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $key-base-dimension: 28px;
background: var(--p-color-bg-secondary-experimental);
border-radius: var(--p-border-radius-100);
color: var(--p-color-text-subdued);
font-size: var(--p-font-size-100);
font-size: var(--p-font-size-350);
font-weight: var(--p-font-weight-medium);
font-family: var(--p-font-family-sans);
line-height: $key-base-dimension;
Expand All @@ -23,9 +23,9 @@ $key-base-dimension: 28px;

.small {
box-shadow: none;
line-height: var(--p-font-size-200);
line-height: var(--p-font-size-400);
padding: var(--p-space-050) var(--p-space-100);
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
height: var(--p-space-500);
min-width: var(--p-space-500);
}
2 changes: 1 addition & 1 deletion polaris-react/src/components/Layout/Layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $relative-size: $primary-basis / $secondary-basis;

@media print {
body & {
font-size: var(--p-font-size-75);
font-size: var(--p-font-size-300);
line-height: var(--p-font-line-height-400);
}

Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/LegacyCard/LegacyCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// Override custom heading font sizes
h2,
h3 {
font-size: var(--p-font-size-80-experimental);
font-size: var(--p-font-size-325);
}

+ .LegacyCard {
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/src/components/MediaCard/MediaCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@
}

.Description {
font-size: var(--p-font-size-75);
line-height: var(--p-font-line-height-1);
font-size: var(--p-font-size-300);
line-height: var(--p-font-line-height-400);
}
Loading