Filepath for Raw SCSS - injected via colors tab

Filepath for Raw SCSS - injected via colors tab

by Celynn K -
Number of replies: 8
Hello all,

Hoping someone out there has the answer to this.

When Raw SCSS is added via Theme/Fordson/Colors/Raw SCSS (box at bottom of page) it says it is injected at the end of the style sheet.

Can anyone tell me the file path for this location? I've gone through the ones I could locate under theme and no luck. Feeling a bit desperate because the code I just inserted there has broken my theme and removing from box and resaving did not fix.

Celynn
Moodle 3-8, Fordson, Boost preset
Average of ratings: -
In reply to Celynn K

Re: Filepath for Raw SCSS - injected via colors tab

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

The version of the theme I have does not appear to use that setting:

/**
 * Inject additional SCSS.
 *
 * @param theme_config $theme The theme config object.
 * @return string
 */
/* Removed to fix double import of extra SCSS at bottom of color page
function theme_fordson_get_extra_scss($theme) {
    // Adapted from Boost to allow other changes or settings if required.
    
    if (!empty($theme->settings->scss)) {
        $extrascss .= $theme->settings->scss;
    } else {
        $extrascss = '';
    }
    return $extrascss;
}*/

so, what version of the theme are you using?

In reply to Gareth J Barnard

Re: Filepath for Raw SCSS - injected via colors tab

by Celynn K -
Hi Gareth,

First, thank you very much for taking the time to respond.

I'm using Moodle 3.8/Fordson/Boost theme
At the bottom of the page : admin/appearance/theme/fordson/colors there is a box where you can add custom SCSS

The first time I tried this it worked beautifully.
The second time I added code in there it broke the theme..for lack of a better description.
I am unable to write my own code at this point so it was code I got from the forum.

I was trying to find the .scss file on the server so I could remove the code that had been added in.

I ended up uninstalling/reinstalling my Fordson theme and it has solved the problem.
Do you know where the custom scss is inserted when this box was used in case I run into problems again.

Celynn
In reply to Celynn K

Re: Filepath for Raw SCSS - injected via colors tab

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
There is no actual physical SCSS file but there is the generated 'all' file in the theme cache portion of the Moodle Data folder that is cleared by 'Purge all caches'.
In reply to Gareth J Barnard

Re: Filepath for Raw SCSS - injected via colors tab

by Celynn K -
Thank you Gareth,

I have a (probably stupid) question about using the box in the colors tab to add Raw SCSS

When you add the code and save, then go back to make other changes on that same colors page/tab, is the code added again?

Once you've added the the code and saved, should you delete the RawSCSS from that box before you save again?

Celynn
In reply to Celynn K

Re: Filepath for Raw SCSS - injected via colors tab

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
RE: When you add the code and save, then go back to make other changes on that same colors page/tab, is the code added again? = No.

RE: Once you've added the the code and saved, should you delete the RawSCSS from that box before you save again? = No.

The text in the RawSCSS setting is stored in the database. That is then used to generate the 'all' CSS file by the PHP SCSS compiler when the theme cache is purged.
In reply to Gareth J Barnard

Re: Filepath for Raw SCSS - injected via colors tab

by Celynn K -

Thank you Gareth

Much appreciated 

I wanted to make sure before I added any more code in there. 

Celynn

In reply to Gareth J Barnard

Re: Filepath for Raw SCSS - injected via colors tab

by Ray Pierce -

Where in the database is the Raw SCSS stored? I need to edit it because my theme is also broken from code I added but now cant get to via the theme