Skip to content

Conversation

@pd431
Copy link

@pd431 pd431 commented Oct 13, 2025

We've had the need to enforce traditional link colors separately from the main brand color as defined by boostunion.

This snippet excludes most UI elements, like headers, buttons and dropdowns, and colors the rest. Will show blue or purple links for visited/unvisted content.

Does not apply inside the text editors, as they're loaded as iframes and don't pull in the full boost-union SCSS.

Will show blue or purple links for visited/unvisted content.
Copy link
Member

@abias abias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pd431,

many thanks for submitting this contribution, this is highly appreciated!

I have just added several comments to the file with improvement requests.
Additionally, you will find the linter results on https://github.com/moodle-an-hochschulen/moodle-theme_boost_union_snippets/pull/5/checks

I hope that you will be able to resolve these glitches in reasonable time. Afterwards, the snippet is ready to land.

Please bear with us with these change requests. We are just setting up the contribution processes for this repo and will provide better contribution documentation as soon as we have learnt what contributors need.

Cheers,
Alex

* Goal: accessibility
* Description: Makes most links across the site blue and underlined, and purple if visited. Includes activity links, but excludes section titles, buttons and other link controls across the site
* Creator: Pierre Camaly de Brosses
* Tracker issue: <snippet tracker issue>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can omit this line if your snippet is not targetted to any Moodle core tracker issue.

* Creator: Pierre Camaly de Brosses
* Tracker issue: <snippet tracker issue>
* Tested on: Moodle 4.5, Firefox, Chrome and Safari
* Usage note: None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can omit this line if there isn't any special to consider when using this snippet

* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

@mixin UI-elements {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building the SCSS snippet with a mixin is generally fine, but please use a more unique mixing name with all lowercase characters. The reason is that the SCSS snippet will be added to the full SCSS stack of Boost Union and we want to avoid any name clashes.
Something like @mixin busnippet-accessiblelinks-uielements should be fine.

@@ -0,0 +1,49 @@
/**
* Snippet Title: Accessible Link Colors
* Scope: global
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your snippet uses the .pagelayout-incourse, .pagelayout-course selectors. But here you are saying Scope: global and in the description you are saying across the site.

I am wondering what intention really is. If this snippet should have a global scope, then the CSS selectors are wrong. If this snippet should have a course scope, then the comments here should be fixed.
I would be fine with both.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote that code last year and forgot the logic I'd put in it. Course scope is definitely correct. I've been describing it as "across the site" internally, as that makes most sense to colleagues, so did this out of habit without thinking.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to now, the snippet files are named with snake case.
If you could change the file names to accessible_links.*, that would be highly appreciated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you create a more clearer screenshot?
If you shrink the width of the browser window to reduce whitespace and create the screenshot with original resolution, it should be better to understand what the snippet will change.

pd431 added 6 commits October 23, 2025 14:00
Conformed name to snake case,
adjusted scope to course only, clarified description
adopted more unique mixin link
cleaned up indentation and spaces
moved from 2 spaces to 4
removed indentation in the mixin
@pd431
Copy link
Author

pd431 commented Oct 23, 2025

Apologies for the sucessive commits, I have no experience in writing linted code.
Passes all automated checks now, screenshot was updated, hopefully there is a better focus on the blue/purple color.
I've updated the description, scope, mixin name and file names, let me know if there's any extra feedback :D

@pd431 pd431 requested a review from abias October 23, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants