Tagged: ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #339716

    I have had to comment out the entire #Forms section of the base.css file to allow me to use my preferred forms generator but that means future theme updates will overwrite the base.css file. So how do I maintain my version of the base.css file so that theme updates leave or allow my version of the css to be used?

    If I was adding or changing css I wouldn’t have a problem obviously but I’ve never had a situation where I needed to disable part of a theme’s css.

    I am using the Enfold Child theme btw.

    #339732

    Hi!

    Copy the modified base.css to your child theme directory (css/base.css) and add this to child functions.php file:

    // Change base.css
    function wp_change_basecss() {
       if(!is_admin()){
       		wp_dequeue_style( 'avia-base' );
       		wp_enqueue_style( 'avia-base-child', get_stylesheet_directory_uri().'/css/base.css', array(), '2', 'all' );
       }
    }
    add_action( 'wp_enqueue_scripts', 'wp_change_gridcss', 100 );

    That will dequeue the default base.css and enqueue the child one instead.

    Best regards,
    Josue

    #339828

    Thanks Josue,

    But does this actually help I wonder? If the original bass.css plus my edits is copied to the child folder and the added function effectively says ignore the main base.css and use the child base.css how does that allow for any updated css you guys make?

    So if in the next theme update there is one edit or a hundred edits or even new css I wont ever see that because the function says ignore that and use the child base.css that has sat there for the last xx months.

    If I am adding some custom css or changing something from the default file it’s easy and I just use the custom facility in the theme so that my css overrides the default but what I need to do is eliminate SOME (just the #Form parts) of the default.

    Or have I missed something?

    #340476

    Hey!

    Looks like the only solution to your problem is to copy the #Form section of the base.css on Quick CSS or the child theme’s style.css file. Modify the code to override the base.css default #Form style.

    Best regards,
    Ismael

    #340781

    Errr, that’s not so easy….

    That means I need to match up all the classes that are conflicting with my plugin and use the values from the plugin in the child css…..

    Hmmm, that’s kind of a major pain.

    I’ll report back :(

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Best way to handle a CSS change to base.css’ is closed to new replies.