With Dash, you can set course category images across platforms for your created course categories. Simply drag and drop the images into the category.
Tip: If the images appear cropped in a viewport, just increase the pixel height of the images to fix this:
.dash-block-content img.img-responsive {
max-height: unset; /* default is 120px; unset removes a maximum height */
}
You can enhance this solution by adding your own styles, for example:
/* class: zoom-hover — slightly zoom in a card on hover */
.block_dash.zoom-hover .dash-container .dash-block-content .card {
transition: transform .2s;
}
.block_dash.zoom-hover .dash-container .dash-block-content .card:active,
.block_dash.zoom-hover .dash-container .dash-block-content .card:hover {
transform: scale(1.02);
}
/* class: bw-hover — display images in black/white unless on hover */
.bw-hover .dash-block-content img.img-responsive {
filter: grayscale(1);
}
.bw-hover .dash-block-content img.img-responsive:hover {
filter: grayscale(0);
}
/* class: *-ar — set aspect ratio for image size */
.mobile-ar .dash-block-content img.img-responsive {
aspect-ratio: 9/16;
}
.video-ar .dash-block-content img.img-responsive {
aspect-ratio: 16/9;
}
.square-ar .dash-block-content img.img-responsive {
aspect-ratio: 1;
}
.tall-ar .dash-block-content img.img-responsive {
aspect-ratio: 2/3;
}
.wide-ar .dash-block-content img.img-responsive {
aspect-ratio: 3/2;
}
/* class: tiny-img — make the image tiny (50px) */
.tiny-img .dash-block-content img.img-responsive {
max-width: 50px !important;
}
You can add these styles to the the raw SCSS of your theme (look at the settings of your theme, which can be found in the appearance section of the site administration).
In order to make it super easy for teachers to use these styles, just add the name of the class to the "CSS classes" setting of the Dash block, which can also be found in the website administration, under plugins > blocks > Dash.
Bonus tip: Moodle already uses a lot of styles, just to name a few:
rounded |
Makes borders round |
border |
Adds a border |
text-white |
Makes the text white |
bg-light |
Adds a light background |
bg-dark |
Adds a dark background |
small |
Makes the text small |
text-muted |
Reduces the contrast of the text |