Skip to content

Commit

Permalink
fixed stylesheet helper not to enforce a media attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 14, 2013
1 parent ea6fe49 commit 48aca03
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,7 +1,8 @@

4.38 2013-09-14
4.38 2013-09-15
- Added is_binary method to Mojo::Loader.
- Fixed support for binary files in inflate command.
- Fixed stylesheet helper not to enforce a media attribute.

4.37 2013-09-13
- Improved design of built-in templates.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Plugin/TagHelpers.pm
Expand Up @@ -178,7 +178,7 @@ sub _stylesheet {
# "link" or "style" tag
my $href = @_ % 2 ? $self->url_for(shift) : undef;
return $href
? _tag('link', rel => 'stylesheet', href => $href, media => 'screen', @_)
? _tag('link', rel => 'stylesheet', href => $href, @_)
: _tag('style', @_, $cb);
}

Expand Down Expand Up @@ -570,7 +570,7 @@ automatically get picked up and shown as default.
Generate portable style or link tag for C<CSS> asset.
<link href="/path/to/foo.css" media="screen" rel="stylesheet" />
<link href="/path/to/foo.css" rel="stylesheet" />
<style><![CDATA[
body {color: #000}
]]></style>
Expand Down
4 changes: 2 additions & 2 deletions t/mojolicious/rebased_lite_app.t
Expand Up @@ -47,7 +47,7 @@ $t->get_ok('/')->status_is(200)->header_is('X-Route' => 'root')
http://example.com/rebased/
<script src="/rebased/mojo/jquery/jquery.js"></script>
<img src="/rebased/images/test.png" />
<link href="//example.com/base.css" media="screen" rel="stylesheet" />
<link href="//example.com/base.css" rel="stylesheet" />
<a href="mailto:sri@example.com">Contact</a>
http://example.com/rebased
http://example.com/rebased/foo
Expand Down Expand Up @@ -95,7 +95,7 @@ $t->get_ok('/baz')->status_is(200)->header_is('X-Route' => 'baz')
http://example.com/rebased/
<script src="/rebased/mojo/jquery/jquery.js"></script>
<img src="/rebased/images/test.png" />
<link href="//example.com/base.css" media="screen" rel="stylesheet" />
<link href="//example.com/base.css" rel="stylesheet" />
<a href="mailto:sri@example.com">Contact</a>
http://example.com/rebased/baz
http://example.com/rebased/foo
Expand Down
2 changes: 1 addition & 1 deletion t/mojolicious/tag_helper_lite_app.t
Expand Up @@ -99,7 +99,7 @@ EOF

# Stylesheets
$t->get_ok('/style')->status_is(200)->content_is(<<EOF);
<link href="/foo.css" media="screen" rel="stylesheet" />
<link href="/foo.css" rel="stylesheet" />
<style>/*<![CDATA[*/
body {color: #000}
Expand Down

0 comments on commit 48aca03

Please sign in to comment.