The request will not contain data on the screen size, therefore, in general, sulfur has no way to find out what the screen width is and what answer to serve, as PinnyM mentioned in the comment.
A common practice is to use the User Agent to discover a mobile device from the server. The user agent is part of the request. This is not 100% accurate, but in most cases it may depend.
However, there are still solutions for your question - serve the page based on screen size.
The workaround is to use Javascript to determine the screen size first, and then use JS to delete the cookie. The server can read the cookie and decide which template to display.
The main repo is here: https://github.com/mattstauffer/Simple-RESS This is for PHP, but you can get this idea from the source code.
There is also an implementation of Rails: https://github.com/matthewrobertson/ress and an introduction: http://matthewrobertson.org/blog/2013/02/15/introducing-ress/
My opinion: I do not like this solution, although it is viable. A lot of work to be done, and a lot of things to take care of. Instead, I would prefer to discover the User User Agent.
source share