From f48a4c8ccc0a159c274e094496c4170b88c5236f Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Sat, 30 Aug 2014 14:53:24 -0400 Subject: [PATCH] Dice: move from inline CSS. --- lib/DDG/Goodie/Dice.pm | 4 ++-- share/goodie/dice/dice.css | 8 ++++++++ t/Dice.t | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 share/goodie/dice/dice.css diff --git a/lib/DDG/Goodie/Dice.pm b/lib/DDG/Goodie/Dice.pm index eba22fad2..910978318 100644 --- a/lib/DDG/Goodie/Dice.pm +++ b/lib/DDG/Goodie/Dice.pm @@ -96,8 +96,8 @@ handle remainder_lc => sub { } $total += $sum; # track total of all rolls $out .= join(', ', @output) . '
'; - $html .= '' . join(' ', @output).'' - .''." = ". $sum.'
'; + $html .= '' . join(' ', @output).'' + .''." = ". $sum.'
'; } elsif ($_ =~ /^(\d*)[d|w](\d+)\s?([+-])?\s?(\d+|[lh])?$/) { # ex. '2d8', '2w6 - l', '3d4 + 4', '3d4-l' diff --git a/share/goodie/dice/dice.css b/share/goodie/dice/dice.css new file mode 100644 index 000000000..6230d2399 --- /dev/null +++ b/share/goodie/dice/dice.css @@ -0,0 +1,8 @@ +.zci--answer .zci--dice-die { + font-size: 2em; +} + +.zci--answer .zci--dice-sum { + font-size: 2em; + white-space: nowrap; +} diff --git a/t/Dice.t b/t/Dice.t index aff506dbb..40926770d 100644 --- a/t/Dice.t +++ b/t/Dice.t @@ -117,7 +117,7 @@ ddg_goodie_test( # Check the HTML. Just once for a longhand query. "throw die" => test_zci(qr/^.$/, - html => qr/.<\/span> = \d+<\/span><\/br>/, + html => qr/.<\/span> = \d+<\/span><\/br>/, heading => $heading ),