Change the layout width

AI-generated summary

In the ‘UX’ category, DanteZii asked how to change the Discourse layout width to match a specific example, gamekult.com. dax initially suggested modifying the .topic-body CSS width, but warned that increasing the width requires adjusting other elements like avatars and the timeline, as well as implementing media queries.

DanteZii clarified that the target site uses a custom layout that doesn’t rely solely on the default .topic-body setting, and applying simple width changes would cause display issues. jomaxro sought clarification on this confusion. Ultimately, dax reiterated that simply changing the width is insufficient for a full layout change and advised DanteZii to inspect the target site’s custom CSS file (desktop_theme_12) to extract and modify the specific elements needed. This approach requires basic CSS knowledge to ensure all parts of the page layout are updated correctly.

I want to ask a question how can I change the layout width like this?


1 Mi Piace

You want to play with this CSS setting

.topic-body {
   width: 690px    /* this is the default setting */  
}

but keep in mind that too much width means that you need to replace the other elements too (avatar and the timeline).

PS: and don’t forget the media queries.

7 Mi Piace

thank you very much
but he did not use this code to adjust the layout

Who didn’t use the code?

sorry

I mean this website page Charts USA : le carton de la Switch et des AAA - Forum Jeux vidéo - Gamekult did not use this code to change the layout width,

if i use “.topic-body {
width: 690px /* this is the default setting */
}” change the width

the page will be a lot of problems。

Sure looks like the linked website changed the width?

yes i sure

@DanteZii, I’m sorry but I’m not understanding your issue. In post #1 you asked how to increase the topic view width, and @Trash provided you with a solution. You then posted saying that someone didn’t use the code, and I shared a screenshot of the site you linked to using the code.

What exactly are you looking for here? Please be specific.

1 Mi Piace

It’s exactly what I say

Timeline and avatar are the first elements you need to change, but not the only. You have a lot of work to do, because you want change the page layout (not only the width).

You can start to built your theme looking to the custom CSS of that site (https://cdn-enterprise.discourse.org/gamekult_forum/forum/stylesheets/desktop_theme_12_e3e6e0b694355d9994bc15c0d1188da7aa47eed5.css?__ws=www.gamekult.com) and extract the elements you want to change.

All you need is a basic CSS knowledge.