It is impossible to add custom CSS for blocks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Wishlist
|
Valerii Kuznetsov |
Bug Description
class PluginBlocktype that used for artefact blocks doesn't have any methods to load CSS files while it has two of them for JS:
- get_instance_
- get_instance_
I see two ways of customizing CSS for blocks, but they both have significant disadvantages:
1. Load custom CSS for a block using js dynamic loader (dynamically create link tag to CSS in header). However, this way is quite limited because it doesn't support themes.
2. Change docroot/
My proposed solution is create style folder structure for blocktype as it done for artefact:
artefact/
This file (if exists) will be loaded when block placed on current page and during page edit mode only.
I am going to implement this functionality anyway, but want to know if community interested in this feature or may be there some workarounds that I don't know?
Changed in mahara: | |
importance: | Undecided → Wishlist |
Changed in mahara: | |
assignee: | nobody → Valerii Kuznetsov (valerii-kuznetsov) |
status: | New → In Progress |
Changed in mahara: | |
milestone: | none → 1.9.0 |
status: | In Progress → Fix Committed |
tags: | added: nominatedfeature |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
What would be the advantage for customizing CSS for blocks? What do you want to achieve? Shall each user be able to change the style of a block or do you want to be able to target blocks in the CSS, i.e. have a different heading style for image blocks than text blocks for example?