Moodle and CSS

Moodle and CSS

per Kevin Burton -
Nombre de respostes: 6

Sorry if this is such a basic question but I could not find the answer in the documentation. In the online documentation it suggests that there are three CSS files that are loaded. If I have CSS settings/definitions that are specific to my plugin where do those definitions go? Say I have a block plug-in such simiplehtml which the source would be in blocks/simplehtml. If I want a different font or color for the displayed HTML where should the CSS go?

Thank you.

Mitjana de qualificacions: -
En resposta a Kevin Burton

Re: Moodle and CSS

per Michael de Raadt -

Hi, Kevin.

The styles for your example block should be added to a styles.css file in the blocks/simplehtml directory. Keep the CSS specific to your block by preceding classes with the "frankenstyle" block identifier.

.block_simplehtml .your_class {...
En resposta a Michael de Raadt

Re: Moodle and CSS

per Kevin Burton -

Michael,

Thank you for your help. It must be my limited understanding of CSS. Please help me in my ignormance. I have a styles.css that contains the following lines:

.block_simplehtml{ border: 1px red solid}

I change the width of the border, the color, etc. but nothing changes. With the debugging tools I can see that there is a <div> of the class block_simplehtml. What am I missing?

Thank you.

 

En resposta a Kevin Burton

Re: Moodle and CSS

per Darko Miletić -
Imatge Core developers Imatge Plugin developers

Moodle by default caches all css styles. Switch your instance to theme designer mode which will disable css caching.

http://docs.moodle.org/dev/Creating_a_theme#Theme_designer_mode

En resposta a Darko Miletić

Re: Moodle and CSS

per Kevin Burton -

I tried this and it did not affect the appearance. Am I trying to set a property that just does not show up?

En resposta a Kevin Burton

Re: Moodle and CSS

per Darko Miletić -
Imatge Core developers Imatge Plugin developers

Did you empty your browser cache?

Are you sure that your block has that css listed in it's class attribute?