How do I make the width responsive?


#1

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%.


(Daniela) #2

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


#3

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?


(Daniela) #4

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.


#5

ok - thank you - will do


(Rafael dos Santos Silva) #6

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:


#7

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:


#8

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:


(Rafael dos Santos Silva) #9

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)


#10

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!


[Hiring] Help edit basic theme to be responsive for wide width