Example #1
0
 def test_stylesheet_link_tag(self):
     eq_(
         literal(u'<link href="/dir/file.css" media="all" rel="stylesheet" type="text/css" />'),
         stylesheet_link('/dir/file.css', media='all'))
     eq_(
         '<link href="style.css" media="all" rel="stylesheet" type="text/css" />',
         stylesheet_link('style.css', media='all'))
     eq_(
         '<link href="/random.styles" media="screen" rel="stylesheet" type="text/css" />\n<link href="/css/stylish.css" media="screen" rel="stylesheet" type="text/css" />',
         stylesheet_link('/random.styles', '/css/stylish.css'))
Example #2
0
def css( *args ):
    """
    Take a list of stylesheet names (no extension) and return appropriate string
    of link tags.

    Cache-bust with time that server started running on
    """
    return "\n".join( [ stylesheet_link( url_for( "/static/style/%s.css?v=%s" % (name, server_starttime) ) ) for name in args ] )