Gradients
import { gradient } from '@sky-uk/ui-core';
Basic Usage Example
You can use the gradient
function to get color stops from the theme by name.
gradient('primary');// returns['#000FF5', '#000FBE'];
Available Gradients
Brand
- #ff8c00
- #f80032
- #ff00a0
- #8c28ff
- #0023ff
- #19a0ff
Sky
Gradient key sky
- #ff7800
- #f80032
- #ff00a0
- #8c28ff
- #0023ff
- #1798ff
Sky - accessible
Gradient key sky.accessible
- #000ff5
- #000fbe
Primary
Gradient key primary
- #1aab31
- #17992c
Environmental
Gradient key environmental
Products
- #6e00ff
- #ff00a5
Broadband
Gradient key products.broadband
- #000ff5
- #00e6ff
Business (previously Connect)
Gradient key products.business
- #000ff5
- #47c5ff
Business - accessible (previously Connect)
Gradient key products.business.accessible
- #091153
- #0c1b87
Glass
Gradient key products.glass
- #ff00a5
- #ff0a50
- #ff6400
Mobile
Gradient key products.mobile
- #ff00a5
- #ff0a50
- #f56400
Mobile - accessible
Gradient key products.mobile.accessible
- #ff2800
- #ff371e
- #ff9600
Protect
Gradient key products.protect
- #ff2800
- #f56400
Protect - accessible
Gradient key products.protect.accessible
- #000ff5
- #00d2ff
TV
Gradient key products.tv
- #000ff5
- #0096ff
TV - accessible
Gradient key products.tv.accessible
- #001211
- #00818a
NOW TV
Gradient key products.nowtv
Channels
- #000000
- #000000
Arts
Gradient key channels.arts
- #003264
- #27749d
Atlantic
Gradient key channels.atlantic
- #5c0f39
- #80082c
Box
Gradient key channels.box
- #ff5200
- #ff5200
Challenge
Gradient key channels.challenge
- #ff0031
- #9b0031
Cinema
Gradient key channels.cinema
- #ff8200
- #ff8200
Comedy
Gradient key channels.comedy
- #182935
- #31576b
Crime
Gradient key channels.crime
- #e90000
- #e90000
Documentaries
Gradient key channels.documentaries
- #6626a1
- #4c0080
Kids
Gradient key channels.kids
- #8c00ff
- #ff5e1d
Max
Gradient key channels.max
- #2b6300
- #3e8f00
Nature
Gradient key channels.nature
- #041957
- #122d74
News
Gradient key channels.news
- #0080df
- #079ef8
One (replaced by Sky Max)
Gradient key channels.one
- #361740
- #763175
Pick
Gradient key channels.pick
- #021158
- #122476
Sports
Gradient key channels.sports
- #003268
- #073fa0
Store
Gradient key channels.store
- #0d0d0d
- #262626
Witness
Gradient key channels.witness
Areas
- #0644a1
- #862e81
Service
Gradient key service
Loyalty
- #708186
- #a1acb2
One
Gradient key loyalty.one
- #c88b2e
- #e6bb63
Two
Gradient key loyalty.two
- #6e6c89
- #8d8dbe
Three
Gradient key loyalty.three
- #191919
- #474747
Four
Gradient key loyalty.four
Regional Variations
DE
- #065730
- #0ba158
Bundesliga DE
Gradient key regional.de.bundesliga
- #065730
- #08713e
Bundesliga DE - accessible
Gradient key regional.de.bundesliga.accessible
- #0014ff
- #00d7ff
Business DE
Gradient key regional.de.business
- #990033
- #cb0033
Cinema DE
Gradient key regional.de.cinema
- #990033
- #cc0027
Cinema DE - accessible
Gradient key regional.de.cinema.accessible
- #4c0080
- #6626a1
Entertainment DE
Gradient key regional.de.entertainment
- #ff6218
- #ffa300
Kids DE
Gradient key regional.de.kids
- #c1481b
- #996200
Kids DE - accessible
Gradient key regional.de.kids.accessible
- #000000
- #555555
Non Sky DE
Gradient key regional.de.nonSky
- #000ff5
- #0096ff
Ultimate TV DE
Gradient key regional.de.ultimateTv
Return Types
The gradient
function also supports a second argument, which sets the return type.
If you pass 'text'
as a string to the second argument then it will return a css block that is suitable for applying gradients to text:
styled.div`${gradient('primary', 'text')}`;// returns.c0{@supports (-webkit-background-clip: text) or (background-clip: text) {background-image: linear-gradient(to right, #000FF5 0%, #000FBE 100%);background-clip: text;-webkit-background-clip: text;-webkit-text-fill-color: transparent;}}
If you pass 'background'
as a string to the second argument then it will return a line of css, setting the background-image of the component to a gradient:
styled.div`${gradient('primary', 'background')}`;// returns.c0{background-image: linear-gradient(to right, #000FF5 0%, #000FBE 100%);}