Skip to content
Draft
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Introducing theme variables! CSS variables beginning with `--theme-` will adjust

## Architecture changes

### CSS Logical Properties

* Continued migrating physical directional properties to their logical equivalents (see #1084) -- `templates/_card-layout.scss`, `templates/_main-with-sidebar.scss`, `_footer.scss`, `_navigation.scss`, `_menu.scss`, `_menu-item.scss`, `_menu-list.scss`, and `_sidebar-menu.scss`. 59 `bidi()` calls removed.
* Where a property has no logical equivalent safe across the supported matrix (`background-position`, and a CSS `transform` that visually flips a directional glyph), kept the physical value with an explicit `[dir='rtl']` override instead.

### Browser Support

* (breaking) Updated the supported browser matrix to Firefox ESR, Safari 15.6+, and evergreen browsers (`browserslist` in `package.json`).
Expand Down
25 changes: 12 additions & 13 deletions assets/sass/protocol/components/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@

&:nth-child(odd) {
clear: inline-start;
@include bidi(((padding, 0 ($layout-md * 0.5) 0 0, 0 0 0 ($layout-md * 0.5)),));
padding-inline-end: $layout-md * 0.5;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is going to drive me a little crazy that there is no logical property short hand for all 4 values.

Many changes in this PR no longer zero out padding that used to be explicitly removed by the previous declaration.

}

&:nth-child(even) {
@include bidi(((padding, 0 0 0 ($layout-md * 0.5), 0 ($layout-md * 0.5) 0 0),));
padding-inline-start: $layout-md * 0.5;
}
}
}
Expand All @@ -120,11 +120,11 @@
float: inline-start;

&:first-child {
@include bidi(((padding, 0 ($layout-md * 0.5) 0 0, 0 0 0 ($layout-md * 0.5)),));
padding-inline-start: 0;
}

&:last-child {
@include bidi(((padding, 0 0 0 ($layout-md * 0.5), 0 ($layout-md * 0.5) 0 0),));
padding-inline-end: 0;
}
}

Expand Down Expand Up @@ -181,11 +181,11 @@
transition: transform 100ms ease-in-out;
content: '';
height: 24px;
inset-inline-end: 8px;
margin-top: -12px;
position: absolute;
top: 50%;
width: 24px;
@include bidi(((right, 8px, left, auto),));
}

button[aria-expanded='true']::before {
Expand Down Expand Up @@ -267,8 +267,8 @@

li {
display: inline-block;
margin-inline-end: $spacing-md;
vertical-align: bottom;
@include bidi(((margin, 0 $spacing-md 0 0, 0 0 0 $spacing-md),));

a {
@include image-replaced;
Expand Down Expand Up @@ -299,17 +299,16 @@

@media #{$mq-md} {
bottom: 0;
inset-inline-end: 0;
margin-bottom: 0;
max-width: 33%; // don't over lap with legal links
position: absolute;
@include bidi(((right, 0, left, auto),));
text-align: end;

li {
@include bidi((
(padding, 0 0 $spacing-md $spacing-lg, 0 $spacing-lg $spacing-md 0),
(margin, 0 , 0),
));
margin: 0;
padding-block-end: $spacing-md;
padding-inline-start: $spacing-lg;
}
}
}
Expand All @@ -330,10 +329,10 @@
@media #{$mq-md} {
li {
display: inline-block;
@include bidi(((padding, 0 $spacing-lg 0 0, 0 0 0 $spacing-lg),));
padding-inline-end: $spacing-lg;

&:last-child {
@include bidi(((padding-right, 0, padding-left, 0),));
padding-inline: 0;
}
}
}
Expand Down
17 changes: 8 additions & 9 deletions assets/sass/protocol/components/_menu-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ $icon-size: 24px;
&.mzp-has-icon {
.mzp-c-menu-item-head,
.mzp-c-menu-item-link {
padding-inline-start: $icon-size + $spacing-lg;
position: relative;
@include bidi(((padding-left, $icon-size + $spacing-lg, padding-right, 0),));

.mzp-c-menu-item-icon {
height: $icon-size;
inset-inline-start: $spacing-sm;
margin: 0;
position: absolute;
top: $spacing-sm;
width: $icon-size;
@include bidi(((left, $spacing-sm, right, auto),));
}
}
}
Expand Down Expand Up @@ -95,21 +95,19 @@ $icon-size: 24px;
float: inline-start;

&:nth-child(odd) {
@include bidi((
(clear, left, right),
(padding-right, $spacing-sm, padding-left, 0),
));
clear: inline-start;
padding-inline-end: $spacing-sm;
}

&:nth-child(even) {
@include bidi(((padding-left, $spacing-sm, padding-right, 0),));
padding-inline-start: $spacing-sm;
}
}
}
}

&.mzp-has-icon .mzp-c-menu-item-list {
@include bidi(((margin-left, $icon-size + $spacing-lg, margin-right, 0),));
margin-inline-start: $icon-size + $spacing-lg;
}

@media #{$mq-md} {
Expand All @@ -124,7 +122,8 @@ $icon-size: 24px;
}

.mzp-c-menu-item-list {
@include bidi(((margin, $spacing-md 0 0 $spacing-sm, $spacing-md $spacing-sm 0 0),));
margin-block-start: $spacing-md;
margin-inline-start: $spacing-sm;
}
}
}
9 changes: 5 additions & 4 deletions assets/sass/protocol/components/_menu-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@
text-decoration: none;

.mzp-t-download & {
@include bidi(((padding-right, $spacing-sm * 2 + 14px, padding-left, $spacing-sm),));
padding-inline-end: $spacing-sm * 2 + 14px;

&::after {
background-size: 20px, 20px;
bottom: $spacing-sm;
content: '';
display: block;
inset-inline-end: $spacing-sm;
position: absolute;
top: $spacing-sm;
width: 14px;
@include bidi(((right, $spacing-sm, left, auto),));
}
}

Expand Down Expand Up @@ -76,22 +76,23 @@
font-family: inherit;
font-size: inherit;
font-weight: inherit;
padding-block: 0;
padding-inline: 0 (16px + $spacing-sm);
position: relative;
text-align: inherit;
text-decoration: underline;
width: 100%;
@include bidi(((padding, 0 (16px + $spacing-sm) 0 0, 0 0 0 (16px + $spacing-sm)),));

&::after {
background: $url-image-caret-down-link center bottom no-repeat;
bottom: 1px;
content: '';
display: inline-block;
inset-inline-end: 0;
position: absolute;
top: 0;
width: 16px;
transition: transform 200ms ease-in-out;
@include bidi(((right, 0, left, auto),));
}

&[aria-expanded='true']::after {
Expand Down
20 changes: 15 additions & 5 deletions assets/sass/protocol/components/_menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@
transition: transform 100ms ease-in-out;
content: '';
height: 20px;
inset-inline-end: 8px;
margin-top: -8px;
position: absolute;
top: 50%;
width: 20px;
@include bidi(((right, 8px, left, auto),));
}
}

Expand Down Expand Up @@ -224,11 +224,21 @@
}

@media #{$mq-md} {
@include bidi(((right, $layout-lg, left, auto),));
right: $layout-lg;

[dir='rtl'] & {
right: auto;
left: $layout-lg;
}
}

@media #{$mq-lg} {
@include bidi(((right, $layout-xl, left, auto),));
right: $layout-xl;

[dir='rtl'] & {
right: auto;
left: $layout-xl;
}
}
}

Expand Down Expand Up @@ -284,11 +294,11 @@
float: inline-start;

&:first-child {
@include bidi(((margin-right, $spacing-lg * 0.5, margin-left, 0),));
margin-inline-end: $spacing-lg * 0.5;
}

&:last-child {
@include bidi(((margin-left, $spacing-lg * 0.5, margin-right, 0),));
margin-inline-start: $spacing-lg * 0.5;
}

& > li:last-child .mzp-c-menu-item {
Expand Down
44 changes: 24 additions & 20 deletions assets/sass/protocol/components/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,22 @@ html.mzp-has-sticky-navigation {
}

@media #{$mq-md} {
@include bidi(((margin, $spacing-lg ($spacing-sm * 2) $spacing-lg 0, $spacing-lg 0 $spacing-lg ($spacing-sm * 2)),));
margin-block: $spacing-lg;
margin-inline: 0 ($spacing-sm * 2);

a {
margin-top: $spacing-sm;
}
}

@media #{$mq-lg} {
@include bidi(((margin, $spacing-lg ($spacing-md * 2) $spacing-lg 0, $spacing-lg 0 $spacing-lg ($spacing-md * 2)),));
margin-block: $spacing-lg;
margin-inline: 0 ($spacing-md * 2);
}

@media #{$mq-xl} {
@include bidi(((margin, $spacing-lg ($spacing-lg * 2) $spacing-lg 0, $spacing-lg 0 $spacing-lg ($spacing-lg * 2)),));
margin-block: $spacing-lg;
margin-inline: 0 ($spacing-lg * 2);
}

.mzp-t-firefox & {
Expand Down Expand Up @@ -132,16 +135,16 @@ html.mzp-has-sticky-navigation {

@media #{$mq-md} {
display: inline-block;
margin-inline-start: -$spacing-sm;
width: auto;
@include bidi(((margin-left, -$spacing-sm, margin-right, 0),));
}

@media #{$mq-lg} {
@include bidi(((margin-left, -$spacing-md, margin-right, 0),));
margin-inline-start: -$spacing-md;
}

@media #{$mq-xl} {
@include bidi(((margin-left, -$spacing-lg, margin-right, 0),));
margin-inline-start: -$spacing-lg;
}
}

Expand All @@ -165,17 +168,17 @@ html.mzp-has-sticky-navigation {
display: block;
float: inline-end;
margin: $spacing-lg 0;
@include bidi((
(margin, $spacing-lg 0 $spacing-lg $spacing-sm, $spacing-lg $spacing-sm $spacing-lg 0),
));
margin-inline-start: $spacing-sm;
}

@media #{$mq-lg} {
@include bidi(((margin, $spacing-lg 0 $spacing-lg $spacing-md, $spacing-lg $spacing-md $spacing-lg 0),));
margin-block: $spacing-lg;
margin-inline-start: $spacing-md;
}

@media #{$mq-xl} {
@include bidi(((margin, $spacing-lg 0 $spacing-lg $spacing-lg, $spacing-lg $spacing-lg $spacing-lg 0),));
margin-block: $spacing-lg;
margin-inline-start: $spacing-lg;
}
}

Expand All @@ -185,16 +188,19 @@ html.mzp-has-sticky-navigation {
.mzp-c-navigation-menu-button {
background-color: transparent;
background-image: url('#{$image-path}/icons/menu.svg');
background-position: right 6px center;
background-repeat: no-repeat;
border-radius: $border-radius-sm;
border: none;
display: none;
height: 32px;
float: inline-end;
@include bidi((
(background-position, right 6px center, left 6px center ),
(padding, 0 32px 0 6px, 0 6px 0 32px)
));
height: 32px;
padding-block: 0;
padding-inline: 6px 32px;

[dir='rtl'] & {
background-position: left 6px center;
}

&:hover,
&:active,
Expand All @@ -208,10 +214,8 @@ html.mzp-has-sticky-navigation {
cursor: pointer;
width: 32px;
@include image-replaced;
@include bidi((
(background-position, center center, center center ),
(padding, 0, 0),
));
background-position: center center;
padding: 0;
}

.js .mzp-c-navigation-menu-button {
Expand Down
Loading
Loading