This repository has been archived by the owner on Nov 17, 2021. It is now read-only.
Releases: Financial-Times/o-colors
Releases · Financial-Times/o-colors
patch: Fix registry demos. Allow red tones.
Allow red to be toned red returns a hue of 0, check for saturation too so we error for black/white colours
patch: Make automated publishing from GitHub Action work
v5.2.1 use a token which is not the default token so that other actions can …
minor: Allow custom colour tones
Allow custom colour tones (#255) By default colours do not allow tones to reduce the number of colours used within a project. To allow tones of custom colours `oColorsSetColor` has a new option `allow-tones`. ```scss // Set a custom palette colour within a project `o-example`, // which allows tones of the same colour. @include oColorsSetColor( $color-name: 'o-example/myhotpink', $color-value: #ff69b4, $opts: ('allow-tones': true) ); .example { // Get a toned custom palette colour from a project `o-example`. background-color: oColorsGetTone('o-example/myhotpink', 80); } ``` Our tones work by modifying the brightness value of our palette colours in the HSB colour space. The previous major, v4, included a separate function to return a hex value for given HSB values (hue, saturation, and brightness). When calculating tones we would use the given tone value as the HSB brightness, whilst the HSB saturation and hue was configured elsewhere in the codebase for each of our colours that allow tones. v4 o-colors HSB function for reference: https://github.com/Financial-Times/o-colors/blob/4b82f494361266d93b650134e1e5d6b012d0a170/src/scss/_mixins.scss#L121 v4 colour palette HSB saturation configuration: https://github.com/Financial-Times/o-colors/blob/v4.10.3/src/scss/_palette.scss#L146 When working on the v5 major we didn't connect the dots and configured the HSB saturation as a "each colour has a different saturation starting point for some reason" ¯\_(ツ)_/¯ https://github.com/Financial-Times/o-colors/blob/ab4c18416bb77da1c07308e01f98059c4fa9c0c8/src/scss/_functions.scss#L113 To support tones of custom colours our users would have to provide the HSB saturation when setting a custom colour. Instead, this commit calculates the HSB saturation and removes the configuration. It also separates out the HSB function from the tone function again for code clarity. The only public change here is a new option to `oColorsSetColor`.
patch: add eslint config to repo to integrate with text editors
v5.1.2 updating lockfile
v5.1.1
Added mandarin to internal brand (#247)
v5.1.0
v5.0.6: Fix whitelabel demos. (#243)
`o-syntax-highlight` does not support the whitelabel brand. It cannot be included as a dependency to whitelabel brand demos. Fixes: https://github.com/Financial-Times/o-colors/issues/236 Co-authored-by: Jake Champion <[email protected]>
v5.0.5: Add condition to default mixins to ensure they're only run once (#240)
As this component is likely to be included by many other components the nested loops inside of these mixins can have a drastic effect on project build performance. For example the Sass build step for the FT.com search page app can currently take over 40 seconds but only 1-3 seconds after.
v5.0.4
v5.0.3: Allow custom colours to be set twice, if the value is unchanged. (#238)
We do not allow custom colours to be overriden. However, components may be included by a project's dependencies multiple times. This means custom colours may be set multiple times by the same component. So, only error if a custom colour is set with a _different_ value. https://github.com/Financial-Times/o-colors/issues/237