Skip to content

Commit 6257d21

Browse files
committed
fix: adjust all styles for RTL support
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent e3154a1 commit 6257d21

File tree

4 files changed

+50
-53
lines changed

4 files changed

+50
-53
lines changed

src/components/NcModal/NcModal.vue

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ export default {
897897
position: fixed;
898898
z-index: 9998;
899899
top: 0;
900-
left: 0;
900+
inset-inline-start: 0;
901901
display: block;
902902
width: 100%;
903903
height: 100%;
@@ -916,8 +916,7 @@ export default {
916916
position: absolute;
917917
z-index: 10001;
918918
top: 0;
919-
right: 0;
920-
left: 0;
919+
inset-inline: 0 0;
921920
// prevent vue show to use display:none and resetting
922921
// the circle animation loop
923922
display: flex !important;
@@ -943,14 +942,14 @@ export default {
943942
// On wider screens the name can be centered
944943
@media only screen and (min-width: $breakpoint-mobile) {
945944
&__name {
946-
padding-left: calc(var(--default-clickable-area) * 3); // maximum actions is 3
945+
padding-inline-start: calc(var(--default-clickable-area) * 3); // maximum actions is 3
947946
text-align: center;
948947
}
949948
}
950949
951950
.icons-menu {
952951
position: absolute;
953-
right: 0;
952+
inset-inline-end: 0;
954953
display: flex;
955954
align-items: center;
956955
justify-content: flex-end;
@@ -1051,10 +1050,10 @@ export default {
10511050
}
10521051
10531052
.prev {
1054-
left: 2px;
1053+
inset-inline-start: 2px;
10551054
}
10561055
.next {
1057-
right: 2px;
1056+
inset-inline-end: 2px;
10581057
}
10591058
10601059
/* Content */
@@ -1182,7 +1181,7 @@ $pi: 3.14159265358979;
11821181
.progress-ring {
11831182
position: absolute;
11841183
top: 0;
1185-
left: 0;
1184+
inset-inline-start: 0;
11861185
transform: rotate(-90deg);
11871186
.progress-ring__circle {
11881187
transition: 100ms stroke-dashoffset;

src/components/NcPopover/NcPopover.vue

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -415,44 +415,44 @@ export default {
415415
</script>
416416
417417
<style lang="scss">
418-
419-
.resize-observer {
420-
position:absolute;
421-
top:0;
422-
left:0;
423-
z-index:-1;
424-
width:100%;
425-
height:100%;
426-
border:none;
427-
background-color:transparent;
428-
pointer-events:none;
429-
display:block;
430-
overflow:hidden;
431-
opacity:0
432-
}
433-
434-
.resize-observer object {
435-
display:block;
436-
position:absolute;
437-
top:0;
438-
left:0;
439-
height:100%;
440-
width:100%;
441-
overflow:hidden;
442-
pointer-events:none;
443-
z-index:-1
444-
}
445-
446418
$arrow-width: 10px;
447419
// Move the arrow just slightly inside the popover
448420
// To prevent a visual gap on page scaling
449421
$arrow-position: $arrow-width - 1px;
450422
423+
// Size class comes from the floating-vue library we use
424+
.resize-observer {
425+
position: absolute;
426+
top: 0;
427+
inset-inline-start: 0;
428+
z-index: -1;
429+
width: 100%;
430+
height: 100%;
431+
border: none;
432+
background-color: transparent;
433+
pointer-events: none;
434+
display: block;
435+
overflow: hidden;
436+
opacity: 0;
437+
438+
object {
439+
display: block;
440+
position: absolute;
441+
top: 0;
442+
inset-inline-start: 0;
443+
height: 100%;
444+
width: 100%;
445+
overflow: hidden;
446+
pointer-events: none;
447+
z-index: -1;
448+
}
449+
}
450+
451451
.v-popper--theme-dropdown {
452452
&.v-popper__popper {
453453
z-index: 100000;
454454
top: 0;
455-
left: 0;
455+
inset-inline-start: 0;
456456
display: block !important;
457457
458458
.v-popper__wrapper {
@@ -499,15 +499,15 @@ $arrow-position: $arrow-width - 1px;
499499
}
500500
501501
&[data-popper-placement^='right'] .v-popper__arrow-container {
502-
left: -$arrow-position;
503-
border-left-width: 0;
504-
border-right-color: var(--color-main-background);
502+
inset-inline-start: -$arrow-position;
503+
border-inline-start-width: 0;
504+
border-inline-end-color: var(--color-main-background);
505505
}
506506
507507
&[data-popper-placement^='left'] .v-popper__arrow-container {
508-
right: -$arrow-position;
509-
border-right-width: 0;
510-
border-left-color: var(--color-main-background);
508+
inset-inline-end: -$arrow-position;
509+
border-inline-end-width: 0;
510+
border-inline-start-color: var(--color-main-background);
511511
}
512512
513513
&[aria-hidden='true'] {

src/directives/Tooltip/index.scss

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ $arrow-width: 10px;
1212
position: absolute;
1313
z-index: 100000;
1414
top: 0;
15-
right: auto;
16-
left: auto;
15+
inset-inline: auto;
1716
display: block;
1817
margin: 0;
1918
padding: 0;
20-
text-align: left;
2119
text-align: start;
2220
opacity: 0;
2321
line-height: 1.6;
@@ -41,16 +39,16 @@ $arrow-width: 10px;
4139

4240
// RIGHT
4341
&[data-popper-placement^='right'] .v-popper__arrow-container {
44-
right: 100%;
45-
border-left-width: 0;
46-
border-right-color: var(--color-main-background);
42+
inset-inline-end: 100%;
43+
border-inline-start-width: 0;
44+
border-inline-end-color: var(--color-main-background);
4745
}
4846

4947
// LEFT
5048
&[data-popper-placement^='left'] .v-popper__arrow-container {
51-
left: 100%;
52-
border-right-width: 0;
53-
border-left-color: var(--color-main-background);
49+
inset-inline-start: 100%;
50+
border-inline-end-width: 0;
51+
border-inline-start-color: var(--color-main-background);
5452
}
5553

5654
// HIDDEN / SHOWN

stylelint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020
'csstools/use-logical': [
2121
'always',
2222
{
23-
severity: 'warning',
23+
severity: 'error',
2424
// Only lint LTR-RTL properties for now
2525
except: [
2626
// Position properties

0 commit comments

Comments
 (0)