Skip to content

Commit

Permalink
Cleanup; make the honey_badger work in my test app
Browse files Browse the repository at this point in the history
  - Cleaning up SASS a bit, turning 3 lines of code into one
  - Adding note to the README to show how to get the styles working
  • Loading branch information
Jamie Kite committed Jun 24, 2011
1 parent 1c44b0e commit c655621
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
6 changes: 6 additions & 0 deletions README.markdown
Expand Up @@ -7,6 +7,12 @@ Get a nice, clean badge displaying your Rails Environment or other helpful info.
In your application view somewhere, just render the honey_badger helper:

= honey_badger

In your stylesheet (using Rails 3.1 sprockets awesomeness):

/*
*= require honey_badger
*/

# Authors

Expand Down
20 changes: 10 additions & 10 deletions app/assets/stylesheets/honey_badger.css.scss
@@ -1,5 +1,5 @@
@mixin corner-banner($color: #333) {
&#corner-banner {
&.corner-banner.honey-badger {
position: absolute;
left: -55px;
top: 30px;
Expand All @@ -11,7 +11,7 @@
text-align:center;
font-size:11px;
line-height:13px;
padding:3px 3px 4px 3px;
padding:4px 3px 4px 3px;
text-shadow: darken($color, 20) 1px 1px 0;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
Expand All @@ -20,20 +20,20 @@
-moz-box-shadow: rgba(0,0,0, 0.2) 0px 0px 6px;
-webkit-box-shadow: rgba(0,0,0, 0.2) 0px 0px 6px;
z-index: 1000;
}
&#corner-banner a:link,
&#corner-banner a:visited {color:#FFF0B7;text-decoration: none;}
&#corner-banner a:hover,
&#corner-banner a:focus {color:#FFF;text-decoration: none;}
&#corner-banner {
letter-spacing:1px;
font-style:normal;
font-size:8px !important;
color:#fff;
text-transform:uppercase;
line-height:12px;
display:block;
}
font-family: Arial;

a:link,
a:visited {color:#FFF0B7;text-decoration: none;}
a:hover,
a:focus {color:#FFF;text-decoration: none;}
}
}

.development { @include corner-banner(#933720) }
.development { @include corner-banner(#933720) }
6 changes: 2 additions & 4 deletions app/helpers/honey_badger/application_helper.rb
@@ -1,10 +1,8 @@
module HoneyBadger
module ApplicationHelper
def honey_badger
content_tag :div, :id => "corner-banner", :class => "corner-banner honey-badger #{Rails.env}" do
out = ""
out << Rails.env
out.html_safe
content_tag :div, :class => "corner-banner honey-badger #{Rails.env}" do
Rails.env.html_safe
end
end
end
Expand Down

0 comments on commit c655621

Please sign in to comment.