-
-
Save 36degrees/ae651a5fec495020c85129b4b40a80c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Map of colours to hex values | |
$_govuk-colours: ( | |
purple: #2e358b, | |
mauve: #6f72af, | |
fuschia: #912b88, | |
pink: #d53880 | |
// etc | |
); | |
// Map of deprecated colours and the version in which they will be removed | |
$_govuk-colours-deprecated: ( | |
purple: "2.0.0" | |
); | |
// Helper function to look-up a colour from the list. Should always use this | |
// function rather than referencing the map directly. | |
@function govuk-colour($colour) { | |
@if (map-has-key($_govuk-colours-deprecated, $colour)) { | |
$version: map-get($_govuk-colours-deprecated, $colour); | |
@warn "The colour #{$colour} is deprecated and will be removed in v#{$version}"; | |
} | |
@return map-get($govuk-colours, $colour); | |
} | |
.app-button { | |
background: govuk-colour(purple); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment