Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Releases: Financial-Times/o-colors

patch: Fix registry demos. Allow red tones.

11 Apr 00:33
Compare
Choose a tag to compare
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

09 Apr 14:23
Compare
Choose a tag to compare
v5.2.1

use a token which is not the default token so that other actions can …

minor: Allow custom colour tones

09 Apr 10:34
7f61304
Compare
Choose a tag to compare
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

24 Mar 11:38
Compare
Choose a tag to compare

v5.1.1

02 Mar 11:31
5cf2f2b
Compare
Choose a tag to compare
Added mandarin to internal brand (#247)

v5.1.0

02 Mar 09:56
6ea44bb
Compare
Choose a tag to compare
  • Add Mandarin to the Internal brand (#246)

v5.0.6: Fix whitelabel demos. (#243)

04 Feb 15:29
36c2318
Compare
Choose a tag to compare
`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)

30 Dec 21:16
Compare
Choose a tag to compare
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

10 Dec 20:14
7b21518
Compare
Choose a tag to compare
Allow custom colour usecases to be set twice, if the value is unchang…

v5.0.3: Allow custom colours to be set twice, if the value is unchanged. (#238)

26 Nov 14:19
630ef07
Compare
Choose a tag to compare
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