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%);}