Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

stylesheet_link_tag media default

#5123

the default value for the media type in stylesheet_link_tag includes is 'screen'. It seems that there is no way to configure this option, and that leads to a lot of rails apps online being completely devoid of stylesheets in printing and other media. Should the default include printing? If not, shouldn't you be able to config the default in the environment?

Reported by tgrayson · July 15th, 2010 @ 03:27 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Marjan Krekoten'
    Marjan Krekoten'

    Did you try :media option?

    stylesheet_link_tag "style", :media => "print"
    

    September 16th, 2010 @ 01:49 PM

  2. Lake
    Lake

    I agree with Marjan. You can pass the "media" option to set it to print.

    September 16th, 2010 @ 11:11 PM

  3. Lake
  4. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to invalid
    • Importance changed from to Low

    September 17th, 2010 @ 01:50 AM

  5. tgrayson
    tgrayson

    I wholly understand what you guys are saying, and I entirely agree with you. If I want to add a print only style sheet to MY website, I can use the :media => "print". I do, that's good. What I'm claiming is an issue, is that other people don't know this, or expect this. Since :media isn't set to ALL by default, the entire community is afflicted with bad experiences in non desktop media by default. For example. Look on http://rubyonrails.org/ in the "Who is already on rails?" section. The poster children of rails. Print any of those sites, aside from Yellowpages. Shopify, Groupon, github, twitter, basecamp all fall apart if you try to print them.

    Now, I know I can't prove what their code is without looking at it, but I've noticed this across many other rails sites. I'd wager to say that all 5 of these websites didn't intentionally set their media to screen intentionally, ensuring that printing their webpages would be unstyled procedural HTML. They are probably just doing a standard include, which specifies screen, instead of all, so: printing, projection, and the rest of the lot are not considered.

    Does this make more sense?

    I think by default, people would like to have their prints look like their webpage, rather than be unstyled.

    September 17th, 2010 @ 03:57 PM