Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work in Firefox at all #13

Open
alexey-milovidov opened this issue Apr 24, 2022 · 6 comments
Open

Does not work in Firefox at all #13

alexey-milovidov opened this issue Apr 24, 2022 · 6 comments

Comments

@alexey-milovidov
Copy link

Screenshot_20220424_064533

98.0.2 (64-bit)
Mozilla Firefox for Ubuntu

@alexey-milovidov
Copy link
Author

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.

@wjd3
Copy link

wjd3 commented Apr 26, 2022

@alexey-milovidov
Copy link
Author

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

@PavelLaptev
Copy link
Owner

@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

@bsimone
Copy link

bsimone commented Jun 13, 2022

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;
  }

@saibotsivad
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants