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 @@ -49,6 +49,11 @@ Introducing theme variables! CSS variables beginning with `--theme-` will adjust
* Added status color variables (`--theme-color-success-*`, `--theme-color-error-*`, `--theme-color-warning-*`, `--theme-color-info-*`)
* Removed Sass color variables from `_themes-sass.scss` (use CSS variables instead)

### CSS Logical Properties

* Started migrating physical directional properties (`margin-left`, `padding-right`, `text-align: left`, etc.) to their logical equivalents (`margin-inline-start`, `padding-inline-end`, `text-align: start`, etc.), which adapt to RTL languages automatically instead of needing a `[dir='rtl']` override or the internal `bidi()` Sass mixin. First pass covers `includes/mixins/_utils.scss`, `includes/mixins/_details.scss`, `includes/forms/index.scss`, and `base/elements/_forms.scss`, `_lists.scss`, `_links.scss`, `_tables.scss`, `_quotes.scss`, `_details.scss`, and `base/utilities/_rich-text.scss`. Components follow in subsequent PRs, ending with the removal of `bidi()` itself.
* Where a property has no logical equivalent that's safe across the supported browser matrix (e.g. `background-position` for a decorative icon), kept the physical value with an explicit `[dir='rtl']` override rather than forcing an incomplete conversion.

## Component changes

### Feature Card
Expand Down
2 changes: 1 addition & 1 deletion assets/sass/protocol/base/elements/_details.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ details .is-summary button,

// Override styling the native element when the polyfill is applied (issue #658)
summary.is-summary {
@include bidi(((padding-right, 0, padding-left, 0),));
padding-inline: 0;

&::before {
display: none;
Expand Down
14 changes: 9 additions & 5 deletions assets/sass/protocol/base/elements/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ label {

&.mzp-u-inline {
display: inline;
@include bidi(((padding, 0 $spacing-sm 0 0, 0 0 0 $spacing-sm),));
padding-block-end: 0;
padding-inline-end: $spacing-sm;
}
}

Expand Down Expand Up @@ -302,18 +303,21 @@ select {
appearance: none;
box-sizing: border-box;
background-image: $url-image-caret-down-form, forms.$select-bg;
background-position: right 8px top 50%;
background-repeat: no-repeat, repeat;
background-size: 1em auto, 100%;
display: block;
font-weight: normal;
max-width: 100%;
min-width: forms.$field-min-width;
padding-block: forms.$field-padding;
padding-inline: forms.$field-padding forms.$symbol-spacing;
text-overflow: ellipsis;
@include forms.form-input;
@include bidi((
(background-position, right 8px top 50%, left 8px top 50%),
(padding, forms.$field-padding forms.$symbol-spacing forms.$field-padding forms.$field-padding, forms.$field-padding forms.$field-padding forms.$field-padding forms.$symbol-spacing),
));

[dir='rtl'] & {
background-position: left 8px top 50%;
}

// no down arrow on multi selects
&[multiple] {
Expand Down
4 changes: 2 additions & 2 deletions assets/sass/protocol/base/elements/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ a {
}

&-icon-start {
@include bidi(((margin-right, 0.5ch, 0), (margin-left, 0, 0.5ch),));
margin-inline: 0 0.5ch;
}

&-icon-end {
@include bidi(((margin-left, 0.5ch, 0), (margin-right, 0, 0.5ch),));
margin-inline: 0.5ch 0;
}

}
22 changes: 10 additions & 12 deletions assets/sass/protocol/base/elements/_lists.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ol {

ul.mzp-u-list-styled {
list-style: disc;
@include bidi(((margin-left, $layout-sm, margin-right, 0),));
margin-inline-start: $layout-sm;

li {
margin-bottom: 0.25em;
Expand All @@ -23,19 +23,19 @@ ul.mzp-u-list-styled {
ul {
list-style: circle;
margin-bottom: 0;
@include bidi(((margin-left, $layout-xs, margin-right, 0),));
margin-inline-start: $layout-xs;
}

ol {
list-style: decimal;
margin-bottom: 0;
@include bidi(((margin-left, $layout-xs, margin-right, 0),));
margin-inline-start: $layout-xs;
}
}

ol.mzp-u-list-styled {
list-style: decimal;
@include bidi(((margin-left, $layout-sm, margin-right, 0),));
margin-inline-start: $layout-sm;

li {
margin-bottom: 0.25em;
Expand All @@ -44,13 +44,13 @@ ol.mzp-u-list-styled {
ol {
list-style: lower-alpha;
margin-bottom: 0;
@include bidi(((margin-left, $layout-xs, margin-right, 0),));
margin-inline-start: $layout-xs;
}

ul {
list-style: disc;
margin-bottom: 0;
@include bidi(((margin-left, $layout-xs, margin-right, 0),));
margin-inline-start: $layout-xs;
}
}

Expand All @@ -62,13 +62,13 @@ dl.mzp-u-list-styled {

dd {
margin-bottom: 0.25em;
@include bidi(((margin-left, $layout-xs, margin-right, 0),));
margin-inline-start: $layout-xs;
}

ul,
ol {
margin-bottom: 0;
@include bidi(((margin-left, $layout-xs, margin-right, 0),));
margin-inline-start: $layout-xs;
}

ul {
Expand All @@ -79,13 +79,11 @@ dl.mzp-u-list-styled {
/* !important required to trump specificity and print stylesheet overrides */
.mzp-u-list-unstyled {
list-style: none !important; /* stylelint-disable-line declaration-no-important */
margin-left: 0 !important; /* stylelint-disable-line declaration-no-important */
margin-right: 0 !important; /* stylelint-disable-line declaration-no-important */
margin-inline: 0 !important; /* stylelint-disable-line declaration-no-important */

ul,
ol {
list-style: none !important; /* stylelint-disable-line declaration-no-important */
margin-left: 0 !important; /* stylelint-disable-line declaration-no-important */
margin-right: 0 !important; /* stylelint-disable-line declaration-no-important */
margin-inline: 0 !important; /* stylelint-disable-line declaration-no-important */
}
}
4 changes: 3 additions & 1 deletion assets/sass/protocol/base/elements/_quotes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@

blockquote {
@include text-heading-sm;
border-block-width: 0;
border-color: $color-marketing-gray-20;
border-inline-end-width: 0;
border-inline-start-width: 5px;
border-style: solid;
color: var(--theme-heading-text-color);
font-weight: bold;
margin: $spacing-lg auto;
padding: $spacing-sm $spacing-lg;
@include bidi(((border-width, 0 0 0 5px, 0 5px 0 0),));

cite {
@include text-heading-xs;
Expand Down
8 changes: 4 additions & 4 deletions assets/sass/protocol/base/utilities/_rich-text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

ul {
list-style-type: disc;
@include bidi(((margin-left, $layout-sm, margin-right, 0),));
margin-inline-start: $layout-sm;

ul {
list-style-type: circle;
Expand All @@ -64,7 +64,7 @@

ol {
list-style-type: decimal;
@include bidi(((margin-left, $layout-sm, margin-right, 0),));
margin-inline-start: $layout-sm;

ol {
list-style-type: lower-roman;
Expand All @@ -75,7 +75,7 @@
margin-bottom: 0.25em;

ul, ol {
@include bidi(((margin-left, $layout-xs, margin-right, 0),));
margin-inline-start: $layout-xs;
}
}

Expand All @@ -86,7 +86,7 @@

dd {
margin-bottom: 0.25em;
@include bidi(((margin-left, $layout-xs, margin-right, 0),));
margin-inline-start: $layout-xs;
}

pre {
Expand Down
2 changes: 1 addition & 1 deletion assets/sass/protocol/includes/forms/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ $line-height-shim: 0.15em; // two elements with text appear to have more space b
bottom: 100%;
content: '';
height: 0;
inset-inline-start: 6px;
position: absolute;
width: 0;
z-index: 1;
@include bidi(((left, 6px, right, auto),));
}
5 changes: 2 additions & 3 deletions assets/sass/protocol/includes/mixins/_details.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

@use '../tokens';
@use 'bidi';
@use 'images';

@mixin details {
Expand All @@ -28,20 +27,20 @@
}

@mixin summary {
padding-inline-end: tokens.$layout-md;
position: relative;
@include bidi.bidi(((padding-right, tokens.$layout-md, padding-left, 0),));

&::before {
background: images.$url-image-expand-black top left no-repeat;
background-size: 20px, 20px;
inset-inline-end: 8px;
transition: transform 100ms ease-in-out;
content: '';
height: 20px;
margin-top: -8px;
position: absolute;
top: 50%;
width: 20px;
@include bidi.bidi(((right, 8px, left, auto),));
}
}

Expand Down
5 changes: 1 addition & 4 deletions assets/sass/protocol/includes/mixins/_utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,8 @@
iframe,
object,
embed {
bottom: 0;
left: 0;
inset: 0;
position: absolute;
right: 0;
top: 0;
}
}

Expand Down