Skip to content

Commit

Permalink
chore(RTL): RTL swapped left/right spacing with css logical properties (
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtBlue authored Sep 29, 2023
1 parent 57ad24c commit 184fdb4
Show file tree
Hide file tree
Showing 54 changed files with 132 additions and 385 deletions.
26 changes: 4 additions & 22 deletions dist/button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ a.fake-btn svg.icon {
}
button.btn svg.icon:first-child,
a.fake-btn svg.icon:first-child {
margin-right: 8px;
-webkit-margin-end: 8px;
margin-inline-end: 8px;
}
button.btn svg.icon:last-child,
a.fake-btn svg.icon:last-child {
margin-left: 8px;
-webkit-margin-start: 8px;
margin-inline-start: 8px;
}
button.btn svg.icon:only-child,
a.fake-btn svg.icon:only-child {
Expand Down Expand Up @@ -471,21 +473,6 @@ button.btn--floating-label .btn__floating-label--inline {
position: unset;
transform: translate(0, -6px);
}
[dir="rtl"] button.btn svg.icon--chevron-down-12:first-child,
[dir="rtl"] a.fake-btn svg.icon--chevron-down-12:first-child {
margin-left: 8px;
margin-right: 0;
}
[dir="rtl"] button.btn svg.icon--chevron-down-12:last-child,
[dir="rtl"] a.fake-btn svg.icon--chevron-down-12:last-child {
margin-left: 0;
margin-right: 8px;
}
[dir="rtl"] button.btn svg.icon--chevron-down-12:only-child,
[dir="rtl"] a.fake-btn svg.icon--chevron-down-12:only-child {
margin-left: 0;
margin-right: 0;
}
[dir="rtl"] button.btn--split-start,
[dir="rtl"] a.fake-btn--split-start {
border-radius: 0 24px 24px 0;
Expand All @@ -512,8 +499,3 @@ button.btn--floating-label .btn__floating-label--inline {
border-left-color: var(--btn-primary-border-color, var(--color-stroke-accent));
border-right-color: var(--primary-border-split-color, var(--color-stroke-subtle));
}
[dir="rtl"] button.btn svg.icon,
[dir="rtl"] a.fake-btn svg.icon {
margin-left: 8px;
margin-right: 0;
}
26 changes: 4 additions & 22 deletions dist/carousel/carousel.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,13 @@ div.carousel {
.carousel__control--next {
right: -16px;
}
.carousel__control .icon--chevron-right-24 {
margin-left: 2px;
}
.carousel__control .icon--chevron-left-24 {
margin-left: -2px;
}
.carousel__control .icon--chevron-right-12 {
margin-left: 1px;
-webkit-margin-start: 1px;
margin-inline-start: 1px;
}
.carousel__control .icon--chevron-left-12 {
margin-left: -1px;
-webkit-margin-end: 1px;
margin-inline-end: 1px;
}
.carousel__control svg {
color: var(--carousel-paddle-foreground-color, var(--color-foreground-primary));
Expand Down Expand Up @@ -189,24 +185,10 @@ span.carousel__container {
left: unset;
right: -16px;
}
[dir="rtl"] .carousel__control .icon--chevron-left-24 {
margin-left: 2px;
}
[dir="rtl"] .carousel__control .icon--chevron-left-12 {
margin-left: 1px;
}
[dir="rtl"] .carousel__control--next {
left: -16px;
right: unset;
}
[dir="rtl"] .carousel__control .icon--chevron-right-24 {
margin-left: -2px;
}
[dir="rtl"] .carousel__control .icon--chevron-right-12 {
margin-left: -1px;
}
[dir="rtl"] .carousel__control .icon--chevron-left-24,
[dir="rtl"] .carousel__control .icon--chevron-right-24,
[dir="rtl"] .carousel__control .icon--chevron-left-12,
[dir="rtl"] .carousel__control .icon--chevron-right-12 {
transform: rotate(180deg);
Expand Down
8 changes: 5 additions & 3 deletions dist/combobox/combobox.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ span.combobox {
left: 0;
right: unset;
}
.combobox__control > svg.icon,
.combobox__control > button {
-webkit-margin-start: 8px;
margin-inline-start: 8px;
}
.combobox__option[role^="option"] {
background-color: transparent;
border-style: solid;
Expand Down Expand Up @@ -132,7 +137,6 @@ span.combobox {
}
.combobox__control > svg.icon--chevron-down-12 {
color: var(--combobox-textbox-icon-color, var(--color-foreground-primary));
margin-left: 8px;
pointer-events: none;
position: absolute;
right: 17px;
Expand Down Expand Up @@ -227,8 +231,6 @@ span.combobox {
}
[dir="rtl"] .combobox__control > svg.icon,
[dir="rtl"] .combobox__control > button {
margin-left: 0;
margin-right: 8px;
right: unset;
}
[dir="rtl"] .combobox__control > svg.icon {
Expand Down
6 changes: 4 additions & 2 deletions dist/cta-button/cta-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ a.cta-btn svg.icon {
width: 10px;
}
a.cta-btn svg.icon:first-child {
margin-right: 8px;
-webkit-margin-end: 8px;
margin-inline-end: 8px;
}
a.cta-btn svg.icon:last-child {
margin-left: 8px;
-webkit-margin-start: 8px;
margin-inline-start: 8px;
}
a.cta-btn svg.icon:only-child {
margin: 0;
Expand Down
7 changes: 2 additions & 5 deletions dist/details/details.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,12 @@ summary.details__summary--small {
padding: 4px 8px;
}
span.details__icon {
margin-left: 8px;
-webkit-margin-start: 8px;
margin-inline-start: 8px;
}
span.details__icon[hidden] {
display: inline-block;
}
[dir="rtl"] span.details__icon {
margin-left: 0;
margin-right: 8px;
}
details.details[open] span.details__icon {
transform: rotate(180deg);
}
Expand Down
3 changes: 2 additions & 1 deletion dist/drawer-dialog/drawer-dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
white-space: nowrap;
}
.drawer-dialog__header > :last-child:not(:only-child) {
margin-left: 16px;
-webkit-margin-start: 16px;
margin-inline-start: 16px;
}
.drawer-dialog__header .fake-link {
text-decoration: none;
Expand Down
4 changes: 2 additions & 2 deletions dist/field/field.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ div.field--table {
justify-content: flex-end;
}
.field__description--group > :last-child {
margin-left: 5px;
-webkit-margin-start: 5px;
margin-inline-start: 5px;
text-align: right;
}
.field__description--group > :first-child {
Expand Down Expand Up @@ -115,6 +116,5 @@ div.field__description {
margin-top: 16px;
}
[dir="rtl"] .field__description--group > :last-child {
margin-right: 5px;
text-align: left;
}
7 changes: 2 additions & 5 deletions dist/filter-menu-button/filter-menu-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ button.filter-menu-button__button:active {
.filter-menu-button__button-cell svg.icon--chevron-down-12 {
align-self: center;
color: var(--filter-menu-button-icon-color, var(--color-foreground-primary));
margin-left: 8px;
-webkit-margin-start: 8px;
margin-inline-start: 8px;
}
.filter-menu-button__button-text {
display: inline-block;
Expand Down Expand Up @@ -264,10 +265,6 @@ button.filter-menu-button__footer:hover {
div.filter-menu-button__item[role^="menuitem"]:focus:not(:focus-visible) {
outline: none;
}
[dir="rtl"] .filter-menu-button__button-cell .icon--chevron-down-12 {
margin-left: 0;
margin-right: 8px;
}
[dir="rtl"] .filter-menu-button__checkbox {
margin-left: 8px;
}
3 changes: 2 additions & 1 deletion dist/fullscreen-dialog/fullscreen-dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
white-space: nowrap;
}
.fullscreen-dialog__header > :last-child:not(:only-child) {
margin-left: 16px;
-webkit-margin-start: 16px;
margin-inline-start: 16px;
}
.fullscreen-dialog__header .fake-link {
outline-offset: 4px;
Expand Down
6 changes: 2 additions & 4 deletions dist/inline-notice/inline-notice.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ span.inline-notice {
}
.inline-notice__header {
display: flex;
margin-right: 8px;
-webkit-margin-end: 8px;
margin-inline-end: 8px;
margin-top: 4px;
}
.inline-notice p {
Expand All @@ -19,6 +20,3 @@ span.inline-notice {
.inline-notice button.fake-link {
color: var(--color-foreground-primary);
}
[dir="rtl"] .inline-notice__header .icon.icon--confirmation-filled-16 {
margin-left: 8px;
}
10 changes: 4 additions & 6 deletions dist/lightbox-dialog/lightbox-dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
white-space: nowrap;
}
.lightbox-dialog__header > :last-child:not(:only-child) {
margin-left: 16px;
-webkit-margin-start: 16px;
margin-inline-start: 16px;
}
.lightbox-dialog__main {
box-sizing: border-box;
Expand Down Expand Up @@ -116,7 +117,8 @@ button.icon-btn.lightbox-dialog__close {
z-index: 1;
}
button.icon-btn.lightbox-dialog__prev {
margin-right: 16px;
-webkit-margin-end: 16px;
margin-inline-end: 16px;
}
.lightbox-dialog--expressive button.icon-btn.lightbox-dialog__prev,
.lightbox-dialog--expressive button.icon-btn.lightbox-dialog__close {
Expand Down Expand Up @@ -213,10 +215,6 @@ button.icon-btn.lightbox-dialog__prev {
height: 95%;
max-height: 95%;
}
[dir="rtl"] button.icon-btn.lightbox-dialog__prev {
margin-left: 16px;
margin-right: 0;
}
[dir="rtl"] button.icon-btn.lightbox-dialog__prev .icon--chevron-left-16 {
transform: rotate(180deg);
}
Expand Down
7 changes: 2 additions & 5 deletions dist/listbox-button/listbox-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ button.expand-btn[aria-expanded="true"] ~ div.listbox-button__listbox,
opacity: 0;
stroke: currentColor;
stroke-width: 0;
margin-left: 8px;
-webkit-margin-start: 8px;
margin-inline-start: 8px;
}
div.listbox-button__option[role="option"][aria-selected="true"] svg.icon {
opacity: 1;
Expand Down Expand Up @@ -157,10 +158,6 @@ span.listbox-button__value {
.listbox-button__options:focus:not(:focus-visible) {
outline: none;
}
[dir="rtl"] .listbox-button__option svg.icon {
margin-left: 0;
margin-right: 8px;
}
[dir="rtl"] .listbox-button .btn__label {
color: var(--listbox-button-label-color, var(--color-foreground-secondary));
margin-left: 3px;
Expand Down
7 changes: 2 additions & 5 deletions dist/listbox/listbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,8 @@ div.listbox__option svg.icon {
opacity: 0;
stroke: currentColor;
stroke-width: 0;
margin-left: 8px;
}
[dir="rtl"] div.listbox__option svg.icon {
margin-left: 0;
margin-right: 8px;
-webkit-margin-start: 8px;
margin-inline-start: 8px;
}
div.listbox__options[role="listbox"]:focus .listbox__option--active[role="option"] {
background-color: var(--color-state-primary-hover);
Expand Down
13 changes: 4 additions & 9 deletions dist/page-notice/page-notice.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ span[role="region"].page-notice {
.page-notice__header {
grid-column: 1;
grid-row: 1;
padding-right: 16px;
-webkit-margin-end: 16px;
margin-inline-end: 16px;
}
.page-notice__main {
grid-column: 1 / 3;
grid-row: 1;
padding-right: 16px;
-webkit-margin-end: 16px;
margin-inline-end: 16px;
}
.page-notice__header + .page-notice__main {
grid-column: 2;
Expand Down Expand Up @@ -130,13 +132,6 @@ p.page-notice__cta {
margin-top: 0;
}
}
[dir="rtl"] .page-notice__header {
padding-left: 16px;
padding-right: 0;
}
[dir="rtl"] .page-notice__main {
padding-right: 0;
}
[dir="rtl"] .page-notice__footer {
margin-left: initial;
margin-right: auto;
Expand Down
16 changes: 4 additions & 12 deletions dist/pagination/pagination.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ button.pagination__previous {
}
a.pagination__next,
button.pagination__next {
margin-left: 8px;
-webkit-margin-start: 8px;
margin-inline-start: 8px;
}
a.pagination__previous,
button.pagination__previous {
margin-right: 8px;
-webkit-margin-end: 8px;
margin-inline-end: 8px;
}
.pagination__item {
align-items: center;
Expand Down Expand Up @@ -127,16 +129,6 @@ nav.pagination--fluid ol.pagination__items li {
[dir="rtl"] nav.pagination svg.icon--arrow-left-16 {
transform: rotate(180deg);
}
[dir="rtl"] a.pagination__next,
[dir="rtl"] button.pagination__next {
margin-left: 0;
margin-right: 8px;
}
[dir="rtl"] a.pagination__previous,
[dir="rtl"] button.pagination__previous {
margin-left: 8px;
margin-right: 0;
}
@media (min-width: 768px) {
nav.pagination {
margin: 16px 0;
Expand Down
3 changes: 2 additions & 1 deletion dist/panel-dialog/panel-dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
white-space: nowrap;
}
.panel-dialog__header > :last-child:not(:only-child) {
margin-left: 16px;
-webkit-margin-start: 16px;
margin-inline-start: 16px;
}
.panel-dialog__header .fake-link {
outline-offset: 4px;
Expand Down
Loading

0 comments on commit 184fdb4

Please sign in to comment.