File: sprites.pl

package info (click to toggle)
libmojolicious-plugin-assetpack-perl 2.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,888 kB
  • sloc: perl: 1,503; javascript: 52; makefile: 8; sh: 2
file content (27 lines) | stat: -rw-r--r-- 595 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!perl
use lib "lib";
use Mojolicious::Lite;
app->static->paths([Cwd::abs_path("t/public")]);

plugin "AssetPack";
app->asset("my-sprites.css" => "sprites:///images/xyz", "/test.css");

get "/" => "index";
app->start;

__DATA__
@@ test.css
.xyz { background-color: #f00; }
@@ index.html.ep
<html>
  <head>
    <title>Sprites</title>
    %= asset "my-sprites.css"
  </head>
  <body>
    <a href="https://css-tricks.com/css-sprites/">CSS sprites</a>
    <span class="xyz social-github"></span>
    <span class="xyz social-rss"></span>
    <span class="xyz social-chrome"></span>
  </body>
</html>