I''d like to avoid the need for separate screen and print layouts, I''d rather use different stylesheets to style the views appropriately. What bothers me a bit is that stylesheet_link_tag insists on making stylesheets specific to screen media. Now, I''m fully able to write the required tag by hand, but that would be contrary to the otherwise good use of asset_tags. How are others handling this? Michael -- Michael Schuerig Nothing is as brilliantly adaptive mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org as selective stupidity. http://www.schuerig.de/michael/ --A.O. Rorty, The Deceptive Self
This changeset http://dev.rubyonrails.com/changeset/1281 says that you can pass an options hash specifying the media. Joshua Sierles On 7/25/05, Michael Schuerig <michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote:> > > I''d like to avoid the need for separate screen and print layouts, I''d > rather use different stylesheets to style the views appropriately. What > bothers me a bit is that stylesheet_link_tag insists on making > stylesheets specific to screen media. > > Now, I''m fully able to write the required tag by hand, but that would be > contrary to the otherwise good use of asset_tags. How are others > handling this? > > Michael > > -- > Michael Schuerig Nothing is as brilliantly adaptive > mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org as selective stupidity. > http://www.schuerig.de/michael/ --A.O. Rorty, The Deceptive Self > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Monday 25 July 2005 14:06, Joshua Sierles wrote:> This changeset > > http://dev.rubyonrails.com/changeset/1281 > > says that you can pass an options hash specifying the media.Thanks, I missed that changed. Michael -- Michael Schuerig Most people would rather die than think. mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org In fact, they do. http://www.schuerig.de/michael/ --Bertrand Russell
Joshua Sierles wrote:> This changeset > http://dev.rubyonrails.com/changeset/1281 > says that you can pass an options hash specifying the media.I would be interested to extend this further in order to cope with backwards compatibility with older browsers. For example, as preached by the mighty Jeffrey Zeldman (and seen in action on www.zeldman.com) I always make use of @import, in order to hand my full CSS2 layouts only to browsers that support it, while giving browsers that don''t support @import (eg. Netscape 4) a basic appearance-only stylesheet without CSS2 layout. As I''ve only recently moved to Rails, I haven''t needed to do this yet (I tend to separate my stylesheets at the end), but the project I''m working on will require this functionality by the time it goes live. I''m sure it would be easy to extend the options hash - can anyone think of a reason not to do this? Would anybody else also make use of such functionality? On the other hand, I could just change the way I use stylesheets, and put the @import inside the basic stylesheet to bring in the CSS2, which wouldn''t require any changes to the Rails side of things. Perhaps others are already adopting this approach? As far as I can tell without a great deal of pondering on the subject, it shouldn''t really affect browser compatibility, although I''m not 100% certain as I haven''t tested it myself. CSS guru Eric Meyer (www.meyerweb.com) seems to use this approach, so it''s probably a fairly safe bet to do it. Thoughts, anyone? What approach do you use? I think it''s generally a good thing to maintain content accessibility (just without the pretty layout) for any and all older browsers, since it''s really not difficult to do if you separate your CSS in this way. Cheers, ~Dave -- Dave Silvester Rent-A-Monkey Website Development Web: http://www.rentamonkey.com/
I prefer to use JZ''s approach. It should certainly be possible to extend rails to allow this. I''m not sold on not linking the CSS directly in the markup, though, so I''ve yet to use rails for this purpose. On Jul 25, 2005, at 9:25 AM, Dave Silvester wrote:> Joshua Sierles wrote: > >> This changeset >> http://dev.rubyonrails.com/changeset/1281 >> says that you can pass an options hash specifying the media. >> > > I would be interested to extend this further in order to cope with > backwards compatibility with older browsers. For example, as > preached by the mighty Jeffrey Zeldman (and seen in action on > www.zeldman.com) I always make use of @import, in order to hand my > full CSS2 layouts only to browsers that support it, while giving > browsers that don''t support @import (eg. Netscape 4) a basic > appearance-only stylesheet without CSS2 layout. > > As I''ve only recently moved to Rails, I haven''t needed to do this > yet (I tend to separate my stylesheets at the end), but the project > I''m working on will require this functionality by the time it goes > live. I''m sure it would be easy to extend the options hash - can > anyone think of a reason not to do this? > > Would anybody else also make use of such functionality? > > On the other hand, I could just change the way I use stylesheets, > and put the @import inside the basic stylesheet to bring in the > CSS2, which wouldn''t require any changes to the Rails side of > things. Perhaps others are already adopting this approach? > > As far as I can tell without a great deal of pondering on the > subject, it shouldn''t really affect browser compatibility, although > I''m not 100% certain as I haven''t tested it myself. CSS guru Eric > Meyer (www.meyerweb.com) seems to use this approach, so it''s > probably a fairly safe bet to do it. > > Thoughts, anyone? What approach do you use? I think it''s > generally a good thing to maintain content accessibility (just > without the pretty layout) for any and all older browsers, since > it''s really not difficult to do if you separate your CSS in this way. > > Cheers, > > ~Dave > > -- > > Dave Silvester > Rent-A-Monkey Website Development > Web: http://www.rentamonkey.com/ > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >