linear-gradient( [ <angle> | to <side-or-corner> ,]? <color-stop-list> )
linear-gradient( [<angle> | to <side-or-corner>, ] ? [ <color-stop> [ , <color-hint>]?, ]# <color-stop> )
Things to remember:
<color-stop>
includes color and 0, 1, or 2 <length-percentage>
radial-gradient( [ <ending-shape> || <size> ]? [ at <position> ]? , <color-stop-list> )
radial-gradient( [ <shape> || <size> ]? [ at <position> ]? [ <color-stop> [, <color-hint>]?, ]# <color-stop> )
Things to remember:
<color-stop>
includes color and 0, 1, or 2 <length-percentage>
conic-gradient( [ [ from <angle> ]? [ at <position> ]?, ] <angular-color-stop-list> )
<color-stop>
includes color and 0, 1, or 2 <angles>
<color> [ <length> || <percentage> ]{0, 2}
Create a band of non-transitioning solid color between two transitions, include two positions for the color stop.
linear-gradient(red, purple, magenta);
linear-gradient(red 10%, purple 30% 70%, magenta 90%);
linear-gradient(red 0 10%, purple 30% 70%, magenta 90% 100%);
linear-gradient(red 10%, purple 10% 90%, magenta 90%);
linear-gradient(red 0 10%, purple 10% 90%, magenta 90% 100%);
linear-gradient(rebeccapurple, magenta);
linear-gradient(rebeccapurple, 50%, magenta);
linear-gradient(rebeccapurple, 70%, magenta);
linear-gradient(rebeccapurple, 90%, magenta);
linear-gradient(rebeccapurple, 100%, magenta);
linear-gradient( [<angle> | to <side-or-corner>, ]? [ <color-stop> [, <color-hint> ]?, ]# <color-stop> )
Gradient progresses toward the declared side or corner.
to [left | right] || [top | bottom]
to top to bottom to left to right to top left to top right to bottom left to bottom right
background: linear-gradient( rebeccapurple 50%, magenta 50%);
<side-or-corner> to top to bottom to left to right to top left to top right to bottom left to bottom right
linear-gradient([<angle>| to <side-or-corner>,]? [<color-stop>[, <color-hint>]?, ]# <color-stop>)
to top
45%
is NOT the same as to top right
deg
is requiredbackground: linear-gradient( rebeccapurple 50%, magenta 50%);
background: linear-gradient(rebeccapurple 50%, magenta 50%);
background-color: rebeccapurple; background-image: linear-gradient( rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 50%), linear-gradient(to right, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 50%); background-size: 100px 100px, 100px 100px;Change the color above
In the next slide edit the code to
make a background gradients.
Would this be an effective background image for content?
repeating-linear-gradient([<angle>| to <side-or-corner>,]? [<color-stop>[, <color-hint>]?, ]# <color-stop>)
Things to remember:
radial-gradient([<shape> || <size>{0,2}]? [ at <position>{1,2}]? [<color-stop>[, <color-hint>]?, ]# <color-stop>)
Things to remember:
<size> == [ <width-height> ] || [ <width> <height> ]
background-position
Two options:
declared explicitly, or implied via size declaration
<shape> == ellipse || circle
closest-side | closest-corner | farthest-side | farthest-corner
using keywords and position, make a circle with a 100px radius
repeating-radial-gradient([<shape>|| <size> at <position>]? [<color-stop>[, <color-hint>]?, ]# <color-stop>)
Things to remember:
conic-gradient([from <angle>]? [ at <position>{1,2}]? [<angle-color-stop>[, <color-hint>]?, ]# <angle-color-stop>)
Things to remember:
background-position
1) create a conic gradient with a soft transition from the 0% to the 100% 2) Create a pie chart.
repeating-conic-gradient([from <angle>]? [ at <position>{1,2}]? [<angle-color-stop>[, <color-hint>]?, ]# <angle-color-stop>)
Things to remember:
Let's design the back of our playing cards.
visibility: hidden
temporarily, so you can see the back of your cards.visibility: hidden
temporarily, so you can see the back of your cards.
face { font-size: 2em; visibility: hidden; }
:root { --theme: red; }
background-image: linear-gradient(-45deg, var(--theme) 25%, transparent 25% 75%, var(--theme) 75%), linear-gradient(-45deg, var(--theme) 25%, transparent 25% 75%, rgb(255, 255, 255) 75%), linear-gradient(45deg, var(--theme) 17%, transparent 17% 25%, var(--theme) 25% 36%, transparent 36% 64%, var(--theme) 64% 75%, transparent 75% 83%, var(--theme) 83%);
.back { background-image: linear-gradient(-45deg, var(--theme) 25%, transparent 25% 75%, var(--theme) 75%), linear-gradient(-45deg, var(--theme) 25%, transparent 25% 75%, rgb(255, 255, 255) 75%), linear-gradient(45deg, var(--theme) 17%, transparent 17% 25%, var(--theme) 25% 36%, transparent 36% 64%, var(--theme) 64% 75%, transparent 75% 83%, var(--theme) 83%); background-color: rgb(255, 255, 255); background-size: 2em 2em; background-position: -1em -1em; }