Skip to content

Commit 07207e1

Browse files
committed
feat(ui): replace all left/right css styles for rtl support
1 parent bb5e5c1 commit 07207e1

38 files changed

Lines changed: 155 additions & 147 deletions

app/assets/main.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ html {
8080
}
8181
}
8282

83+
html[dir='rtl'] .rtl-flip {
84+
transform: scale(-1, 1);
85+
}
86+
8387
body {
8488
margin: 0;
8589
background-color: var(--bg);

app/components/AppFooter.vue

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,56 @@
1+
<script setup lang="ts"></script>
12
<template>
23
<footer class="border-t border-border mt-auto" :aria-label="$t('footer.site_footer')">
34
<div class="container py-3 sm:py-8 flex flex-col gap-2 sm:gap-4 text-fg-subtle text-sm">
4-
<div class="flex flex-col sm:flex-row items-center justify-between gap-2 sm:gap-4">
5+
<div class="flex flex-col sm:flex-row items-center justify-start gap-2 sm:gap-4">
56
<p class="font-mono m-0 hidden sm:block">{{ $t('tagline') }}</p>
6-
<div class="flex items-center gap-3 sm:gap-6">
7+
<span aria-hidden="true" class="flex-shrink-1 flex-grow-1" />
8+
<div class="flex items-center justify-start gap-3 sm:gap-6">
79
<NuxtLink
810
to="/about"
911
class="link-subtle font-mono text-xs min-h-8 sm:min-h-11 flex items-center"
1012
>
11-
{{ $t('footer.about') }}
13+
<span>{{ $t('footer.about') }}</span>
1214
</NuxtLink>
1315
<a
1416
href="https://docs.npmx.dev"
1517
target="_blank"
1618
rel="noopener noreferrer"
17-
class="link-subtle font-mono text-xs min-h-8 sm:min-h-11 flex items-center gap-1"
19+
class="link-subtle font-mono text-xs min-h-8 sm:min-h-11 flex items-center justify-start gap-1"
1820
>
19-
{{ $t('footer.docs') }}
20-
<span class="i-carbon-launch w-3 h-3" aria-hidden="true" />
21+
<span>{{ $t('footer.docs') }}</span>
22+
<span class="i-carbon:launch rtl-flip w-3 h-3" aria-hidden="true" />
2123
</a>
2224
<a
2325
href="https://repo.npmx.dev"
2426
target="_blank"
2527
rel="noopener noreferrer"
26-
class="link-subtle font-mono text-xs min-h-8 sm:min-h-11 flex items-center gap-1"
28+
class="link-subtle font-mono text-xs min-h-8 sm:min-h-11 flex justify-start items-center gap-1"
2729
>
28-
{{ $t('footer.source') }}
29-
<span class="i-carbon-launch w-3 h-3" aria-hidden="true" />
30+
<span>{{ $t('footer.source') }}</span>
31+
<span class="i-carbon:launch rtl-flip w-3 h-3" aria-hidden="true" />
3032
</a>
3133
<a
3234
href="https://social.npmx.dev"
3335
target="_blank"
3436
rel="noopener noreferrer"
35-
class="link-subtle font-mono text-xs min-h-8 sm:min-h-11 flex items-center gap-1"
37+
class="link-subtle font-mono text-xs min-h-8 sm:min-h-11 flex items-center justify-start gap-1"
3638
>
37-
{{ $t('footer.social') }}
38-
<span class="i-carbon-launch w-3 h-3" aria-hidden="true" />
39+
<span>{{ $t('footer.social') }}</span>
40+
<span class="i-carbon:launch rtl-flip w-3 h-3" aria-hidden="true" />
3941
</a>
4042
<a
4143
href="https://chat.npmx.dev"
4244
target="_blank"
4345
rel="noopener noreferrer"
44-
class="link-subtle font-mono text-xs min-h-8 sm:min-h-11 flex items-center gap-1"
46+
class="link-subtle font-mono text-xs min-h-8 sm:min-h-11 flex items-center justify-start gap-1"
4547
>
46-
{{ $t('footer.chat') }}
47-
<span class="i-carbon-launch w-3 h-3" aria-hidden="true" />
48+
<span>{{ $t('footer.chat') }}</span>
49+
<span class="i-carbon:launch rtl-flip w-3 h-3" aria-hidden="true" />
4850
</a>
4951
</div>
5052
</div>
51-
<p class="text-xs text-fg-muted text-center sm:text-left m-0">
53+
<p class="text-xs text-fg-muted text-center sm:text-start m-0">
5254
<span class="sm:hidden">{{ $t('non_affiliation_disclaimer') }}</span>
5355
<span class="hidden sm:inline">{{ $t('trademark_disclaimer') }}</span>
5456
</p>

app/components/AppHeader.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ onKeyStroke(',', e => {
5454
:aria-label="$t('header.site_header')"
5555
class="sticky top-0 z-50 bg-bg/80 backdrop-blur-md border-b border-border"
5656
>
57-
<nav :aria-label="$t('nav.main_navigation')" class="container h-14 flex items-center">
58-
<!-- Left: Logo -->
57+
<nav
58+
:aria-label="$t('nav.main_navigation')"
59+
class="container h-14 flex items-center justify-start"
60+
>
61+
<!-- Start: Logo -->
5962
<div class="flex-shrink-0">
6063
<NuxtLink
6164
v-if="showLogo"
@@ -87,7 +90,7 @@ onKeyStroke(',', e => {
8790
<div class="relative group" :class="{ 'is-focused': isSearchFocused }">
8891
<div class="search-box relative flex items-center">
8992
<span
90-
class="absolute left-3 text-fg-subtle font-mono text-sm pointer-events-none transition-colors duration-200 motion-reduce:transition-none group-focus-within:text-accent z-1"
93+
class="absolute inset-is-3 text-fg-subtle font-mono text-sm pointer-events-none transition-colors duration-200 motion-reduce:transition-none group-focus-within:text-accent z-1"
9194
>
9295
/
9396
</span>
@@ -99,7 +102,7 @@ onKeyStroke(',', e => {
99102
name="q"
100103
:placeholder="$t('search.placeholder')"
101104
v-bind="noCorrect"
102-
class="w-full bg-bg-subtle border border-border rounded-md pl-7 pr-3 py-1.5 font-mono text-sm text-fg placeholder:text-fg-subtle transition-border-color duration-300 motion-reduce:transition-none focus:border-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50"
105+
class="w-full bg-bg-subtle border border-border rounded-md ps-7 pe-3 py-1.5 font-mono text-sm text-fg placeholder:text-fg-subtle transition-border-color duration-300 motion-reduce:transition-none focus:border-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50"
103106
@input="handleSearchInput"
104107
@focus="isSearchFocused = true"
105108
@blur="isSearchFocused = false"
@@ -123,8 +126,8 @@ onKeyStroke(',', e => {
123126
</ul>
124127
</div>
125128

126-
<!-- Right: User status + GitHub -->
127-
<div class="flex-shrink-0 flex items-center gap-4 sm:gap-6 ml-auto sm:ml-0">
129+
<!-- End: User status + GitHub -->
130+
<div class="flex-shrink-0 flex items-center gap-4 sm:gap-6 ms-auto sm:ms-0">
128131
<NuxtLink
129132
to="/about"
130133
class="sm:hidden link-subtle font-mono text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 rounded"

app/components/AppTooltip.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ const isVisible = shallowRef(false)
1010
const tooltipId = useId()
1111
1212
const positionClasses: Record<string, string> = {
13-
top: 'bottom-full left-1/2 -translate-x-1/2 mb-1',
14-
bottom: 'top-full left-0 mt-1',
15-
left: 'right-full top-1/2 -translate-y-1/2 mr-2',
16-
right: 'left-full top-1/2 -translate-y-1/2 ml-2',
13+
top: 'bottom-full inset-is-1/2 -translate-x-1/2 mb-1',
14+
bottom: 'top-full inset-is-0 me-1',
15+
left: 'right-full top-1/2 -translate-y-1/2 me-2',
16+
right: 'left-full top-1/2 -translate-y-1/2 ms-2',
1717
}
1818
1919
const tooltipPosition = computed(() => positionClasses[props.position || 'bottom'])

app/components/CodeDirectoryListing.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function formatBytes(bytes: number): string {
9797
<span>{{ node.name }}</span>
9898
</NuxtLink>
9999
</td>
100-
<td class="py-2 px-4 text-right font-mono text-xs text-fg-subtle">
100+
<td class="py-2 px-4 text-end font-mono text-xs text-fg-subtle">
101101
<span v-if="node.type === 'file' && node.size">
102102
{{ formatBytes(node.size) }}
103103
</span>

app/components/CodeFileTree.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ watch(
3939
<template v-if="node.type === 'directory'">
4040
<button
4141
type="button"
42-
class="w-full flex items-center gap-1.5 py-1.5 px-3 text-left font-mono text-sm transition-colors hover:bg-bg-muted"
42+
class="w-full flex items-center gap-1.5 py-1.5 px-3 text-start font-mono text-sm transition-colors hover:bg-bg-muted"
4343
:class="isNodeActive(node) ? 'text-fg' : 'text-fg-muted'"
4444
:style="{ paddingLeft: `${depth * 12 + 12}px` }"
4545
@click="toggleDir(node.path)"
4646
>
4747
<span
4848
class="w-4 h-4 shrink-0 transition-transform"
49-
:class="[isExpanded(node.path) ? 'i-carbon-chevron-down' : 'i-carbon-chevron-right']"
49+
:class="[isExpanded(node.path) ? 'i-carbon:chevron-down' : 'i-carbon:chevron-right']"
5050
/>
5151
<span
5252
class="w-4 h-4 shrink-0"

app/components/CodeMobileTreeDrawer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ watch(isOpen, open => (isLocked.value = open))
2727
<!-- Toggle button (mobile only) -->
2828
<button
2929
type="button"
30-
class="md:hidden fixed bottom-4 right-4 z-40 w-12 h-12 bg-bg-elevated border border-border rounded-full shadow-lg flex items-center justify-center text-fg-muted hover:text-fg transition-colors"
30+
class="md:hidden fixed bottom-4 inset-ie-4 z-40 w-12 h-12 bg-bg-elevated border border-border rounded-full shadow-lg flex items-center justify-center text-fg-muted hover:text-fg transition-colors"
3131
:aria-label="$t('code.toggle_tree')"
3232
@click="isOpen = !isOpen"
3333
>
@@ -57,7 +57,7 @@ watch(isOpen, open => (isLocked.value = open))
5757
>
5858
<aside
5959
v-if="isOpen"
60-
class="md:hidden fixed inset-y-0 left-0 z-50 w-72 bg-bg-subtle border-r border-border overflow-y-auto"
60+
class="md:hidden fixed inset-y-0 inset-is-0 z-50 w-72 bg-bg-subtle border-ie border-border overflow-y-auto"
6161
>
6262
<div
6363
class="sticky top-0 bg-bg-subtle border-b border-border px-4 py-3 flex items-center justify-between"

app/components/CodeViewer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ watch(
5858
<div class="code-viewer flex min-h-full">
5959
<!-- Line numbers column -->
6060
<div
61-
class="line-numbers shrink-0 bg-bg-subtle border-r border-border text-right select-none"
61+
class="line-numbers shrink-0 bg-bg-subtle border-ie border-border text-end select-none"
6262
aria-hidden="true"
6363
>
6464
<a

app/components/ConnectorModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ watch(open, isOpen => {
124124
class="flex items-center p-3 bg-bg-muted border border-border rounded-lg font-mono text-sm"
125125
>
126126
<span class="text-fg-subtle">$</span>
127-
<span class="text-fg-subtle ml-2">{{ executeNpmxConnectorCommand }}</span>
127+
<span class="text-fg-subtle ms-2">{{ executeNpmxConnectorCommand }}</span>
128128
<button
129129
type="button"
130130
:aria-label="
131131
copied ? $t('connector.modal.copied') : $t('connector.modal.copy_command')
132132
"
133-
class="ml-auto text-fg-subtle hover:text-fg transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 rounded"
133+
class="ms-auto text-fg-subtle hover:text-fg transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 rounded"
134134
@click="copyCommand"
135135
>
136136
<span v-if="!copied" class="i-carbon-copy block w-5 h-5" aria-hidden="true" />

app/components/ConnectorStatus.client.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const ariaLabel = computed(() => {
7575
<!-- Operation count badge (overlaid) -->
7676
<span
7777
v-if="isConnected && operationCount > 0"
78-
class="absolute -top-0.5 -right-0.5 min-w-[1rem] h-4 px-1 flex items-center justify-center font-mono text-[10px] rounded-full"
78+
class="absolute -top-0.5 -inset-ie-0.5 min-w-[1rem] h-4 px-1 flex items-center justify-center font-mono text-[10px] rounded-full"
7979
:class="hasPendingOperations ? 'bg-yellow-500 text-black' : 'bg-blue-500 text-white'"
8080
aria-hidden="true"
8181
>
@@ -93,7 +93,7 @@ const ariaLabel = computed(() => {
9393
<div
9494
v-if="showTooltip"
9595
role="tooltip"
96-
class="absolute right-0 top-full mt-2 px-2 py-1 font-mono text-xs text-fg bg-bg-elevated border border-border rounded shadow-lg whitespace-nowrap z-50"
96+
class="absolute inset-ie-0 top-full mt-2 px-2 py-1 font-mono text-xs text-fg bg-bg-elevated border border-border rounded shadow-lg whitespace-nowrap z-50"
9797
>
9898
{{ tooltipText }}
9999
</div>

0 commit comments

Comments
 (0)