Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 36d3c8b

Browse files
julien-deramondromankupchak93
authored andcommitted
Docs: add shift-color() usage example in sass customization page (twbs#39435)
1 parent 4a8d09f commit 36d3c8b

File tree

1 file changed

+7
-0
lines changed
  • site/content/docs/5.3/customize

1 file changed

+7
-0
lines changed

site/content/docs/5.3/customize/sass.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ Next to the [Sass maps]({{< docsref "/customize/color#color-sass-maps" >}}) we h
244244

245245
You can lighten or darken colors with Bootstrap's `tint-color()` and `shade-color()` functions. These functions will mix colors with black or white, unlike Sass' native `lighten()` and `darken()` functions which will change the lightness by a fixed amount, which often doesn't lead to the desired effect.
246246

247+
`shift-color()` combines these two functions by shading the color if the weight is positive and tinting the color if the weight is negative.
248+
247249
{{< scss-docs name="color-functions" file="scss/_functions.scss" >}}
248250

249251
In practice, you'd call the function and pass in the color and weight parameters.
@@ -256,6 +258,11 @@ In practice, you'd call the function and pass in the color and weight parameters
256258
.custom-element-2 {
257259
color: shade-color($danger, 30%);
258260
}
261+
262+
.custom-element-3 {
263+
color: shift-color($success, 40%);
264+
background-color: shift-color($success, -60%);
265+
}
259266
```
260267

261268
### Color contrast

0 commit comments

Comments
 (0)