academic-moodle-cooperation / moodle-mod_consentform

The activity Consentform enables teachers to display or hide course content for participants depending on their consent/refusal.
https://academic-moodle-cooperation.org/mod_consentform/
2 stars 1 forks source link

styles.css not specific enough #6

Closed danmarsden closed 2 years ago

danmarsden commented 2 years ago

in your styles.css you define a number of generic styles that could clash with core moodle code or other locations where simliar names are used. eg: https://github.com/academic-moodle-cooperation/moodle-mod_consentform/blob/master/styles.css#L39 and: https://github.com/academic-moodle-cooperation/moodle-mod_consentform/blob/master/styles.css#L81-L91

Moodle collects the styles.css files from all plugins and bundles them together as a single css file for caching in the browser - for this reason you need to be really careful to correctly target all your css classes so you don't end up targeting content in other pages/modules/plugins in the site.

Moodle helpfully adds a number of classes to the body tag based on the path that you can use such as: eg if you are have a file in mod/assign you would see the following class added to the body tag path-mod-assign so if you have an item with the class "filething" on the page you would target it like:

.path-mod-assign .filething {
   color: red;
}

Please make sure your css classes in styles.css are specific enough so they cannot clash with other core code.

mkemmerling commented 2 years ago

Fixed in master branch. Version 3.11.1 coming soon.