Add custom CSS to Academi theme

Add custom CSS to Academi theme

by john john -
Number of replies: 6

I tried to add some custom CSS, in order to change the padding left and right in the container. I added the following CSS code in the "Custom CSS" at Appearance / Themes / More and none effect had on the theme.

.container-fluid {

    padding-right: 5px;
    padding-left: 5 px;

}


I tried also the  "!important" but still nothing..  How can I solve this? 

Moodle version: Moodle 3.1.3+ (Build: 20161118)
Theme: Academi Release v1.3

Average of ratings: -
In reply to john john

Re: Add custom CSS to Academi theme

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi John John,

The problem is in the academi/config.php which I have copied here for all to see...

Notice the hightlighted line below. The problem here is with the ORDER of the files.
As you can see 'custom' is added first. This is WRONG as that file should be read LAST so it should be at the END of that line.

To save you time I have attached an amended copy of the Academi's config.php so that you can upload it to your Moodle server after removing the old config.php from the Academi theme.

Hope this helps?

Mary

<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>;.

/**
 * Version details
 *
 * @package    theme_academi
 * @copyright  2015 LMSACE Dev Team , lmsace.com
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 *
 */
    
$THEME->name = 'academi';

$THEME->doctype = 'html5';
$THEME->parents = array('bootstrapbase');
$THEME->sheets = array('custom','theme','font-awesome.min');
$THEME->supportscssoptimisation = false;
$THEME->yuicssmodules = array();
$THEME->enable_dock = true;
$THEME->editor_sheets = array();

$THEME->rendererfactory = 'theme_overridden_renderer_factory';
$THEME->csspostprocess = 'theme_academi_process_css';

$THEME->layouts = array(
        // The site home page.
        'frontpage' => array(
                'file' => 'frontpage.php',
                'regions' => array('side-pre'),
                'defaultregion' => 'side-pre',
                'options' => array('nonavbar' => true),
        )
);

$THEME->blockrtlmanipulations = array(
    'side-pre' => 'side-post',
    'side-post' => 'side-pre'
);

In reply to Mary Evans

Re: Add custom CSS to Academi theme

by john john -

Hello Mary,

Thanks for your reply.
I edited the config.php as you said, but nothing has changed.. Whatever CSS rule I insert, don't have any effect on the site..

In reply to john john

Re: Add custom CSS to Academi theme

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi JohnJohn, you left it a long time to wait to answer!

Have you tried to Purge all caches? 

Site Administration > Develpment > Purge all caches

That should fix it.

In reply to Mary Evans

Re: Add custom CSS to Academi theme

by john john -

Indeed! smile

I purged all caches but still none effect have the rules on the custom css.. I also tried and cleared  theme caches from Theme selector but none effect again..

The CSS rule is valid because when I apply in from browser inspect, it works.

Any other idea, what I can do?

In reply to john john

Re: Add custom CSS to Academi theme

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Lets go back to the beginning.

I hope you are aware that the CSS you wrote at the start of this discussion was wrong?

I just assumed it was a typo...but if you added it as it is then that CSS is wrong!!!

.container-fluid {

    padding-right: 5px;
    padding-left: 5 px;

}

This is what is should have been,

.container-fluid {

    padding-right: 5px;
    padding-left: 5px;

}

You might as well try the following:

#page .container-fluid {
    padding: 0 5px;!important;
}
Which should work....I hope!!!

Cheers
Mary

In reply to Mary Evans

Re: Add custom CSS to Academi theme

by john john -

I didn't have any space.. My CSS rule is fine..
Nothing yet.. I also sent an email to the group that  created the Academi theme but I didn't have any response..

I am afraid that I will have to add my rules to their theme css file..