2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-14 18:42:30 +03:00

Backport "Use escape-svg() function (#29077)"

Adapted for v4-dev.
This commit is contained in:
Martijn Cuppens
2019-07-20 04:57:12 +03:00
committed by XhmikosR
parent 68ab243ffa
commit c26e68427c
8 changed files with 44 additions and 22 deletions
+11
View File
@@ -48,6 +48,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);