Skip to content

Commit 18d8866

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 18d8866

File tree

5 files changed

+90
-2
lines changed

5 files changed

+90
-2
lines changed

README.md

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,75 @@
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+
- `Usage note`: An (optional) usage note to be shown in the snippet list in Boost Union
35+
36+
#### List of scopes
37+
38+
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:
39+
40+
- `global`: These snippets affect the entire site
41+
- `course`: These snippets affect only the course context
42+
- `dashboard`: These snippets affect only the dashboard of a user
43+
44+
The list of scopes is not necessarily limited to these existing scopes, additional scopes can be added in the future.
45+
46+
#### List of goals
47+
48+
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:
49+
50+
- `eyecandy`: These snippets focus on the (visual) styling of Moodle, especially to deviate from Moodle's and Bootstrap's default appearance
51+
- `bugfix`: These snippets fix Moodle CSS bugs and glitches, ideally temporarily until Moodle core fixes it itself
52+
- `accessibility`: These snippets try to Moodle more accessible
53+
- `easeofuse`: These snippets try to make Moodle easier to use
54+
- `devsonly`: These snippets add styling that mainly help developers who develop in Moodle
55+
56+
The list of goals is not necessarily limited to these existing goals, additional goals can be added in the future.
57+
58+
## Repository structure
59+
60+
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
61+
62+
## Using the community snippets in Boost Union
63+
64+
You can use all of these snippets here directly in Boost Union:
65+
66+
* Download this repository as ZIP file
67+
* In your Moodle instance, go to Site administration -> Appearance -> Boost Union -> SCSS snippets -> Settings
68+
* On this settings page, enable the 'Enable uploaded snippets' setting
69+
* Upload the ZIP file into the 'Upload snippets' setting and save the settings page. Upon saving, Boost Union will automatically unpack the ZIP file.
70+
* Go to Site administration -> Appearance -> Boost Union -> SCSS snippets -> Overview
71+
* Enable the particular SCSS snippets which you would like to use
72+
73+
## Create and contribute your own snippet
74+
75+
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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Snippet Title: <snippet title>
3+
* Scope: <snippet scope>
4+
* Goal: <snippet goal>
5+
* Description: <snippet description>
6+
* Creator: <snippet creator>
7+
* Tested on: <snippet tested on information>
8+
* Usage note: <snippet usage note>
9+
*
10+
* @copyright <your copyright here>
11+
* @author <your authors here>
12+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
13+
*/
14+
15+
// <place your SCSS code here>

snippets/course/.gitkeep

Whitespace-only changes.

snippets/dashboard/.gitkeep

Whitespace-only changes.

snippets/global/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)