Comments (5)
Just normal style props.
Here's my before & after in case you find it helpful (playground link).
I ended up starting mostly from scratch since there were so many small issues (definitely not a knock; this library is amazing).
Some of the issues I ran into include:
- flexbox
gap
property unsupported vmin
,vmax
,vw
,vh
units silently unsupported- specifying
fontSize
inem
didn't seem to take effect - the
div
must explicitly declaredisplay: flex
error came up a lot and is pretty annoying, though I understand the intent behind it since it differs from the normal HTML spec backgroundSize: cover
not supportedposition: absolute
doesn't seem to respect it's nearestrelative
ancestor; e.g,. it always is relative to the document root- I had issues getting the local next.js version to display the same as the playground, presumably since they're both using slightly different versions of Satori and the lib is new + updating frequently. Some things like
filter: blur(8px)
+transform: scale(1.1)
would work on the playground but not with the latest version of next.js. Not sure there's much that can be done with these sorts of things aside from just maturing the libs, but I wanted to at least call it out.
None of these issues is a big deal; the real pain is that they're all silent, and the only way to figure out what works & what doesn't is through trial & error.
I know some of the compatibility issues are covered in the readme already and this list goes outside the scope of this issue, but I'm just giving feedback on my experience and hope you find it helpful.
from satori.
There are some cases where a CSS rule is used for compatibility reason like -webkit-*
(the component can be used by both Satori and Next.js). But I think it should be easy to filter them out.
from satori.
This is something I'm running into quite a bit when porting headless chrome OG image templates over to Satori.
The process currently involves lots of trial & error to figure out which properties aren't being handled properly, whereas I'd rather fail-fast — or at least have some prominent warnings to go off of.
from satori.
@transitive-bullshit Are you using Tailwind mode or just the normal style prop?
from satori.
Thanks for the great feedback @transitive-bullshit! I think most of these can be improved in future updates.
from satori.
Related Issues (20)
- `filter: "blur(...)"` doesn't work as expected with Satori + resvg-js HOT 2
- Image mask causing image to be hidden behind other SVG elements HOT 2
- CDN image not rendering
- Support `font-feature-settings`
- Custom fonts not rendered correctly
- Support -webkit-text-stroke HOT 1
- Option to keep font-family case-sensitive
- Custom Font files not loaded on Vercel Edge Function
- Error with linear-gradient HOT 2
- @vercel/og will not work on edge outside of next - noto-sans-v27-latin-regular.ttf HOT 4
- Using CSS `border`, images are broken and exposed
- Optional TailwindCSS
- Functionality for getting bounding box of text from satori
- 2x faster with SatoriOptions.fonts as a global variable HOT 2
- Title HOT 1
- Image in SVG doesn't work when exported to PNG HOT 10
- Transparent linear gradient rendered incorrectly HOT 2
- `word-break: keep-all` breaks when used with `text-wrap: balance`
- Satori cannot render svg data URI with comma inside
- Misplacement text when Embed Font is turned off
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from satori.