Skip to content

Commit

Permalink
Safari switches and clip-path
Browse files Browse the repository at this point in the history
Resolve xoseperez#1028
Safari only supports clip-path with `-webkit-` prefix: https://caniuse.com/#search=clip-path
I assume `clipPath` === `clip-path`, [docs only mention css property with dash and svg elem without](https://developer.mozilla.org/ru/docs/Web/CSS/clip-path)
  • Loading branch information
mcspr authored Jul 5, 2018
1 parent b44258a commit 1dc41f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/html/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,10 +820,12 @@ function initCheckboxes() {
var setCheckbox = function(element, value) {
var container = $(".toggle-container", $(element));
if (value) {
container.css("clipPath", "inset(0 0 0 50%)");
container.css("clip-path", "inset(0 0 0 50%)");
container.css("-webkit-clip-path", "inset(0 0 0 50%)");
container.css("backgroundColor", "#00c000");
} else {
container.css("clipPath", "inset(0 50% 0 0)");
container.css("clip-path", "inset(0 50% 0 0)");
container.css("-webkit-clipPath", "inset(0 50% 0 0)");
container.css("backgroundColor", "#c00000");
}
}
Expand Down

0 comments on commit 1dc41f6

Please sign in to comment.