Template:Radial-gradient/doc

From Official Kodi Wiki
< Template:Radial-gradient
Revision as of 16:17, 5 February 2012 by >[email protected] (Create /doc)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Under construction

This template creates a radial gradient background. This currently works in Firefox (3.6 and up), Safari (5.1 and up), Google Chrome (10 and up) and Internet Explorer 10. Opera does not support radial gradients.

Usage

Use within a CSS style tag. The template uses the background-image property.

<div style="{{radial-gradient | position | shape | #color [stop], #color [stop][, #color [stop], ...] }}">Lorem ipsum...</div>

  1. position – Mandatrory. Specify the X and Y position of the center of the gradient. This can be any valid CSS position value.
  2. shape – Mandatory. Specify the shape of the gradient using keywords or dimensions. Valid keywords are: circle, ellipse, contain, cover, nearest-corner, nearest-side, farthest-corner, farthest-side.
  3. color – The first two colors are mandatory. You can define any number of additional colors, separated with commas.
  4. stop – Optional. You can specify a stop position for each color using a percentage (e.g. 45%) or pixels (e.g. 60px).

Technical notes

This template uses the new CSS3 properties for radial gradients: -moz-radial-gradient, -ms-radial-gradient, -o-radial-gradient, -webkit-radial-linear-gradient and radial-gradient.

Examples

  • <div style="{{radial-gradient|100px center|ellipse cover|#ffdddd, #ddddff}}">Lorem ipsum...</div> will produce
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  • <div style="{{radial-gradient|center|circle|#ffdddd, #ddffdd 50%, #ddddff}}">Lorem ipsum...</div> will produce
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  • <div style="{{radial-gradient|top|ellipse|#ffdddd, #ddddff}}">Lorem ipsum...</div> will produce
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Considerations

Above examples use contrasting colors to show the effect more clearly. It is best to use subtle differences in color to enhance the appearance, rather than radically change it. This also minimizes the effects between browsers that do and do not support gradients.

See also