Raw SCSS in Adaptable Theme

Raw SCSS in Adaptable Theme

by Shahram Mirkhani -
Number of replies: 4

Hi everyone!

I have used font-face to add fonts in ATTO editor for Boost and Fordson theme succesfully.

Just after uploading the .WOFF font files I have added the below code to Raw SCSS input window of each theme and added some line introducing the font family to ATTO font family plugin and BAMM! It works beautifully!

@font-face {

    font-family: MyFontFamily;

    src: url([[font:core|myfont.woff]]);

}

But unfortunately there is no place to add this code in Adaptable theme and it is strange as it was really adaptable until this point!! Well, I added the code to CSS and JS Codes part already but that does not work.

BTW: My moodle version is 3.9.4 and Adaptable version is 2.4.4.

I would be greatful to have your opinions here!  

Average of ratings: -
In reply to Shahram Mirkhani

Re: Raw SCSS in Adaptable Theme

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Are you sure it works? Given the way that the SCSS PHP parser works and the fact that you're using the '$THEME->csspostprocess' functionality, and given that you're not using the 'unquote' SCSS syntax, so I'm really surprised that you don't get a compilation error. Also, 2.4.4 is designed for Moodle 3.8, not 3.9!

And.... where did you upload the WOFF files to?
In reply to Gareth J Barnard

Re: Raw SCSS in Adaptable Theme

by Shahram Mirkhani -
Oh I am pretty sure!

I have attached screen shots from my mobile and some other PC which I am sure have not these fonts on them and I have ovisited the website for the first time there!
Well, I am new in this but it simply made sence that after uploading the fonts in /lib/font and introducing the font family it worked. in three different installations!

The point is how can I do this in Adaptablem as it is my most important theme to uswe from now on!!
I should also add that 2.4.4 is kinda better for me, it has better control in padding header logo and text and I intentionally used it.


Attachment WhatsApp Image 2021-03-02 at 9.18.53 AM.jpeg
In reply to Shahram Mirkhani

Re: Raw SCSS in Adaptable Theme

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Oh, ok, interesting. I tried the SCSS method in another theme and it works.  With Adaptable you can edit the custom.css file like so:
Attachment Screenshot 2021-03-03 123833.png