Am encountering a weird bug, well I think. I was having issues with a clip-path via a referenced SVG element not being applied when I applied a filter to the same element so I started investigating.
It was not the filter causing issues. It took me a while to find this as my clip-path was a full rect that somehow worked without filter. See my post here.
I found out that in Firefox the clip-path is not applied at all, even without the filter. Somehow the clip-path only works if I reference the SVG#id in the HTML via <style></style>
. It fails to work if I <link rel="stylesheet" href="style.css">
although all other CSS is being applied.
Since codepen and jsfiddle work with <style>
I can't create and example. Please download the files here to test: Dropbox
I have created an external css file and and an line style
<style type="text/css">
XXX.triangle {
position: absolute;
width: 200px;
height: 200px;
margin: 10px;
background: red;
-webkit-clip-path: url(#absolute_path);
-moz-clip-path: url(#absolute_path);
-o-clip-path: url(#absolute_path);
clip-path: url(#absolute_path);
}
</style>
First try the files in Firefox as downloaded. You'll see a red square. Then change XXX.traingle to .triangle in the <style>
in the HTML file and reload. Voila, a red triangle.
What might be causing this? And more, how could I fix this without having to define in <style>
? I need to build components so this kinda messes things up.