A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
style(app): use logical CSS properties in the app layout
Hampus5dfa76383616
diff --git a/fluxer_app/src/features/app/components/layout/ChannelItem.module.css b/fluxer_app/src/features/app/components/layout/ChannelItem.module.cssindex dcb3ae765..1b7fe3cd9 100644--- a/fluxer_app/src/features/app/components/layout/ChannelItem.module.css+++ b/fluxer_app/src/features/app/components/layout/ChannelItem.module.css@@ -2,8 +2,8 @@.channelItemCore {position: relative;- margin-left: 0.5rem;- margin-right: 0;+ margin-inline-start: 0.5rem;+ margin-inline-end: 0;display: flex;min-width: 0;flex: 1;@@ -13,8 +13,8 @@text-overflow: ellipsis;white-space: nowrap;border-radius: 0.375rem;- padding-left: 0.5rem;- padding-right: 0.5rem;+ padding-inline-start: 0.5rem;+ padding-inline-end: 0.5rem;gap: 0.375rem;padding-top: 0.375rem;padding-bottom: 0.375rem;@@ -101,7 +101,7 @@}.iconContainer {- margin-right: 0.5rem;+ margin-inline-end: 0.5rem;display: flex;align-items: center;}@@ -116,7 +116,7 @@.actionsContainer {display: flex;align-items: center;- margin-left: 0.5rem;+ margin-inline-start: 0.5rem;}.channelItemIconUnselected {@@ -140,7 +140,7 @@}.channelItemActions {- margin-left: auto;+ margin-inline-start: auto;display: flex;align-items: center;justify-content: center;@@ -164,7 +164,7 @@.unreadIndicator {position: absolute;top: 50%;- left: -0.25rem;+ inset-inline-start: -0.25rem;transform: translateY(-50%);height: 0.5rem;width: 0.5rem;@@ -178,8 +178,8 @@.channelItem {position: relative;- margin-left: 0.5rem;- margin-right: 0;+ margin-inline-start: 0.5rem;+ margin-inline-end: 0;display: flex;min-width: 0;flex: 1;@@ -189,8 +189,8 @@text-overflow: ellipsis;white-space: nowrap;border-radius: 0.375rem;- padding-left: 0.5rem;- padding-right: 0.5rem;+ padding-inline-start: 0.5rem;+ padding-inline-end: 0.5rem;}.channelItemCategory {@@ -366,7 +366,7 @@.voiceUserCount {display: flex;flex-shrink: 0;- margin-right: 0.5rem;+ margin-inline-end: 0.5rem;}.channelItemVoice.contextMenuOpen .voiceUserCount {diff --git a/fluxer_app/src/features/app/components/layout/ChannelListContent.module.css b/fluxer_app/src/features/app/components/layout/ChannelListContent.module.cssindex e8f844cf5..ac2f0c73a 100644--- a/fluxer_app/src/features/app/components/layout/ChannelListContent.module.css+++ b/fluxer_app/src/features/app/components/layout/ChannelListContent.module.css@@ -34,7 +34,7 @@width: 100%;min-width: 0;min-height: 100%;- padding-right: var(--spacing-2);+ padding-inline-end: var(--spacing-2);}.topDropZone {diff --git a/fluxer_app/src/features/app/components/layout/CollapsedCategoryVoiceParticipants.module.css b/fluxer_app/src/features/app/components/layout/CollapsedCategoryVoiceParticipants.module.cssindex 801f8d05d..f48bc9bc0 100644--- a/fluxer_app/src/features/app/components/layout/CollapsedCategoryVoiceParticipants.module.css+++ b/fluxer_app/src/features/app/components/layout/CollapsedCategoryVoiceParticipants.module.css@@ -1,14 +1,14 @@/* SPDX-License-Identifier: AGPL-3.0-or-later */.container {- margin-left: 0.5rem;- margin-right: 0.5rem;+ margin-inline-start: 0.5rem;+ margin-inline-end: 0.5rem;display: flex;align-items: center;gap: 0.375rem;border-radius: 0.375rem;- padding-left: 0.5rem;- padding-right: 0.5rem;+ padding-inline-start: 0.5rem;+ padding-inline-end: 0.5rem;padding-top: 0.25rem;padding-bottom: 0.25rem;color: var(--text-primary-muted);@@ -25,14 +25,14 @@.channelContainer {margin-top: 0.25rem;- margin-right: 0.5rem;- margin-left: 1.5rem;+ margin-inline-end: 0.5rem;+ margin-inline-start: 1.5rem;display: flex;align-items: center;gap: 0.375rem;border-radius: 0.375rem;- padding-left: 0.5rem;- padding-right: 0.5rem;+ padding-inline-start: 0.5rem;+ padding-inline-end: 0.5rem;padding-top: 0.25rem;padding-bottom: 0.25rem;color: var(--text-primary-muted);diff --git a/fluxer_app/src/features/app/components/layout/DropIndicator.module.css b/fluxer_app/src/features/app/components/layout/DropIndicator.module.cssindex 31faf5840..9f96e2e62 100644--- a/fluxer_app/src/features/app/components/layout/DropIndicator.module.css+++ b/fluxer_app/src/features/app/components/layout/DropIndicator.module.css@@ -2,8 +2,8 @@.dropIndicator {position: absolute;- right: 0;- left: 0;+ inset-inline-end: 0;+ inset-inline-start: 0;height: 0.125rem;border-radius: 624.9375rem;transition: background-color 150ms;diff --git a/fluxer_app/src/features/app/components/layout/FavoritesChannelListContent.module.css b/fluxer_app/src/features/app/components/layout/FavoritesChannelListContent.module.cssindex 94590dcd4..037e02cb4 100644--- a/fluxer_app/src/features/app/components/layout/FavoritesChannelListContent.module.css+++ b/fluxer_app/src/features/app/components/layout/FavoritesChannelListContent.module.css@@ -22,8 +22,8 @@.favoriteItem {position: relative;- margin-left: 0.5rem;- margin-right: 0.5rem;+ margin-inline-start: 0.5rem;+ margin-inline-end: 0.5rem;display: flex;min-width: 0;flex: 1;@@ -94,7 +94,7 @@.channelBadge {position: absolute;bottom: -0.125rem;- right: -0.125rem;+ inset-inline-end: -0.125rem;display: flex;height: 0.875rem;width: 0.875rem;@@ -123,7 +123,7 @@}.actionsContainer {- margin-left: auto;+ margin-inline-start: auto;display: flex;align-items: center;gap: 0.25rem;@@ -131,8 +131,8 @@.categoryItem {position: relative;- margin-left: 0.5rem;- margin-right: 0.5rem;+ margin-inline-start: 0.5rem;+ margin-inline-end: 0.5rem;margin-top: 0.25rem;display: flex;min-width: 0;@@ -183,7 +183,7 @@}.categoryActions {- margin-left: auto;+ margin-inline-start: auto;display: flex;align-items: center;gap: 0.25rem;diff --git a/fluxer_app/src/features/app/components/layout/FloatingUnreadIndicators.module.css b/fluxer_app/src/features/app/components/layout/FloatingUnreadIndicators.module.cssindex fc530344e..4dd9e1240 100644--- a/fluxer_app/src/features/app/components/layout/FloatingUnreadIndicators.module.css+++ b/fluxer_app/src/features/app/components/layout/FloatingUnreadIndicators.module.css@@ -9,7 +9,7 @@.slot {position: absolute;- left: 0;+ inset-inline-start: 0;width: 100%;display: flex;justify-content: center;diff --git a/fluxer_app/src/features/app/components/layout/GroupedVoiceParticipant.module.css b/fluxer_app/src/features/app/components/layout/GroupedVoiceParticipant.module.cssindex 4ebc9dd54..e7ae4ab36 100644--- a/fluxer_app/src/features/app/components/layout/GroupedVoiceParticipant.module.css+++ b/fluxer_app/src/features/app/components/layout/GroupedVoiceParticipant.module.css@@ -16,7 +16,7 @@transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);transition-duration: 150ms;cursor: pointer;- text-align: left;+ text-align: start;color: var(--text-primary-muted);}@@ -88,7 +88,7 @@}.iconsAndToggle {- margin-left: auto;+ margin-inline-start: auto;display: flex;align-items: center;gap: 0.25rem;@@ -96,7 +96,7 @@.devicesContainer {margin-top: 0.125rem;- margin-left: 1rem;+ margin-inline-start: 1rem;display: flex;flex-direction: column;gap: 0.125rem;diff --git a/fluxer_app/src/features/app/components/layout/GuildHeader.module.css b/fluxer_app/src/features/app/components/layout/GuildHeader.module.cssindex 3053f1c2f..698b18187 100644--- a/fluxer_app/src/features/app/components/layout/GuildHeader.module.css+++ b/fluxer_app/src/features/app/components/layout/GuildHeader.module.css@@ -39,8 +39,8 @@.bannerClip {position: absolute;top: 0;- left: 0;- right: 0;+ inset-inline-start: 0;+ inset-inline-end: 0;overflow: hidden;pointer-events: none;}@@ -48,8 +48,8 @@.bannerImage {position: absolute;top: 0;- left: 0;- right: 0;+ inset-inline-start: 0;+ inset-inline-end: 0;background-size: cover;background-position: top center;background-repeat: no-repeat;@@ -73,8 +73,8 @@.bannerGradient {position: absolute;- left: 0;- right: 0;+ inset-inline-start: 0;+ inset-inline-end: 0;top: 0;height: 2.5rem;background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent);@@ -142,7 +142,7 @@}.caretIcon {- margin-left: auto;+ margin-inline-start: auto;height: 1rem;width: 1rem;flex-shrink: 0;@@ -168,7 +168,7 @@}.dotsIcon {- margin-left: auto;+ margin-inline-start: auto;height: 1.5rem;width: 1.5rem;flex-shrink: 0;diff --git a/fluxer_app/src/features/app/components/layout/GuildLayout.module.css b/fluxer_app/src/features/app/components/layout/GuildLayout.module.cssindex 6a2d83e92..5ca5523ee 100644--- a/fluxer_app/src/features/app/components/layout/GuildLayout.module.css+++ b/fluxer_app/src/features/app/components/layout/GuildLayout.module.css@@ -61,8 +61,8 @@display: none;position: absolute;top: 0;- right: 0;- left: 0;+ inset-inline-end: 0;+ inset-inline-start: 0;height: var(--layout-header-height);z-index: 2;}@@ -136,7 +136,7 @@.nagbarActionsDesktop {composes: nagbarActions;- margin-left: var(--spacing-3);+ margin-inline-start: var(--spacing-3);}.mobileNavbarSlot {display: contents;diff --git a/fluxer_app/src/features/app/components/layout/GuildNavbar.module.css b/fluxer_app/src/features/app/components/layout/GuildNavbar.module.cssindex 02a4ed1b1..11646ce8f 100644--- a/fluxer_app/src/features/app/components/layout/GuildNavbar.module.css+++ b/fluxer_app/src/features/app/components/layout/GuildNavbar.module.css@@ -31,7 +31,7 @@}:global(html.platform-native) .guildNavbarContainer {- border-top-left-radius: clamp(0.5rem, 1.2vw, 0.875rem);+ border-start-start-radius: clamp(0.5rem, 1.2vw, 0.875rem);background-clip: padding-box;overflow: hidden;}diff --git a/fluxer_app/src/features/app/components/layout/MobileBottomNav.module.css b/fluxer_app/src/features/app/components/layout/MobileBottomNav.module.cssindex 1a8506d09..ec1c7449f 100644--- a/fluxer_app/src/features/app/components/layout/MobileBottomNav.module.css+++ b/fluxer_app/src/features/app/components/layout/MobileBottomNav.module.css@@ -2,8 +2,8 @@.container {position: fixed;- left: 0;- right: 0;+ inset-inline-start: 0;+ inset-inline-end: 0;bottom: 0;z-index: 100;display: flex;diff --git a/fluxer_app/src/features/app/components/layout/Nagbar.module.css b/fluxer_app/src/features/app/components/layout/Nagbar.module.cssindex 21e0698de..febcff974 100644--- a/fluxer_app/src/features/app/components/layout/Nagbar.module.css+++ b/fluxer_app/src/features/app/components/layout/Nagbar.module.css@@ -5,12 +5,12 @@display: flex;align-items: center;justify-content: center;- padding-left: 0.5rem;- padding-right: 0.5rem;+ padding-inline-start: 0.5rem;+ padding-inline-end: 0.5rem;}.nagbarDismissible {- padding-right: 2.5rem;+ padding-inline-end: 2.5rem;}.nagbarDesktop {@@ -31,7 +31,7 @@.dismissButton {position: absolute;top: 50%;- right: 0.5rem;+ inset-inline-end: 0.5rem;transform: translateY(-50%);display: flex;align-items: center;diff --git a/fluxer_app/src/features/app/components/layout/NagbarContent.tsx b/fluxer_app/src/features/app/components/layout/NagbarContent.tsxindex 73c28b286..b737e3730 100644--- a/fluxer_app/src/features/app/components/layout/NagbarContent.tsx+++ b/fluxer_app/src/features/app/components/layout/NagbarContent.tsx@@ -18,7 +18,7 @@ export const NagbarContent = ({message, actions, isMobile, onDismiss}: NagbarConconst showMobileDismiss = isMobile && onDismiss;return (<div className={clsx(styles.container, isMobile && styles.containerMobile)} data-flx="app.nagbar-content.container">- <p className={styles.message} data-flx="app.nagbar-content.message">+ <p className={styles.message} dir="auto" data-flx="app.nagbar-content.message">{message}</p>{(actions || showMobileDismiss) && (diff --git a/fluxer_app/src/features/app/components/layout/NullSpaceDropIndicator.module.css b/fluxer_app/src/features/app/components/layout/NullSpaceDropIndicator.module.cssindex c04bc70f4..45628fc70 100644--- a/fluxer_app/src/features/app/components/layout/NullSpaceDropIndicator.module.css+++ b/fluxer_app/src/features/app/components/layout/NullSpaceDropIndicator.module.css@@ -4,8 +4,8 @@position: absolute;top: 0;bottom: 0;- left: 0.5rem;- right: 0.5rem;+ inset-inline-start: 0.5rem;+ inset-inline-end: 0.5rem;display: flex;align-items: center;}diff --git a/fluxer_app/src/features/app/components/layout/OutlineFrame.module.css b/fluxer_app/src/features/app/components/layout/OutlineFrame.module.cssindex 463ed4e71..55ff620a1 100644--- a/fluxer_app/src/features/app/components/layout/OutlineFrame.module.css+++ b/fluxer_app/src/features/app/components/layout/OutlineFrame.module.css@@ -6,7 +6,7 @@width: 100%;border: var(--outline-frame-border-width, 0.0625rem) solid var(--user-area-divider-color);border-top: none;- border-top-left-radius: var(--outline-radius, 0px);+ border-start-start-radius: var(--outline-radius, 0px);background: var(--background-secondary-lighter);overflow: hidden;display: flex;@@ -37,7 +37,7 @@position: absolute;top: 0;bottom: 0;- left: var(--layout-sidebar-width);+ inset-inline-start: var(--layout-sidebar-width);width: 0.0625rem;pointer-events: none;background: var(--user-area-divider-color);diff --git a/fluxer_app/src/features/app/components/layout/ScrollIndicatorOverlay.module.css b/fluxer_app/src/features/app/components/layout/ScrollIndicatorOverlay.module.cssindex b3fc05fd2..892258d74 100644--- a/fluxer_app/src/features/app/components/layout/ScrollIndicatorOverlay.module.css+++ b/fluxer_app/src/features/app/components/layout/ScrollIndicatorOverlay.module.css@@ -9,7 +9,7 @@.indicatorSlot {position: absolute;- left: 0;+ inset-inline-start: 0;width: 100%;display: flex;justify-content: center;diff --git a/fluxer_app/src/features/app/components/layout/SidebarResizeHandle.module.css b/fluxer_app/src/features/app/components/layout/SidebarResizeHandle.module.cssindex 328c8fa48..42a17f032 100644--- a/fluxer_app/src/features/app/components/layout/SidebarResizeHandle.module.css+++ b/fluxer_app/src/features/app/components/layout/SidebarResizeHandle.module.css@@ -4,9 +4,9 @@position: absolute;top: 0;bottom: var(--layout-user-area-overlay-height, var(--layout-user-area-reserved-height, 0px));- left: var(--layout-sidebar-width);+ inset-inline-start: var(--layout-sidebar-width);width: 0.375rem;- transform: translateX(-50%);+ transform: translateX(calc(-50% * var(--sidebar-resize-handle-direction, 1)));z-index: 3;cursor: col-resize;touch-action: none;@@ -16,6 +16,10 @@--sidebar-resize-handle-color: color-mix(in srgb, var(--background-secondary-lighter) 65%, var(--text-primary) 35%);}+:global(html[dir='rtl']) .handle {+ --sidebar-resize-handle-direction: -1;+}+.indicator {position: absolute;top: 0;diff --git a/fluxer_app/src/features/app/components/layout/SidebarResizeHandle.tsx b/fluxer_app/src/features/app/components/layout/SidebarResizeHandle.tsxindex 39b1a89e5..5b45a51c5 100644--- a/fluxer_app/src/features/app/components/layout/SidebarResizeHandle.tsx+++ b/fluxer_app/src/features/app/components/layout/SidebarResizeHandle.tsx@@ -25,6 +25,7 @@ const KEYBOARD_STEP_LARGE = 48;interface DragState {pointerId: number;startX: number;+ direction: 1 | -1;startWidth: number;latest: number;zoom: number;@@ -42,6 +43,10 @@ function clampWidth(value: number): number {return Math.max(SIDEBAR_WIDTH_MIN, Math.min(Math.round(value), SIDEBAR_WIDTH_MAX));}+function getGrowthDirection(ownerDocument: Document): 1 | -1 {+ return ownerDocument.documentElement.dir === 'rtl' ? -1 : 1;+}+function resolveSidebarWidth(): number {const width = SidebarWidth.width;if (width == null) return SIDEBAR_WIDTH_DEFAULT;@@ -53,7 +58,9 @@ function measureSidebarWidth(handle: HTMLElement): number {if (frame == null) return resolveSidebarWidth();const handleRect = handle.getBoundingClientRect();const frameRect = frame.getBoundingClientRect();- const measured = handleRect.left + handleRect.width / 2 - frameRect.left;+ const handleCenter = handleRect.left + handleRect.width / 2;+ const measured =+ getGrowthDirection(handle.ownerDocument) === 1 ? handleCenter - frameRect.left : frameRect.right - handleCenter;if (!Number.isFinite(measured) || measured <= 0) return resolveSidebarWidth();return clampWidth(measured / resolveZoomFactor(handle.ownerDocument));}@@ -116,6 +123,7 @@ export const SidebarResizeHandle = observer(() => {const state: DragState = {pointerId: event.pointerId,startX: event.clientX,+ direction: getGrowthDirection(ownerDocument),startWidth,latest: startWidth,zoom: resolveZoomFactor(ownerDocument),@@ -125,7 +133,9 @@ export const SidebarResizeHandle = observer(() => {const onDocumentPointerMove = (nativeEvent: PointerEvent) => {if (dragRef.current !== state || nativeEvent.pointerId !== state.pointerId) return;nativeEvent.preventDefault();- const next = clampWidth(state.startWidth + (nativeEvent.clientX - state.startX) / state.zoom);+ const next = clampWidth(+ state.startWidth + (state.direction * (nativeEvent.clientX - state.startX)) / state.zoom,+ );state.latest = next;SidebarWidth.setWidth(next, false);setAriaValueNow(next);@@ -198,13 +208,14 @@ export const SidebarResizeHandle = observer(() => {const handle = event.currentTarget;const step = event.shiftKey ? KEYBOARD_STEP_LARGE : KEYBOARD_STEP;const base = resolveCurrentSidebarWidth(handle);+ const growth = step * getGrowthDirection(handle.ownerDocument);let next: number;switch (event.key) {case 'ArrowLeft':- next = base - step;+ next = base - growth;break;case 'ArrowRight':- next = base + step;+ next = base + growth;break;case 'Home':next = SIDEBAR_WIDTH_MIN;diff --git a/fluxer_app/src/features/app/components/layout/UserArea.module.css b/fluxer_app/src/features/app/components/layout/UserArea.module.cssindex 9694961ec..729f1d264 100644--- a/fluxer_app/src/features/app/components/layout/UserArea.module.css+++ b/fluxer_app/src/features/app/components/layout/UserArea.module.css@@ -146,8 +146,8 @@transform: translate3d(0, 107%, 0);position: absolute;top: 0;- left: 0;- right: 0;+ inset-inline-start: 0;+ inset-inline-end: 0;}.forceHover .defaultState {@@ -198,7 +198,7 @@align-items: center;gap: var(--spacing-1);flex-shrink: 0;- padding-left: var(--spacing-3);+ padding-inline-start: var(--spacing-3);}.controlButton {diff --git a/fluxer_app/src/features/app/components/layout/VoiceChannelUserCount.module.css b/fluxer_app/src/features/app/components/layout/VoiceChannelUserCount.module.cssindex 58cd25816..f97978960 100644--- a/fluxer_app/src/features/app/components/layout/VoiceChannelUserCount.module.css+++ b/fluxer_app/src/features/app/components/layout/VoiceChannelUserCount.module.css@@ -16,7 +16,7 @@height: 1rem;justify-content: center;line-height: 0.875rem;- margin-right: -0.25rem;+ margin-inline-end: -0.25rem;overflow: hidden;}@@ -36,7 +36,8 @@box-sizing: border-box;display: block;font-variant-numeric: tabular-nums;- padding: 0 0.25rem 0 0.125rem;+ padding-block: 0;+ padding-inline: 0.125rem 0.25rem;position: relative;text-align: center;width: 1.25rem;@@ -44,12 +45,12 @@.total::after {border-bottom: 0 solid transparent;- border-right: 0.3125rem solid transparent;- border-right-color: var(--background-modifier-selected);+ border-inline-end: 0.3125rem solid transparent;+ border-inline-end-color: var(--background-modifier-selected);border-top: 1rem solid transparent;content: '';height: 0;- left: -0.3125rem;+ inset-inline-start: -0.3125rem;position: absolute;top: 0;width: 0;diff --git a/fluxer_app/src/features/app/components/layout/VoiceParticipantItem.module.css b/fluxer_app/src/features/app/components/layout/VoiceParticipantItem.module.cssindex f6475da74..9dda5005b 100644--- a/fluxer_app/src/features/app/components/layout/VoiceParticipantItem.module.css+++ b/fluxer_app/src/features/app/components/layout/VoiceParticipantItem.module.css@@ -88,7 +88,7 @@}.iconsContainer {- margin-left: auto;+ margin-inline-start: auto;display: flex;align-items: center;gap: 0.25rem;diff --git a/fluxer_app/src/features/app/components/layout/VoiceParticipantsList.module.css b/fluxer_app/src/features/app/components/layout/VoiceParticipantsList.module.cssindex ddbf19a63..14a65c449 100644--- a/fluxer_app/src/features/app/components/layout/VoiceParticipantsList.module.css+++ b/fluxer_app/src/features/app/components/layout/VoiceParticipantsList.module.css@@ -2,7 +2,7 @@.container {margin-top: 0.25rem;- margin-left: 1.5rem;+ margin-inline-start: 1.5rem;display: flex;flex-direction: column;gap: 0.125rem;diff --git a/fluxer_app/src/features/app/components/layout/app_layout/nagbars/DesktopDownloadNagbar.module.css b/fluxer_app/src/features/app/components/layout/app_layout/nagbars/DesktopDownloadNagbar.module.cssindex 13e2f8d43..41f64e217 100644--- a/fluxer_app/src/features/app/components/layout/app_layout/nagbars/DesktopDownloadNagbar.module.css+++ b/fluxer_app/src/features/app/components/layout/app_layout/nagbars/DesktopDownloadNagbar.module.css@@ -4,7 +4,7 @@display: flex;align-items: center;gap: var(--spacing-1);- margin-right: var(--spacing-2);+ margin-inline-end: var(--spacing-2);}.platformIcon {diff --git a/fluxer_app/src/features/app/components/layout/sidebar_nav/GuildFolderItem.module.css b/fluxer_app/src/features/app/components/layout/sidebar_nav/GuildFolderItem.module.cssindex b696a3c69..5007cb848 100644--- a/fluxer_app/src/features/app/components/layout/sidebar_nav/GuildFolderItem.module.css+++ b/fluxer_app/src/features/app/components/layout/sidebar_nav/GuildFolderItem.module.css@@ -129,7 +129,7 @@.folderBadge {position: absolute;- right: -0.25rem;+ inset-inline-end: -0.25rem;bottom: -0.25rem;z-index: 2;pointer-events: auto;