css-houdini-squircle icon indicating copy to clipboard operation
css-houdini-squircle copied to clipboard

Does not work in Firefox at all

Open alexey-milovidov opened this issue 2 years ago • 6 comments

Screenshot_20220424_064533

98.0.2 (64-bit) Mozilla Firefox for Ubuntu

alexey-milovidov avatar Apr 24 '22 04:04 alexey-milovidov

Is the typo in the article intentional?

I found a few really nice Houdini examples that use Pain API and decided to try to make something with it too.

alexey-milovidov avatar Apr 24 '22 05:04 alexey-milovidov

https://ishoudinireadyyet.com/

wjd3 avatar Apr 26 '22 21:04 wjd3

Ok, understood. Maybe it's possible to have a fallback to rounded corners? So the library will be readily usable across all browsers.

alexey-milovidov avatar Apr 27 '22 00:04 alexey-milovidov

@alexey-milovidov it's possible to use a polyfill, but unfortunately it's now a 100% protection https://github.com/PavelLaptev/squircle-houdini-css#use-css-paint-polyfill

PavelLaptev avatar Apr 27 '22 00:04 PavelLaptev

Ok, understood. Maybe it's possible to have a fallback to rounded corners? So the library will be readily usable across all browsers.

You can use @supports

something like

  border-radius: 13px;
  @supports (background: paint(squircle)) {
     border-radius: unset;
     mask-image: paint(squircle); mask: paint(squircle); --squircle-radius: "13px";--squircle-smooth: 1;
  }

bsimone avatar Jun 13 '22 15:06 bsimone

Just some more info, as I poked around with it today.

I'm using Firefox 109.0.1 and it's failing in this css-paint-polyfill code:

function parseCss(css) {
	let parent = styleIsolationFrame.contentDocument.body;
	let style = document.createElement('style');
	style.media = 'print';
	style.$$paintid = ++styleSheetCounter;
	style.appendChild(document.createTextNode(css));
	parent.appendChild(style);
	style.sheet.remove = () => parent.removeChild(style);
	return style.sheet;
}

It's throwing an error at the style.sheet.remove line, saying that style.sheet is undefined which doesn't make sense to me.

saibotsivad avatar Feb 07 '23 17:02 saibotsivad