[Blacklight-development] css tinkering

18 views
Skip to first unread message

adam wead

unread,
May 24, 2010, 4:13:04 PM5/24/10
to Blacklight Development
Hi all,

Bit of a dumb question...

What's the best way to do your own application.css file that overrides
the one that is in the plugins directory?

I'm hoping I can customize my own css file and not have to worry about
re-doing each time there's a new version of the plugin released.

thanks in advance,

...adam

--
You received this message because you are subscribed to the Google Groups "Blacklight Development" group.
To post to this group, send email to blacklight-...@googlegroups.com.
To unsubscribe from this group, send email to blacklight-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/blacklight-development?hl=en.

Sean Hannan

unread,
May 24, 2010, 4:17:14 PM5/24/10
to blacklight-...@googlegroups.com
Just stick it in blacklight/public/stylesheets/application_local.css

(You may need to create public/stylesheets/)

-Sean

Jonathan Rochkind

unread,
May 24, 2010, 4:18:07 PM5/24/10
to blacklight-...@googlegroups.com
There might be several answers to this, and there are several ways to do
it.

Here's how _I'd_ do it, taking advantage of the new features in the
latest BL release.

Do you want to leave the original application.css file, there but put
your own CSS cascading on top? That's what I'd do. Put this in any
config/initiailizers/* file in your app, such as blacklight_config.rb,
or a new file you create with whatever name you want:

ApplicationController.before_filter do |controller|
controller.stylesheet_links << "application.css"
end

And put your application.css in your own app's
public/stylesheets/application.css.

If you want to remove the default application.css from being linked to
at all, I can tell you how to do that too. But in many cases you
actually want the default application.css to be there, but just want
yours to be included afterwards, so it overrides the defaults. That's
what the above will do.

Jonathan

adam wead

unread,
May 24, 2010, 4:21:52 PM5/24/10
to Blacklight Development
sweet, thanks for the fast responses... I think i'd choose Jonathan's
option because I just want to modify small bits of it and leave the
bulk of the original intact. that way, the changes would actually
"cascade" right?

Jonathan Rochkind

unread,
May 24, 2010, 4:42:17 PM5/24/10
to blacklight-...@googlegroups.com
I think Sean's would actually accomodate that too, just through a
different piece of Blacklight code, heh. For better or worse, there's
sometimes more than one way to do things in out of the box Blacklight.

Either way, you should be able to 'cascade' and just over-ride changes,
I think. I prefer my way and can vouch for it's workingness. I think
Sean's way will work too.
Reply all
Reply to author
Forward
0 new messages