imathis / fancy-buttons

Fancy CSS Buttons using Compass
http://brandonmathis.com/projects/fancy-buttons/
819 stars 55 forks source link

On an existing rails project, how do we get started? #1

Closed davidchua closed 14 years ago

davidchua commented 14 years ago

Do I need to install fancy-buttons, compass and then create a compass project ontop of my rails directory?

Having not used sass before, this is pretty new to me.

imathis commented 14 years ago

As far as gems go, you'll need the latest haml, compass, compass-colors, and fancy-buttons. After you get the gems, you'll need to install compass for a rails app and then install fancy-buttons:

Add the following lines to your compass configuration file: require 'compass-colors' require 'fancy-buttons'

Then run the following command: compass -i -f fancy-buttons

At that point you should be able to do anything I'm doing in the screencast. I'll be happy to help if you get stuck, but it should be fairly simple.

davidchua commented 14 years ago

Thanks imathis.

After following the instructions, I'm getting the following error:

compass -i -f fancy-buttons exists wheresmyinvitesat exists . exists app/stylesheets exists public/images exists public/stylesheets/compiled identical app/stylesheets/buttons.sass identical public/images/button_bg.png identical index.html exists public/stylesheets/compiled unchanged app/stylesheets/screen.sass unchanged app/stylesheets/print.sass unchanged app/stylesheets/ie.sass compile app/stylesheets/buttons.sass Sass::SyntaxError on line 77 of /usr/lib64/ruby/gems/1.8/gems/fancy-buttons-0.3.2/lib/sass/./_fancy_buttons.sass: Undefined variable: "!v_padding". Run with --trace to see the full backtrace

imathis commented 14 years ago

Sorry I missed a bug with a recent update. I've pushed 0.3.3 now. If you can update that will solve the issue.

davidchua commented 14 years ago

Thanks, its working great now.

I'm not sure if this is a bug, and that I just don't know how to properly add a link to it, but when I add a link to the button and press on it, it runs the action it is pointing to, twice.

http://pastie.org/714380

Is there a proper way that should be expected to be linking to the buttons?

imathis commented 14 years ago

Does that will yield html that has a link with a button inside of it? You don't need to do that. Just a plain link with a class for styling, or button will work fine. In the screencast I'm adding the mixin under a.button, button which means both buttons, and links with a class "button" will get the style. All you have to do is this, just make it a button, or a link, but not both.

davidchua commented 14 years ago

That seems to fix it.

Sorry for my stupid questions.

bridiver commented 14 years ago

compass -i -f fancy-buttons

No such framework: "fancy-buttons"

any ideas?

bridiver commented 14 years ago

this worked: compass -r fancy-buttons -i -f fancy-buttons but I wonder why the require statement in the config file doesn't?

imathis commented 14 years ago

Thanks for figuring that out, I'm not sure why it doesn't work that way. I think extensions will be greatly improved in Compass 1.0