Blocks CSS - Any standard classes?

Blocks CSS - Any standard classes?

by Neil Haskins -
Number of replies: 1

I'm working on styling a new block. I was hoping to have my button styles follow those of whatever theme is being used, but I can't find if here are any standard element classes in available.

I came across a few pages on moodle.org related to this, but it looks like the work has been abandoned, but the pages left up.

Is there anything going on in this area? Either way, what are best practices here? My first thought was to use bootstrap styles (class="btn btn-primary"), but I realize not all themes use bootstrap.

Any advise?

Average of ratings: -
In reply to Neil Haskins

Re: Blocks CSS - Any standard classes?

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers
Well, you could still use the bootstrap classes and add the relevant bootstrap css to your block /styles style sheet if you think there will be significant use with non-bootstrap themes.
But bootstrap styling is pretty much the accepted way to do things in moodle, the other non-bootstrap themes in the plugins database are essentially legacy ones, although some may still be in use.
The slightly bigger issue is if you use boostrap classes which have changed between BS versions (panels v cards for example)