Skip to content

Commit

Permalink
Add example branch which shows how to allow the admin to configure a …
Browse files Browse the repository at this point in the history
…SCSS variable with an admin setting.
  • Loading branch information
abias committed Feb 23, 2024
1 parent 2763095 commit 36fc35a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changes

### Rolling release

* 2024-02-23 - Add example branch which shows how to allow the admin to configure a SCSS variable with an admin setting.
* 2024-02-20 - Cleanup and enhance the codebase for adoption and publication by Moodle an Hochschulen e.V.
* 2024-01-10 - Add Github actions
* 2023-09-15 - Initial boilerplate by Daniel Poggenpohl
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ Extension examples

Developing for Boost Union means to apply similar techniques for every new feature. In this section, we try to collect some of these techniques for you.

### How to allow the admin to configure a SCSS variable with an admin setting

In the [extension-setting-scss-variable](https://github.com/moodle-an-hochschulen/moodle-theme_boost_union_child/tree/extension-setting-scss-variable) branch, we prepared some example code which shows you how allow the admin to configure a SCSS variable with an admin setting and without fiddling with SCSS.

In the example, we added a text admin setting into a dedicated admin settings tab. This setting is evaluated in lib.php where the pre-SCSS code is composed and where, based on the setting, a SCSS variable of Boost Core is overwritten. In this example, we chose to allow you to configure the $navbar-height variable. As a result, you can modify the height of the navbar just from within the admin setting if needed.

The example code is completed by a Behat test which verifies now and forever that the admin setting is doing its job properly.

### Call for proposals

If you have another good extension example for Boost Union Child, we would be grateful if you would contribute it!
Expand Down

0 comments on commit 36fc35a

Please sign in to comment.