From 351d11dd9f1e6d05efa8de1e6587cdf56d68d732 Mon Sep 17 00:00:00 2001 From: Oliver Byford Date: Tue, 23 Apr 2019 16:40:53 +0100 Subject: [PATCH] Link colour palette to compatibility mode --- src/helpers/_colour.scss | 1 + src/settings/_colours-palette.scss | 6 +++++- src/settings/colours.test.js | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/helpers/_colour.scss b/src/helpers/_colour.scss index 2fc311e73c..b6f9ae708e 100644 --- a/src/helpers/_colour.scss +++ b/src/helpers/_colour.scss @@ -1,3 +1,4 @@ +@import "../settings/compatibility"; @import "../settings/colours-palette"; @import "../settings/colours-organisations"; diff --git a/src/settings/_colours-palette.scss b/src/settings/_colours-palette.scss index c7b6c03ec0..4e16625147 100644 --- a/src/settings/_colours-palette.scss +++ b/src/settings/_colours-palette.scss @@ -11,7 +11,11 @@ /// @type Boolean /// @access public -$govuk-use-legacy-palette: true !default; +$govuk-use-legacy-palette: if(( + $govuk-compatibility-govukfrontendtoolkit or + $govuk-compatibility-govuktemplate or + $govuk-compatibility-govukelements + ), true, false) !default; /// Legacy colour palette /// diff --git a/src/settings/colours.test.js b/src/settings/colours.test.js index 15efd83f34..7c6f9ffa9f 100644 --- a/src/settings/colours.test.js +++ b/src/settings/colours.test.js @@ -15,6 +15,7 @@ const sassConfig = { describe('Organisation colours', () => { it('should define websafe colours that meet contrast requirements', async () => { const sass = ` + @import "settings/compatibility"; @import "settings/colours-palette"; @import "settings/colours-organisations"; @import "settings/colours-applied";