Add a secondary brand colour for clubs

Mirrors primary_color: a club-picked hex highlight used for accents like
the avatar-initials badge, with a computed readable text colour so a
pale pick doesn't produce white-on-yellow text. The shared contrast math
moves into _content_color_for so both colours use the same rule.
This commit is contained in:
2026-07-27 10:26:31 +02:00
parent ccaa9e991a
commit 075c2918b6
5 changed files with 67 additions and 11 deletions

View File

@@ -1018,6 +1018,15 @@ class BrandingTests(TestCase):
def test_no_colour_means_no_override(self):
self.assertNotContains(self.login_page("ajax-united.rosterchief.app"), "--color-primary")
def test_a_club_secondary_colour_overrides_the_theme(self):
self.club.secondary_color = "#be185d"
self.club.save()
self.assertContains(self.login_page("ajax-united.rosterchief.app"), "--color-secondary: #be185d")
def test_no_secondary_colour_means_no_override(self):
self.assertNotContains(self.login_page("ajax-united.rosterchief.app"), "--color-secondary")
class ClubBrandingModelTests(TestCase):
def test_initials_use_the_first_two_words(self):