Remove CSS rules

Remove CSS rules

by Fereshteh Hamidian -
Number of replies: 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?  

Average of ratings: -
In reply to Fereshteh Hamidian

Re: Remove CSS rules

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

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

In reply to Leon Stringer

Re: Remove CSS rules

by Fereshteh Hamidian -
Thank you, Leon. I did it already, but I could not find it,
In reply to Fereshteh Hamidian

Re: Remove CSS rules

by Ken Task -
Picture of Particularly helpful Moodlers
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! smile

'SoS', Ken


In reply to Ken Task

Re: Remove CSS rules

by 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.

In reply to Fereshteh Hamidian

Re: Remove CSS rules

by Ken Task -
Picture of Particularly helpful Moodlers
Purge Caches?

'SoS', Ken
In reply to Ken Task

Re: Remove CSS rules

by Fereshteh Hamidian -
Thanks, Sorry No, I don't know how to do it. Any advice?
In reply to Fereshteh Hamidian

Re: Remove CSS rules

by Ken Task -
Picture of Particularly helpful Moodlers
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

In reply to Fereshteh Hamidian

Re: Remove CSS rules

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

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.

In reply to Fereshteh Hamidian

Re: Remove CSS rules

by Ken Task -
Picture of Particularly helpful Moodlers
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! sad]

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! smile

'SoS', Ken


In reply to Fereshteh Hamidian

Re: Remove CSS rules

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

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.