Remove CSS rules

Remove CSS rules

Fereshteh Hamidian
Vastuste arv 10
I have wrongly  inserted these codes in Boos theme Boost theme > advanced settings > raw SCSS

form#login input#username, form#login input#password, form#login div.rememberpass, form#login button#loginbtn{ display:none }

I want to remove it as the username and password have been hidden. Can anyone help me?  

Keskmine hinnang: -
Vastuses Fereshteh Hamidian

Re: Remove CSS rules

Leon Stringer
Core developers pilt Particularly helpful Moodlers pilt

From the login page use your browser's developer tools (for example, Page Inspector in Firefox). Search for these items and edit their style rules to remove or change the display:none rule. Then when they're visible, log in and change the raw SCSS setting

Vastuses Leon Stringer

Re: Remove CSS rules

Fereshteh Hamidian
Thank you, Leon. I did it already, but I could not find it,
Vastuses Fereshteh Hamidian

Re: Remove CSS rules

Ken Task
Particularly helpful Moodlers pilt
Might require direct DB manipulation of  ... mdl_config_plugins table
What do you see with the following query?

mysql> select * from mdl_config_plugins where plugin like 'theme_boost' and name like 'scss';

I see this:

+-----+-------------+------+-------+
| id  | plugin      | name | value |
+-----+-------------+------+-------+
| 200 | theme_boost | scss |       |

One might be  able to very carefully set the value of that to 'nothing'.

IF you are going to try to reset via DB, make sure you backup your DB first ... just in case! naeratus

'SoS', Ken


Vastuses Ken Task

Re: Remove CSS rules

Fereshteh Hamidian
Thank you, Ken, I have removed it , but still I don't see the username and password. Have I missed something?
  • The fact that  I added custom CSS to hide the login fields.
  • The CSS was added via Moodle's theme settings.
  • I have  tried to remove the CSS from the database and the SCSS files.
  • The login fields are still not visible after removing the CSS.

Vastuses Fereshteh Hamidian

Re: Remove CSS rules

Ken Task
Particularly helpful Moodlers pilt
Purge Caches?

'SoS', Ken
Vastuses Ken Task

Re: Remove CSS rules

Fereshteh Hamidian
Thanks, Sorry No, I don't know how to do it. Any advice?
Vastuses Fereshteh Hamidian

Re: Remove CSS rules

Ken Task
Particularly helpful Moodlers pilt
Command line - don't have to be logged onto moodle to do this but you do need to have ssh into server.

cd /path/to/moodlecode/admin/cli/
Then issue:
php purge_caches.php

While you are there:

php checks.php

There is also this one:

php build_theme_css.php

Don't have the problem ... when I run that last script it reports it's building:
== Build theme css ==
and then sends me back to the prompt.
Am assuming that since there were no errors reported, it did it successfully.

'SoS', Ken

Vastuses Fereshteh Hamidian

Re: Remove CSS rules

Leon Stringer
Core developers pilt Particularly helpful Moodlers pilt

Which version of Moodle is this?

With Moodle 4.1 if I use your Raw SCSS so my login fields are hidden I can search for the username element in my browser by typing "input#username" into the search field:

Screenshot of browser's inspector with search text "input#username" and corresponding CSS rule highlighted

I can then uncheck the CSS rule display: none to show the login fields and enter my credentials to log in. Then I go to the theme configuration page and remove the text in Raw SCSS.

Vastuses Fereshteh Hamidian

Re: Remove CSS rules

Ken Task
Particularly helpful Moodlers pilt
You need a 'tinker' instance of same version of Moodle so you can play and discover self destruction! :|

Am really curious as to why you did that?  ['brain cramp'?  I have to confess, I had one of those recently! kurvastab]

One more tip ... which might not work ... an altlogin.php or .html page.

See:
old discussion ... one poster did provide contents of an altlogin page.
Since that is old, dunno if it would work still or not ... but considering your troubles, worth a shot! naeratus

'SoS', Ken


Vastuses Fereshteh Hamidian

Re: Remove CSS rules

Rick Jerz
Particularly helpful Moodlers pilt Testers pilt

I think you can add the following line in your config.php file to force Moodle to start in Classic.

$CFG->theme = 'classic';

Then, once in, you can go over to your Boost theme setting and delete the incorrect CSS.