How do I make the width responsive?

How can I adjust the width of Discourse so it is responsive and uses the full width on a wide screen monitor? I do not necessarily need a completely new theme; rather I simply want the equivalent of setting CSS width to 100%.

In this case you should use media query. You can see the CSS on this topic as example "That page doesn't exist or is private" restyling with CSS

Thanks for the reply

I apologize if this is very basic - is there a source somewhere with basic CSS examples?

In this case the CSS below is apparently invalid - where and how would I set max-width to be 100% for the whole site?

The CSS is invalid because there is no target for your rule.

What you can do is search this site and see what other users have changed before you. However, what you want to do is not so simple.

You can try to learn the basics of css through some site like CSS Tutorial or you can hire someone by writing a new topic on #marketplace describing well the result you want to achieve.

6 Likes

ok - thank you - will do

Just be aware that using full width on desktops is a bad idea:

https://baymard.com/blog/line-length-readability

Here is how it looks on a 4k Monitor:

6 Likes

Thanks Rafael.

In general, I agree with you.

But it depends on the content.

My workstation has six 4K monitors - which are very helpful for immediate access to details as I read/write, if the information is organized in a readable way. For example, when scrolling through a large set of academic abstracts, it can be more efficient to use the whole screen and thus increase the amount of usable information displayed.

My current project will be to use Discourse to discuss information of this nature. While it may be that not everyone will want to do so in 4K format, it is nice if the software can adapt and show the same information in varying window widths that respond to the reader’s preference.

For example, this is the same information shown in two varying window sizes with responsive software:

That said, can I ask how you adjusted Discourse to show content so wide?

RIght now if I enlarge a window to full size this is all I get:

You can force a full responsive mode by setting your User Agent to a mobile one. I did it using the responsive tools in Firefox Devtools, but any user agent changer will work.

You can also append a query string like https://meta.discourse.org/?mobile_view=1 (Open this in a new tab)

4 Likes

Ahah!

Stupendous - huge thanks

I see that I can also set the responsive mode on or off with /?mobile_view=1 vs /?mobile_view=0 so I can implement that into the menus on my site and give users different options or I can force responsive view on only for sections I know will benefit from it

Huge thanks!

4 Likes

One issue with the mobile view is that it also simplifies other elements, e.g. now you have to open the dropdown to access the categories link, and you cannot make the reply form bigger, and it has no live preview.

But other than that seems good enough for someone who really needs it for some reason. :grinning:

I also saw a suggestion to set max-width (e.g. 100%) for .wrap in an old topic How to make my forum view wider? but apparently it doesn’t work anymore, it just moves the messages to the left while keeping the same size.

It’s not about the resolution though, it’s about the screen size (e.g. there are 4K 15" laptops, you have to use scaling to make them usable).