[css-d] Can media values be used as a part of a selector ?
Finding myself writing (this morning) : style type=text/css media=print BODY {font-family: Arial Narrow, sans-serif} /style style type=text/css media=screen BODY {font-family: Trebuchet MS, sans-serif} /style I felt the urge to want to simplify it, along the lines of style type=text/css BODY::media:print {font-family: Arial Narrow, sans-serif} BODY::media:screen {font-family: Trebuchet MS, sans-serif} /style but could find nothing in the spec's to suggest that such simplification is possible. Is anyone aware of any technique that could be used in circumstances such as this ? Philip Taylor __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Can media values be used as a part of a selector ?
On 7/04/2010, at 10:11 PM, Philip TAYLOR wrote: Finding myself writing (this morning) : style type=text/css media=print BODY {font-family: Arial Narrow, sans-serif} /style style type=text/css media=screen BODY {font-family: Trebuchet MS, sans-serif} /style I felt the urge to want to simplify it, along the lines of style type=text/css BODY::media:print {font-family: Arial Narrow, sans-serif} BODY::media:screen {font-family: Trebuchet MS, sans-serif} /style You can handle this as follows: @media print { body { font-family: Arial Narrow, sans-serif ; } } @media screen { body {font-family: Trebuchet MS, sans-serif; } } Cheers, Tim __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Can media values be used as a part of a selector ?
Tim Snadden wrote: You can handle this as follows: @media print { body { font-family: Arial Narrow, sans-serif ; } } @media screen { body {font-family: Trebuchet MS, sans-serif; } } Thank you, Tim. I assume that the @media constructs appear within a style element; is that correct ? ** Phil. __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Can media values be used as a part of a selector ?
On 7/04/2010, at 10:26 PM, Philip TAYLOR wrote: Tim Snadden wrote: You can handle this as follows: @media print { body { font-family: Arial Narrow, sans-serif ; } } @media screen { body {font-family: Trebuchet MS, sans-serif; } } Thank you, Tim. I assume that the @media constructs appear within a style element; is that correct ? They can appear in style elements or in external stylesheets. Also, you aren't limited to one ruleset. __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Can media values be used as a part of a selector ?
Tim Snadden wrote: They can appear instyle elements or in external stylesheets. Also, you aren't limited to one ruleset. Excellent, many thanks for the clarification. Already deployed, tested and in use :-) ** Phil. __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/