

You can achieve the same effect by offsetting the color stops. Unlike in Gecko, in legacy WebKit you cannot specify both a position and angle in -webkit-linear-gradient(). As of WebKit 534.16, it also supports the standard gradient syntax. WebKit since 528 supports the legacy -webkit-gradient(linear,…) function. Internet Explorer 5.5 through 9.0 supports proprietary filter: progid:() filter. Rendering of color-stops in CSS gradients follows the same rules as color-stops in SVG gradients. This value is comprised of a value, followed by an optional stop position (either a percentage between 0% and 100% or a along the gradient axis). The end-point of the gradient line is the symmetrical point of the starting-point on the other direction of the center box. This is sometimes called the " magic corner" property. That way, the color described by the will exactly apply to the corner point. The others are translated into an angle that causes the starting-point to be in the same quadrant as the described corner so that the line defined by the starting-point and the corner is perpendicular to the gradient line. The values to top, to bottom, to left and to right are translated into the angles 0deg, 180deg, 270deg, 90deg respectively. The order is not relevant and each of the keyword is optional. It consists of two keywords: the first one indicates the horizontal side, left or right, and the second one the vertical side, top or bottom. Repeating-linear-gradient(0deg, blue, green 40%, red) /* A repeating gradient going from the bottom to top, starting blue,īeing green after 40% and finishing red */ Values Represents the position of the starting-point of the gradient line. Repeating-linear-gradient(to left top, blue, red) /* A repeating gradient going from the bottom right to the top left

Repeating-linear-gradient(45deg, blue, red) /* A repeating gradient on 45deg axe starting blue and finishing red */ Creates two color stops, start and end, by specifying a color and position for each color gradient-x ( $start-color : $gray-700, $end-color : $gray-800, $start-percent : 0 %, $end-percent : 100 % ) Utilities APIīackground utilities are declared in our utilities API in scss/_utilities.scss. Horizontal gradient, from left to right This gradient starts with a semi-transparent white which fades out to the bottom.ĭo you need a gradient in your custom CSS? Just add background-image: var(-bs-gradient). bg-gradient class, a linear gradient is added as background image to the backgrounds. bg-transparent Background gradientīy adding a.
