1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-13 00:54:04 +02:00

Use escape-svg() function (#29077)

* Use escape-svg() function

* Update theming.md
This commit is contained in:
Martijn Cuppens
2019-07-20 03:57:12 +02:00
committed by Mark Otto
parent 28dfa54083
commit f6694b7440
9 changed files with 51 additions and 31 deletions

View File

@@ -71,6 +71,17 @@
@return $string;
}
// See https://codepen.io/kevinweber/pen/dXWoRw
@function escape-svg($string) {
@if str-index($string, "data:image/svg+xml") {
@each $char, $encoded in $escaped-characters {
$string: str-replace($string, $char, $encoded);
}
}
@return $string;
}
// Color contrast
@function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) {
$r: red($color);