# Discourse Custom Width

**URL:** https://meta.discourse.org/t/discourse-custom-width/256171
**Category:** Theme component
**Created:** [February 24, 2023, 3:03pm UTC](https://meta.discourse.org/t/discourse-custom-width/256171 "2023-02-24T15:03:36Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [February 24, 2023, 3:03pm UTC](https://meta.discourse.org/t/discourse-custom-width/256171/1 "2023-02-24T15:03:36Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **Summary** | Set a custom width for your Discourse forum |
| 👓 | **Preview** | [Theme Creator](https://discourse.theme-creator.io/theme/Canapin/custom-discourse-width) (1400px width) |
| 🛠 | **Repository** | [GitHub - Canapin/Discourse-custom-width: Set a custom width for your Discourse site. · GitHub](https://github.com/Canapin/Discourse-custom-width) |
| ❓ | **Install Guide** | [How to install a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682) |
| 📖 | **New to Discourse Themes?** | [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

Install this theme component

This very simple theme component has a single setting that defines your forum’s width.

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/0/b/40b2d0718d78eb9f957bf202685b515aba61d35f.png)

The width can’t exceed your window’s width or be less than the default Discourse’s max width of 1110px.

Example width a 1400px width:

 ![](https://global.discourse-cdn.com/meta/original/4X/b/a/e/baec1b635dc89a1be22e636712f05b12dafe096b.png)

---

<div class="post-metadata">

### Author: ![daemon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daemon/32/256632_2.png) [@daemon](https://meta.discourse.org/u/daemon)
#### Post date: [February 24, 2023, 3:17pm UTC](https://meta.discourse.org/t/discourse-custom-width/256171/2 "2023-02-24T15:17:40Z")

</div>

Hi!

Why only fixed width with px?

I have this in my css:

```css
:root {
	--d-max-width: 80%;
}

.topic-body {
	width: 90%;
}

#reply-control {
    max-width: 80%;
}

.body-page {
    width: 100%;
    max-width: 100%;
}

```

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [February 24, 2023, 3:34pm UTC](https://meta.discourse.org/t/discourse-custom-width/256171/3 "2023-02-24T15:34:07Z")

</div>

This is a good idea to allow other units, but in this case, I wouldn’t know how to prevent users from setting a value too low that would break the layout.

I’m open to any ideas and PR 🙂

---

<div class="post-metadata">

### Author: ![twofoursixeight](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/twofoursixeight/32/574822_2.png) [@twofoursixeight](https://meta.discourse.org/u/twofoursixeight)
#### Post date: [February 24, 2023, 3:56pm UTC](https://meta.discourse.org/t/discourse-custom-width/256171/4 "2023-02-24T15:56:57Z")

</div>

Is this theme component related in any shape or form to the light full-width theme?

---

<div class="post-metadata">

### Author: ![daemon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daemon/32/256632_2.png) [@daemon](https://meta.discourse.org/u/daemon)
#### Post date: [February 24, 2023, 4:08pm UTC](https://meta.discourse.org/t/discourse-custom-width/256171/5 "2023-02-24T16:08:18Z")

</div>

> [@Canapin](#):
>
> This is a good idea to allow other units, but in this case, I wouldn’t know how to prevent users from setting a value too low that would break the layout.

That’s really good question but I think you have trust the users.

I would seperate the value from the unit and make a “if-else query” inside the css if they use px or % and then a second if inside to check the value if it’s to small.

```plaintext
if px
   if value < 1100px
     set value 1100
   else 
     set value to variable
else if %
   if value < 50 %
     set value 50%
   else 
     set value to variable

```

I’m honest that I don’t know atm if this is possible in a css file.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [February 24, 2023, 4:19pm UTC](https://meta.discourse.org/t/discourse-custom-width/256171/6 "2023-02-24T16:19:33Z")

</div>

It isn’t. Do you have a link to this theme? I couldn’t find it 🤔

---

<div class="post-metadata">

### Author: ![daemon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daemon/32/256632_2.png) [@daemon](https://meta.discourse.org/u/daemon)
#### Post date: [February 24, 2023, 4:49pm UTC](https://meta.discourse.org/t/discourse-custom-width/256171/7 "2023-02-24T16:49:49Z")

</div>

I would love to have “light full-width”, too.

Can please someone from the [@team](https://meta.discourse.org/groups/team) release the css for it?

---

<div class="post-metadata">

### Author: ![twofoursixeight](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/twofoursixeight/32/574822_2.png) [@twofoursixeight](https://meta.discourse.org/u/twofoursixeight)
#### Post date: [February 24, 2023, 5:05pm UTC](https://meta.discourse.org/t/discourse-custom-width/256171/8 "2023-02-24T17:05:38Z")

</div>

Can’t find it either, I think this theme is exclusive to this forum.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [February 24, 2023, 9:41pm UTC](https://meta.discourse.org/t/discourse-custom-width/256171/9 "2023-02-24T21:41:41Z")

</div>

I saw the theme you’re talking about. Yes, it looks like each other and I could also add a setting to set the width of the content as well.

To make the theme component more unique, I could set the fields in the user’s settings so everyone could have their own preferred width.

---

<div class="post-metadata">

### Author: ![Nick\_Tomlinson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nick_tomlinson/32/282728_2.png) [@Nick\_Tomlinson](https://meta.discourse.org/u/Nick_Tomlinson)
#### Post date: [February 25, 2023, 4:40pm UTC](https://meta.discourse.org/t/discourse-custom-width/256171/10 "2023-02-25T16:40:30Z")

</div>

I’ve been looking for that answer myself!

@sam @Falco any idea where we can find info on how to do the light and dark full-width theme? 😇

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [February 25, 2023, 9:03pm UTC](https://meta.discourse.org/t/discourse-custom-width/256171/11 "2023-02-25T21:03:19Z")

</div>

I think here is the full width theme repo: [GitHub - discourse/discourse-full-width-component: Make Discourse occupy the full browser width · GitHub](https://github.com/discourse/discourse-full-width-component)

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [March 18, 2023, 5:15pm UTC](https://meta.discourse.org/t/discourse-custom-width/256171/13 "2023-03-18T17:15:36Z")

</div>

Found the same issue in the Op post in Multilingual plugin links seem broken.
