Skip to content

Commit 8c3511f

Browse files
bartdenhoedabias
authored andcommitted
First release of the snippets repository, based on the outcome of MoodleMootDACH and amended by the Boost Union maintainers afterwards
1 parent 577528b commit 8c3511f

File tree

11 files changed

+135
-2
lines changed

11 files changed

+135
-2
lines changed

README.md

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,76 @@
1-
# moodle-theme_boost_union_snippets
2-
Boost Union CSS snippets
1+
# SCSS snippets repository for Moodle Boost Union Theme
2+
3+
## About
4+
5+
The [Boost Union](https://github.com/moodle-an-hochschulen/moodle-theme_boost_union) theme for Moodle allows administrators to enable / use SCSS snippets to enhance and style their particular Moodle instance.
6+
7+
The theme ships with a [small default set of SCSS snippets](https://github.com/moodle-an-hochschulen/moodle-theme_boost_union/tree/main/snippets/builtin).
8+
9+
In addition to these, the SCSS snippets in this repository are meant to be uploaded in the Boost Union SCSS snippets setting page by the administrator. Furthermore, a way to automatically download and include these SCSS snippets is on Boost Union's roadmap.
10+
11+
## SCSS snippet structure
12+
13+
### Components of a SCSS snippet
14+
15+
A SCSS snippet consists of two components:
16+
17+
- A simple plaintext SCSS file (.scss)
18+
- An optional image file, (.webp, .png, .jpg, .jpeg, .gif - ideally widescreen aspect ratio)
19+
20+
Both files must share the same arbitrary filename and just differ by their file suffix.
21+
22+
### SCSS snippet file metadata
23+
24+
A SCSS snippet file contains, beside the necessary SCSS code, several metadata fields which allow us to categorize and manage the pile of SCSS snippets.
25+
26+
These are attributes that are defined to be added at the top of the SCSS file:
27+
28+
- `Snippet Title`: The title of the snippet which will be shown in the snippet list in Boost Union
29+
- `Scope`: A tag which highlights the scope of the snippet (see below)
30+
- `Goal`: A tag which highlights the goal of the snippet (see below)
31+
- `Description`: A few sentences which describe the snippet for humans
32+
- `Creator`: The creator of the snippet which will be shown in the snippet list in Boost Union
33+
- `Tested on`: A short information on which Moodle version and with which browser the snippet was tested
34+
- `Tracker issue`: The Moodle tracker issue number (MDL-xxxxx) where the bug / glitch / goal which is solved by the SCSS snippet was reported upstream
35+
- `Usage note`: An (optional) usage note to be shown in the snippet list in Boost Union
36+
37+
#### List of scopes
38+
39+
Each particular snippet should have a `Scope` tag and thereby be assigned to a single particular scope. The scope does not have a technical impact, it is rather an important metadata for structuring the pile of available snippets:
40+
41+
- `global`: These snippets affect the entire site
42+
- `course`: These snippets affect only the course context
43+
- `dashboard`: These snippets affect only the dashboard of a user
44+
45+
The list of scopes is not necessarily limited to these existing scopes, additional scopes can be added in the future.
46+
47+
#### List of goals
48+
49+
Each particular snippet should have a `Goal` tag and thereby be assigned to a single particular goal. The goal does not have a technical impact as well, it is a metadata for structuring the pile of available snippets as well:
50+
51+
- `eyecandy`: These snippets focus on the (visual) styling of Moodle, especially to deviate from Moodle's and Bootstrap's default appearance
52+
- `bugfix`: These snippets fix Moodle CSS bugs and glitches, ideally temporarily until Moodle core fixes it itself
53+
- `accessibility`: These snippets try to Moodle more accessible
54+
- `easeofuse`: These snippets try to make Moodle easier to use
55+
- `devsonly`: These snippets add styling that mainly help developers who develop in Moodle
56+
57+
The list of goals is not necessarily limited to these existing goals, additional goals can be added in the future.
58+
59+
## Repository structure
60+
61+
This repository is, for now, structured by snippet goals with each goal having a top level folder. Within this folder, all snippets are located on the same level
62+
63+
## Using the community snippets in Boost Union
64+
65+
You can use all of these snippets here directly in Boost Union:
66+
67+
* Download this repository as ZIP file
68+
* In your Moodle instance, go to Site administration -> Appearance -> Boost Union -> SCSS snippets -> Settings
69+
* On this settings page, enable the 'Enable uploaded snippets' setting
70+
* Upload the ZIP file into the 'Upload snippets' setting and save the settings page. Upon saving, Boost Union will automatically unpack the ZIP file.
71+
* Go to Site administration -> Appearance -> Boost Union -> SCSS snippets -> Overview
72+
* Enable the particular SCSS snippets which you would like to use
73+
74+
## Create and contribute your own snippet
75+
76+
You are welcome to create your own SCSS snippet based on the [boilerplate](https://github.com/moodle-an-hochschulen/moodle-theme_boost_union_snippets/tree/main/boilerplate) and submit your new SCSS snippet as a pull request to this repository.

boilerplate/boilerplate.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Snippet Title: <snippet title>
3+
* Scope: <snippet scope>
4+
* Goal: <snippet goal>
5+
* Description: <snippet description>
6+
* Creator: <snippet creator>
7+
* Tracker issue: <snippet tracker issue>
8+
* Tested on: <snippet tested on information>
9+
* Usage note: <snippet usage note>
10+
*
11+
* @copyright <your copyright here>
12+
* @author <your authors here>
13+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
14+
*/
15+
16+
// <place your SCSS code here>

snippets/accessibility/.gitkeep

Whitespace-only changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Snippet Title: Darken hover background color in secondary menu items
3+
* Scope: global
4+
* Goal: accessibility
5+
* Description: Darken the background color of the secondary menu items while hovering to show more contrast agains other unselected menu items.
6+
* Creator: Heba Amer
7+
* Tested on: Moodle 5.0, Firefox for Mac
8+
*
9+
* @copyright 2024 The American University in Cairo
10+
* @author Heba Amer <heba.amer@aucegypt.edu>
11+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
12+
*/
13+
14+
.secondary-navigation .moremenu .nav-link:hover,
15+
.secondary-navigation .moremenu .nav-link:focus {
16+
background-color: $gray-400 !important;
17+
}
Binary file not shown.

snippets/bugfix/.gitkeep

Whitespace-only changes.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Snippet Title: Maintenance pages with proper edges
3+
* Scope: global
4+
* Goal: bugfix
5+
* Description: The Moodle maintenance page layout (which is particularly used to present the Moodle database upgrade wizard) suffers from a layout bug that the content area does not have proper edges. This becomes visible as soon as the Moodle site uses a background image. This snippet fixes the issue by adding rounded corners and some paddings.
6+
* Creator: Alexander Bias
7+
* Tracker issue: MDL-85915
8+
* Tested on: Moodle 5.0, Firefox for Mac
9+
*
10+
* @copyright 2025 Alexander Bias, ssystems GmbH
11+
* @author Alexander Bias <abias@ssystems.de>
12+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
13+
*/
14+
15+
.pagelayout-maintenance {
16+
.page-header-headings {
17+
@extend .rounded-top;
18+
@extend .px-4;
19+
}
20+
21+
#region-main {
22+
@extend .rounded-bottom;
23+
@extend .px-4;
24+
@extend .pb-4;
25+
}
26+
}
257 KB
Binary file not shown.

snippets/devsonly/.gitkeep

Whitespace-only changes.

snippets/easeofuse/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)