Comments (5)
On /test
: Text node directly under a flex container is failing
<div
style={{
display: 'flex',
height: '100%',
width: '100%',
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'column',
}}
>
Hello World
</div>
It works if you put another div
:
<div
style={{
display: 'flex',
height: '100%',
width: '100%',
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'column',
}}
>
<div>Hello World</div>
</div>
from satori.
@chibicode that should be fixed with #16 🎉
from satori.
Update: Fixed in #7
- In this example, seems like the
height
of the absolutely positioned square is affecting the position of the center square
CleanShot.2022-02-04.at.03.05.24.mp4
export default function Card({ withSatori }) {
return withSatori(
<div
style={{
display: 'flex',
height: '100%',
width: '100%',
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'column',
}}
>
<div
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
width: 100,
height: 100,
textAlign: 'center',
backgroundColor: '#000',
}}
>
</div>
<div
style={{
left: 0,
top: 0,
position: 'absolute',
display: 'flex',
alignItems: 'center',
}}
>
<span
style={{
width: 100,
height: 100,
background: 'black',
}}
/>
</div>
</div>
)
}
- Also, this doesn't seem to work:
CleanShot.2022-02-04.at.03.19.02.mp4
export default function Card({ withSatori }) {
return withSatori(
<div
style={{
display: 'flex',
height: '100%',
width: '100%',
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'column',
}}
>
<div
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
width: 100,
height: 100,
textAlign: 'center',
backgroundColor: '#000',
}}
>
</div>
<div
style={{
left: 0,
top: 0,
position: 'absolute',
width: 100,
height: 100,
background: 'red',
}}
>
</div>
</div>
)
}
from satori.
I think that bug can be solved with #6 by adding another virtual container. However It's currently tricky because Yoga doesn't support inline/floating elements. So to support inline elements (e.g. Emoji), we currently make each "word" a node, and the parent container a flex box with wrapping enabled:
If we use a virtual container (only for text fragments), it will become:
I'll think again about this.
from satori.
Both bugs were fixed! 🎉
from satori.
Related Issues (20)
- 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
- Satori does not work with components which are using forwardRef HOT 1
- BUG: Fails to apply HSL colors with a decimal point in the hue.
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.