# 移动设备上仍然需要取消自动边距吗？

**URL:** https://meta.discourse.org/t/do-auto-margins-still-need-to-be-unset-on-mobile/351503
**Category:** UX
**Created:** [2025年二月10日 17:45 UTC](https://meta.discourse.org/t/do-auto-margins-still-need-to-be-unset-on-mobile/351503 "2025-02-10T17:45:41Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [2025年二月10日 17:45 UTC](https://meta.discourse.org/t/do-auto-margins-still-need-to-be-unset-on-mobile/351503/1 "2025-02-10T17:45:41Z")

</div>

在移动设备上，`main-outlet` 包装器的自动边距在此处被取消设置：

> <https://github.com/discourse/discourse/blob/1d8cdfd5e05f936e8c21ac6e26272cbbfa5d96a4/app/assets/stylesheets/mobile/discourse.scss#L119-L121>

这会导致当主题上声明了 `-d-max-width` 时，布局会左对齐。在较窄的设备上看不到这个问题，但在平板电脑横屏模式下会是一个问题，例如在此处使用 Air 主题时：

 ![The image is a screenshot of a Discourse forum page displaying a welcome message and a list of community posts. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/b/4/5/b45a65d97d6cf55f85fb73531174076d0e7007a9.png)

我看到该声明是由于 [FIX: auto margins cause too-narrow content by awesomerobot · Pull Request #16725 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/16725) 添加的。

我现在通常在主题列表中看不到这个问题，也许可以删除该声明？或者，如果存在一些特定情况，是否可以为其分配一个断点？

---

_[View the full topic](https://meta.discourse.org/t/do-auto-margins-still-need-to-be-unset-on-mobile/351503)._
