CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Changing civicrm.css in a elegant way...how?
Pages: [1]

Author Topic: Changing civicrm.css in a elegant way...how?  (Read 1294 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Changing civicrm.css in a elegant way...how?
July 18, 2008, 05:15:04 pm
Hi CiviCRM team,

Thanks for reading.

Do you have a way to override/customize the CSS for Civicrm (civicrm.css) in a way similar to templates?  That is a pretty slick way you have made to set up custom templates.

Do you have a similar method for CSS?  If so I can't find it and I've searched for a good 20 minutes, maybe in the wrong place...

My goal: To customize the look and feel of several pages within CiviCRM, changing colors, borders, of search results, etc and to not have to edit civicrm.css itself, because this may make future upgrades of the software more complicated.

Try CiviTeacher: the online video tutorial CiviCRM learning library.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Changing civicrm.css in a elegant way...how?
July 19, 2008, 03:21:00 am

i dont think there is an elegant way to do so :( (since its hardcoded in the php file, for drupal)

This came up recently also. Please file an issue and we'll resolve it for 2.2

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Changing civicrm.css in a elegant way...how?
July 22, 2008, 06:52:44 am
Stoob,

Not very elegant, but working way to hack it is to create a custom template for (for example) templates/CRM/common/drupal.tpl, include separate CSS stylesheet there and overload some civicrm.css settings using CSS. It won't work for everything, but should be fairly non-hackish.

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Changing civicrm.css in a elegant way...how?
July 22, 2008, 07:42:54 am
Hi,

If you use drupal, you can change your drupal theme (either add a css or modify one), and add your own style that override the default civicrm ones.

Use firebug to find where the style you want to modify are defined (eg #civicrm .whatever #example {color:pink;} , and put the one you want in your css

#civicrm .whatever #example {color:yellow;}

if you want to be sure you don't have problem, no matter the css include order, make your custom styles more specific. eg :
html #civicrm .whatever #example {color:yellow;}

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Changing civicrm.css in a elegant way...how?
July 23, 2008, 11:25:17 am
Thanks guys these are all good suggestions.  I will also enter an open issue 'suggestion' for the next version.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Changing civicrm.css in a elegant way...how?

This forum was archived on 2017-11-26.