Replace legacy $spacing-X vars with Compound Design Tokens (#34380)

* Replace legacy `$spacing-X` vars with Compound Design Tokens

* Remove unused font size vars

* Use calc to get negative spacing vars
This commit is contained in:
Michael Telatynski
2026-07-22 10:10:57 +00:00
committed by GitHub
parent ef8cfda6fe
commit 49a2bdd7e4
87 changed files with 343 additions and 380 deletions
@@ -11,7 +11,7 @@ Please see LICENSE files in the repository root for full details.
display: flex;
flex-direction: row;
align-items: flex-start;
padding: $spacing-12 0;
padding: var(--cpd-space-3x) 0;
border-bottom: 1px solid $system;
@@ -28,7 +28,7 @@ Please see LICENSE files in the repository root for full details.
flex: 0 0;
box-sizing: border-box;
margin-right: $spacing-8;
margin-right: var(--cpd-space-2x);
border: 2px solid $location-live-color;
border-radius: 50%;
}
@@ -44,7 +44,7 @@ Please see LICENSE files in the repository root for full details.
.mx_BeaconListItem_status {
/* override beacon status padding */
padding: 0 !important;
margin-bottom: $spacing-8;
margin-bottom: var(--cpd-space-2x);
.mx_BeaconStatus_label {
font-weight: var(--cpd-font-weight-semibold);
@@ -13,7 +13,7 @@ Please see LICENSE files in the repository root for full details.
justify-content: flex-start;
box-sizing: border-box;
padding: $spacing-8;
padding: var(--cpd-space-2x);
color: var(--color);
font-size: $font-12px;
@@ -34,7 +34,7 @@ Please see LICENSE files in the repository root for full details.
width: 32px;
flex: 0 0 32px;
margin-right: $spacing-8;
margin-right: var(--cpd-space-2x);
}
.mx_BeaconStatus_description {
@@ -43,7 +43,7 @@ Please see LICENSE files in the repository root for full details.
flex-direction: column;
line-height: $font-14px;
padding-right: $spacing-8;
padding-right: var(--cpd-space-2x);
white-space: nowrap;
overflow: hidden;
@@ -12,7 +12,7 @@ Please see LICENSE files in the repository root for full details.
max-width: 150px;
height: 38px;
box-sizing: content-box;
padding-top: $spacing-8;
padding-top: var(--cpd-space-2x);
}
.mx_BeaconStatusTooltip_inner {
@@ -53,11 +53,11 @@ Please see LICENSE files in the repository root for full details.
.mx_BeaconViewDialog_mapFallbackMessage {
color: $secondary-content;
margin-bottom: $spacing-16;
margin-bottom: var(--cpd-space-4x);
}
.mx_BeaconViewDialog_viewListButton {
position: absolute;
top: $spacing-24;
left: $spacing-24;
top: var(--cpd-space-6x);
left: var(--cpd-space-6x);
}
@@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details.
.mx_DialogOwnBeaconStatus {
position: absolute;
bottom: $spacing-32;
bottom: var(--cpd-space-8x);
width: 300px;
margin-left: -150px;
left: 50%;
@@ -23,14 +23,14 @@ Please see LICENSE files in the repository root for full details.
border-radius: 8px;
box-shadow: 4px 4px 12px 0 $menu-box-shadow-color;
padding: 0 $spacing-12;
padding: 0 var(--cpd-space-3x);
}
.mx_DialogOwnBeaconStatus_avatarIcon {
flex: 0 0;
height: 32px;
width: 32px;
margin: $spacing-8 0 $spacing-8 0;
margin: var(--cpd-space-2x) 0 var(--cpd-space-2x) 0;
}
.mx_DialogOwnBeaconStatus_avatar {
@@ -39,7 +39,7 @@ Please see LICENSE files in the repository root for full details.
border: 2px solid $location-live-color;
border-radius: 50%;
margin: $spacing-8 0 $spacing-8 0;
margin: var(--cpd-space-2x) 0 var(--cpd-space-2x) 0;
}
.mx_DialogOwnBeaconStatus_status {
@@ -17,7 +17,7 @@ Please see LICENSE files in the repository root for full details.
flex-direction: column;
box-sizing: border-box;
padding: $spacing-16;
padding: var(--cpd-space-4x);
background-color: $background;
box-shadow: 0px 4px 4px $menu-box-shadow-color;
@@ -28,7 +28,7 @@ Please see LICENSE files in the repository root for full details.
justify-content: space-between;
flex: 0 0;
margin-bottom: $spacing-16;
margin-bottom: var(--cpd-space-4x);
color: $primary-content;
@@ -10,7 +10,7 @@ Please see LICENSE files in the repository root for full details.
width: 100%;
box-sizing: border-box;
padding: $spacing-4;
padding: var(--cpd-space-1x);
text-align: center;
background-color: $accent;
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
*/
.mx_OwnBeaconStatus_button {
margin-left: $spacing-8;
margin-left: var(--cpd-space-2x);
}
.mx_EventTile[data-layout="bubble"] .mx_OwnBeaconStatus_button {
@@ -17,7 +17,7 @@ Please see LICENSE files in the repository root for full details.
/* override copyable text style to make compact */
.mx_CopyableText_copyButton {
height: 13px;
margin-left: $spacing-8 !important;
margin-left: var(--cpd-space-2x) !important;
position: relative;
top: -1px;
width: 13px;
@@ -14,6 +14,6 @@ Please see LICENSE files in the repository root for full details.
.mx_PollDetailHeader_icon {
height: 16px;
width: 16px;
margin-right: $spacing-8;
margin-right: var(--cpd-space-2x);
vertical-align: middle;
}
@@ -15,7 +15,7 @@ Please see LICENSE files in the repository root for full details.
display: grid;
justify-content: left;
align-items: center;
gap: $spacing-8;
gap: var(--cpd-space-2x);
grid-template-columns: auto auto auto;
grid-template-rows: auto;
cursor: pointer;
@@ -27,7 +27,7 @@ Please see LICENSE files in the repository root for full details.
height: 14px;
width: 14px;
color: $quaternary-content;
padding-left: $spacing-8;
padding-left: var(--cpd-space-2x);
}
.mx_PollListItem_question {
@@ -22,7 +22,7 @@ Please see LICENSE files in the repository root for full details.
display: grid;
justify-content: left;
align-items: center;
gap: $spacing-8;
gap: var(--cpd-space-2x);
grid-template-columns: min-content 1fr min-content;
grid-template-rows: auto;
}
@@ -31,7 +31,7 @@ Please see LICENSE files in the repository root for full details.
height: 14px;
width: 14px;
color: $quaternary-content;
padding-left: $spacing-8;
padding-left: var(--cpd-space-2x);
}
.mx_PollListItemEnded_date {
@@ -47,11 +47,11 @@ Please see LICENSE files in the repository root for full details.
.mx_PollListItemEnded_answers {
display: grid;
gap: $spacing-8;
margin-top: $spacing-12;
gap: var(--cpd-space-2x);
margin-top: var(--cpd-space-3x);
}
.mx_PollListItemEnded_voteCount {
/* 6px to match PollOption padding */
margin: $spacing-8 0 0 6px;
margin: var(--cpd-space-2x) 0 0 6px;
}
@@ -8,11 +8,11 @@ Please see LICENSE files in the repository root for full details.
.mx_FilterDropdown {
.mx_Dropdown_menu {
margin-top: $spacing-4;
margin-top: var(--cpd-space-1x);
left: unset;
right: -$spacing-12;
right: calc(-1 * var(--cpd-space-3x));
width: 232px;
padding: $spacing-12;
padding: var(--cpd-space-3x);
border: 1px solid $quinary-content;
border-radius: 8px;
@@ -48,7 +48,7 @@ Please see LICENSE files in the repository root for full details.
position: relative;
width: 100%;
box-sizing: border-box;
padding: $spacing-8 0 $spacing-8 $spacing-20;
padding: var(--cpd-space-2x) 0 var(--cpd-space-2x) var(--cpd-space-5x);
font-size: $font-12px;
line-height: $font-15px;
@@ -59,7 +59,7 @@ Please see LICENSE files in the repository root for full details.
height: 14px;
width: 14px;
position: absolute;
top: $spacing-8;
top: var(--cpd-space-2x);
left: 0;
}
@@ -70,5 +70,5 @@ Please see LICENSE files in the repository root for full details.
.mx_FilterDropdown_optionDescription {
color: $secondary-content;
margin-top: $spacing-4;
margin-top: var(--cpd-space-1x);
}
@@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details.
.mx_FilterTabGroup {
color: $primary-content;
label {
margin-right: $spacing-12;
margin-right: var(--cpd-space-3x);
cursor: pointer;
span {
display: inline-block;
@@ -7,5 +7,5 @@ Please see LICENSE files in the repository root for full details.
*/
.mx_LearnMore_button {
margin-left: $spacing-4;
margin-left: var(--cpd-space-1x);
}
@@ -13,13 +13,13 @@ Please see LICENSE files in the repository root for full details.
justify-content: flex-end;
align-items: center;
padding: $spacing-32 $spacing-16;
padding: var(--cpd-space-8x) var(--cpd-space-4x);
text-align: center;
box-sizing: border-box;
}
.mx_EnableLiveShare_heading {
padding-top: $spacing-24;
padding-top: var(--cpd-space-6x);
}
.mx_EnableLiveShare_icon {
@@ -28,13 +28,13 @@ Please see LICENSE files in the repository root for full details.
}
.mx_EnableLiveShare_description {
padding: 0 $spacing-24;
margin-bottom: $spacing-32;
padding: 0 var(--cpd-space-6x);
margin-bottom: var(--cpd-space-8x);
line-height: $font-20px;
}
.mx_EnableLiveShare_button {
margin-top: $spacing-32;
margin-top: var(--cpd-space-8x);
height: 48px;
width: 100%;
}
@@ -7,5 +7,5 @@ Please see LICENSE files in the repository root for full details.
*/
.mx_LiveDurationDropdown {
margin-bottom: $spacing-16;
margin-bottom: var(--cpd-space-4x);
}
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
*/
.mx_MapError {
padding: 100px $spacing-32 0;
padding: 100px var(--cpd-space-8x) 0;
text-align: center;
--mx-map-error-icon-color: $secondary-content;
@@ -22,7 +22,7 @@ Please see LICENSE files in the repository root for full details.
justify-content: center;
align-items: center;
padding: $spacing-24;
padding: var(--cpd-space-6x);
background-color: $panels;
font-size: $font-12px;
line-height: $font-16px;
@@ -36,7 +36,7 @@ Please see LICENSE files in the repository root for full details.
}
.mx_MapError_heading {
padding-top: $spacing-8;
padding-top: var(--cpd-space-2x);
/* override h3 heading size */
font-size: inherit !important;
font-weight: normal !important;
@@ -44,11 +44,11 @@ Please see LICENSE files in the repository root for full details.
}
.mx_MapError_message {
margin: $spacing-16 0 $spacing-32;
margin: var(--cpd-space-4x) 0 var(--cpd-space-8x);
}
.mx_MapError_heading {
padding-top: $spacing-24;
padding-top: var(--cpd-space-6x);
}
.mx_MapError_icon {
@@ -32,6 +32,6 @@ Please see LICENSE files in the repository root for full details.
.mx_MapFallback_icon {
width: 65px;
margin-bottom: $spacing-16;
margin-bottom: var(--cpd-space-4x);
color: $quaternary-content;
}
@@ -22,7 +22,7 @@ button.mx_ShareDialogButtons_button {
text-align: center;
color: $secondary-content;
position: absolute;
top: $spacing-16;
top: var(--cpd-space-4x);
&:hover,
&:focus {
@@ -30,11 +30,11 @@ button.mx_ShareDialogButtons_button {
}
&.left {
left: $spacing-16;
left: var(--cpd-space-4x);
}
&.right {
right: $spacing-16;
right: var(--cpd-space-4x);
}
}
@@ -13,22 +13,22 @@ Please see LICENSE files in the repository root for full details.
justify-content: flex-start;
align-items: center;
padding: 60px $spacing-12 $spacing-32;
padding: 60px var(--cpd-space-3x) var(--cpd-space-8x);
color: $primary-content;
.mx_ShareType_wrapper_options {
display: flex;
flex-direction: column;
row-gap: $spacing-12;
row-gap: var(--cpd-space-3x);
width: 100%;
margin-top: $spacing-12;
margin-top: var(--cpd-space-3x);
.mx_ShareType_option {
display: flex;
align-items: center;
justify-content: flex-start;
padding: $spacing-8 $spacing-20;
padding: var(--cpd-space-2x) var(--cpd-space-5x);
background: none;
border: 1px solid $quinary-content;
@@ -50,7 +50,7 @@ Please see LICENSE files in the repository root for full details.
.mx_ShareType_badge {
height: 60px;
width: 60px;
margin-bottom: $spacing-20;
margin-bottom: var(--cpd-space-5x);
background-color: $accent;
border-radius: 50%;
border: 14px solid $accent;
@@ -60,7 +60,7 @@ Please see LICENSE files in the repository root for full details.
}
.mx_ShareType_heading {
padding-bottom: $spacing-32;
padding-bottom: var(--cpd-space-8x);
text-align: center;
}
@@ -68,7 +68,7 @@ Please see LICENSE files in the repository root for full details.
height: 40px;
width: 40px;
box-sizing: border-box;
margin-right: $spacing-12;
margin-right: var(--cpd-space-3x);
flex: 0 0 40px;
border-width: 2px;
border-style: solid;
@@ -8,11 +8,11 @@ Please see LICENSE files in the repository root for full details.
.mx_ZoomButtons {
position: absolute;
bottom: $spacing-32;
right: $spacing-24;
bottom: var(--cpd-space-8x);
right: var(--cpd-space-6x);
display: flex;
flex-direction: column;
row-gap: $spacing-8;
row-gap: var(--cpd-space-2x);
.mx_ZoomButtons_button {
$ZoomButtons_button-size: 24px;
@@ -32,8 +32,8 @@ Please see LICENSE files in the repository root for full details.
.mx_MBeaconBody_withoutMapInfoLastUpdated {
/* 48px lines up with icon in BeaconStatus */
margin-top: -$spacing-8;
padding: 0 $spacing-8 $spacing-8 48px;
margin-top: calc(-1 * var(--cpd-space-2x));
padding: 0 var(--cpd-space-2x) var(--cpd-space-2x) 48px;
color: $tertiary-content;
font-size: $font-10px;
@@ -7,6 +7,6 @@ Please see LICENSE files in the repository root for full details.
*/
.mx_MediaProcessingError_Icon {
margin-right: $spacing-4;
margin-right: var(--cpd-space-1x);
vertical-align: text-top;
}
@@ -45,7 +45,7 @@ Please see LICENSE files in the repository root for full details.
height: 12px;
width: 12px;
color: var(--cpd-color-icon-accent-tertiary);
margin-right: $spacing-4;
margin-right: var(--cpd-space-1x);
vertical-align: middle;
}
@@ -105,7 +105,7 @@ Please see LICENSE files in the repository root for full details.
margin-right: 12px;
border-radius: 8px;
background-color: $system;
margin-top: $spacing-8;
margin-top: var(--cpd-space-2x);
.mx_PollOption_popularityAmount {
width: 0%;
@@ -19,7 +19,7 @@ Please see LICENSE files in the repository root for full details.
.mx_DeviceDetailHeading_renameForm {
display: grid;
gap: $spacing-16;
gap: var(--cpd-space-4x);
justify-content: left;
grid-template-columns: 100%;
}
@@ -27,7 +27,7 @@ Please see LICENSE files in the repository root for full details.
.mx_DeviceDetailHeading_renameFormButtons {
display: flex;
flex-direction: row;
gap: $spacing-8;
gap: var(--cpd-space-2x);
.mx_Spinner {
width: auto;
@@ -37,7 +37,7 @@ Please see LICENSE files in the repository root for full details.
.mx_DeviceDetailHeading_renameFormInput {
/* override field styles */
margin: 0 0 $spacing-4 0 !important;
margin: 0 0 var(--cpd-space-1x) 0 !important;
}
.mx_DeviceDetailHeading_renameFormHeading {
@@ -46,6 +46,6 @@ Please see LICENSE files in the repository root for full details.
.mx_DeviceDetailHeading_renameFormError {
color: $alert;
padding-right: $spacing-4;
padding-right: var(--cpd-space-1x);
display: block;
}
@@ -11,19 +11,19 @@ Please see LICENSE files in the repository root for full details.
flex-direction: column;
box-sizing: border-box;
margin-top: $spacing-16;
padding: $spacing-24;
margin-top: var(--cpd-space-4x);
padding: var(--cpd-space-6x);
border-radius: 8px;
border: 1px solid $quinary-content;
}
.mx_DeviceDetails_section {
padding-bottom: $spacing-20;
margin-bottom: $spacing-20;
padding-bottom: var(--cpd-space-5x);
margin-bottom: var(--cpd-space-5x);
border-bottom: 1px solid $quinary-content;
display: grid;
gap: $spacing-24;
gap: var(--cpd-space-6x);
justify-content: left;
grid-template-columns: 100%;
@@ -42,7 +42,7 @@ Please see LICENSE files in the repository root for full details.
font-size: $font-12px;
color: $secondary-content;
line-height: $font-14px;
margin-top: $spacing-4;
margin-top: var(--cpd-space-1x);
}
}
@@ -61,7 +61,7 @@ Please see LICENSE files in the repository root for full details.
}
td {
padding-top: $spacing-8;
padding-top: var(--cpd-space-2x);
}
.mxDeviceDetails_metadataLabel {
@@ -77,7 +77,7 @@ Please see LICENSE files in the repository root for full details.
display: flex;
flex-direction: row;
align-items: center;
gap: $spacing-4;
gap: var(--cpd-space-1x);
}
.mx_DeviceDetails_pushNotifications {
@@ -13,7 +13,7 @@ Please see LICENSE files in the repository root for full details.
align-items: flex-start;
box-sizing: border-box;
padding: $spacing-16;
padding: var(--cpd-space-4x);
border: 1px solid $quinary-content;
border-radius: 8px;
@@ -24,7 +24,7 @@ Please see LICENSE files in the repository root for full details.
display: flex;
align-items: center;
justify-content: center;
margin-right: $spacing-16;
margin-right: var(--cpd-space-4x);
border-radius: 8px;
height: 40px;
@@ -53,7 +53,7 @@ Please see LICENSE files in the repository root for full details.
flex: 1 1;
}
.mx_DeviceSecurityCard_heading {
margin: 0 0 $spacing-4 0;
margin: 0 0 var(--cpd-space-1x) 0;
}
.mx_DeviceSecurityCard_description {
margin: 0;
@@ -62,5 +62,5 @@ Please see LICENSE files in the repository root for full details.
}
.mx_DeviceSecurityCard_actions {
margin-top: $spacing-16;
margin-top: var(--cpd-space-4x);
}
@@ -22,20 +22,20 @@ Please see LICENSE files in the repository root for full details.
}
.mx_DeviceTile_metadata {
margin-top: $spacing-4;
margin-top: var(--cpd-space-1x);
font: var(--cpd-font-body-sm-regular);
color: $secondary-content;
}
.mx_DeviceTile_inactiveIcon {
height: 14px;
margin-right: $spacing-8;
margin-right: var(--cpd-space-2x);
vertical-align: middle;
}
.mx_DeviceTile_actions {
display: grid;
gap: $spacing-8;
gap: var(--cpd-space-2x);
grid-auto-flow: column;
margin-left: $spacing-8;
margin-left: var(--cpd-space-2x);
}
@@ -9,9 +9,9 @@ Please see LICENSE files in the repository root for full details.
.mx_DeviceTypeIcon {
flex: 0 0 auto;
position: relative;
margin-right: $spacing-8;
margin-right: var(--cpd-space-2x);
/* creates space for verification icon to overlap */
padding: 0 $spacing-8 $spacing-8 0;
padding: 0 var(--cpd-space-2x) var(--cpd-space-2x) 0;
}
.mx_DeviceTypeIcon_deviceIconWrapper {
@@ -22,7 +22,7 @@ Please see LICENSE files in the repository root for full details.
width: 40px;
box-sizing: border-box;
border: $spacing-8 solid var(--background-color);
border: var(--cpd-space-2x) solid var(--background-color);
border-radius: 50%;
color: var(--icon-color);
background-color: var(--background-color);
@@ -45,7 +45,7 @@ Please see LICENSE files in the repository root for full details.
height: 24px;
width: 24px;
box-sizing: border-box;
padding: $spacing-4;
padding: var(--cpd-space-1x);
border: 1px solid $quinary-content;
border-radius: 50%;
@@ -15,9 +15,9 @@ Please see LICENSE files in the repository root for full details.
.mx_FilteredDeviceList_list {
list-style-type: none;
display: grid;
gap: $spacing-16;
gap: var(--cpd-space-4x);
margin: 0;
padding: 0 $spacing-16;
padding: 0 var(--cpd-space-4x);
}
.mx_FilteredDeviceList_listItem {
@@ -26,13 +26,13 @@ Please see LICENSE files in the repository root for full details.
}
.mx_FilteredDeviceList_securityCard {
margin-bottom: $spacing-32;
margin-bottom: var(--cpd-space-8x);
}
.mx_FilteredDeviceList_noResults {
width: 100%;
text-align: center;
margin-bottom: $spacing-32;
margin-bottom: var(--cpd-space-8x);
}
.mx_FilteredDeviceList_headerButton {
@@ -40,7 +40,7 @@ Please see LICENSE files in the repository root for full details.
/* override inline button styling */
display: flex !important;
flex-direction: row;
gap: $spacing-8;
gap: var(--cpd-space-2x);
}
.mx_FilteredDeviceList_deviceDetails {
@@ -11,12 +11,12 @@ Please see LICENSE files in the repository root for full details.
flex-direction: row;
align-items: center;
box-sizing: border-box;
gap: $spacing-16;
gap: var(--cpd-space-4x);
width: 100%;
height: 48px;
padding: 0 $spacing-16;
margin-bottom: $spacing-32;
padding: 0 var(--cpd-space-4x);
margin-bottom: var(--cpd-space-8x);
background-color: $panels;
border-radius: 8px;
@@ -7,5 +7,5 @@ Please see LICENSE files in the repository root for full details.
*/
.mx_SecurityRecommendations_spacing {
height: $spacing-16;
height: var(--cpd-space-4x);
}
@@ -28,7 +28,7 @@ Please see LICENSE files in the repository root for full details.
}
.mx_SettingsSubsection_description {
margin-top: $spacing-8;
margin-top: var(--cpd-space-2x);
}
.mx_SettingsSubsection_text {
@@ -44,14 +44,14 @@ Please see LICENSE files in the repository root for full details.
/* setting minwidth 0 makes columns definitely sized fixing horizontal overflow */
grid-template-columns: minmax(0, 1fr);
justify-items: flex-start;
margin-top: $spacing-24;
margin-top: var(--cpd-space-6x);
summary {
color: $accent;
}
details[open] {
summary {
margin-bottom: $spacing-8;
margin-bottom: var(--cpd-space-2x);
}
}
@@ -10,7 +10,7 @@ Please see LICENSE files in the repository root for full details.
display: flex;
flex-direction: row;
gap: $spacing-8;
gap: var(--cpd-space-2x);
}
.mx_SettingsSubsectionHeading_heading {