Commit 91016cbc authored by Kevin Cristiano's avatar Kevin Cristiano 🌎
Browse files

merge db6b793e from develop to master

parent 0c5ec1b6
#CSS Helper for CiviCRM and WordPress
Tadpole's CiviCRM css override that allows the theme to control the CSS on frontend CiviCRM pages.
This includes a templates directory to override selectors where they are lacking.
# CSS Helper for CiviCRM and WordPress
This extension replaces the core civicrm css file with it's own.
Tadpole's CiviCRM CSS override allows the theme to control the CSS on frontend CiviCRM pages.
This includes a templates directory to override selectors where they are lacking.
This extension supports 4.6
This extension replaces the core CiviCRM CSS file with its own.
Version 1.2 is based on the civicrm.css from the 4.6 release
This extension supports 4.6.
Version 1.2 is based on the /civicrm/css/civicrm.css from the 4.6 release.
#Overrides
You can now replace this extension's CSS file with a custom one from your theme. This makes use of the tc_civicss_override filter. Add the below function to your theme's functions.php or add a your own plugin to do this. You will need to have the images directory /i available at the same level as your civicrm.css file to show credit card icons and other images.
# Overrides
You can now replace this extension's CSS file with a custom one from your theme. This makes use of the tc_civicss_override filter.
Add the below function to your theme's functions.php or add your own plugin to do this.
You will need to have the images directory /i available at the same level as your civicrm.css file to show credit card icons and other images.
Example Code:
function tc_civicrm_theme_css( ) {
$tc_css = get_stylesheet_directory_uri() .'/includes/css/civicrm.css';
......@@ -22,14 +23,14 @@ Example Code:
}
add_filter( 'tc_civicss_override', 'tc_civicrm_theme_css' );
You can also just add additional css in your theme. As the civicrm.css from the extension loads with a priority of 110, set this higher. The example shows '199' as the priority. Add the below function to your theme's functions.php or add a your own plugin to do this. You will need to have the images directory /i available at the same level as your civicrm.css file to show credit card icons and other images.
Example Code:
function tc_civicrm_theme_addl_css( ) {
wp_enqueue_style( 'tc_civi_style', get_stylesheet_directory_uri() . '/civicrm/civicrm.css' );
}
add_action( 'wp_print_styles', 'tc_civicrm_theme_addl_css', 199 );
\ No newline at end of file
add_filter( 'wp_print_styles', 'tc_civicrm_theme_addl_css', 199 );
......@@ -140,8 +140,12 @@ function csshelper_civicrm_preProcess($formName, &$form) {
*/
/*Enqueue default CiviCRM CSS in admin. Create a filter to allow themes and other plugins to overrride */
if ( ! function_exists( 'civi_wp' ) ) {
}
else {
add_action( 'admin_enqueue_scripts', 'csshelper_register_admin_civicrm_styles' );
add_action('admin_enqueue_scripts', 'csshelper_register_admin_civicrm_styles');
};
function csshelper_register_admin_civicrm_styles() {
$tc_civi_css_admin = (plugin_dir_url('civicrm') . 'civicrm/civicrm/css/civicrm.css');
......@@ -150,8 +154,12 @@ function csshelper_register_admin_civicrm_styles() {
}
/*Enqueue custom CiviCRM CSS in front end of site. Create a filter to allow themes and other plugins to overrride */
if ( ! function_exists( 'civi_wp' ) ) {
}
else {
add_action('wp_print_styles', 'csshelper_register_civicrm_styles', 110);
};
add_action( 'wp_print_styles', 'csshelper_register_civicrm_styles', 110 );
function csshelper_register_civicrm_styles() {
$tc_ext_url = CRM_Core_Resources::singleton()->getUrl('cc.tadpole.csshelper');
$tc_civi_css = ( $tc_ext_url . 'css/civicrm.css') ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment