Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

Merge remote-tracking branch 'origin/main' into pr23

nyblnetb984027d3ae4
diff --cc slides/src/render.ts
index c0620b9a,abb8b4e1..1d90dd0d
--- a/slides/src/render.ts
+++ b/slides/src/render.ts
@@@ -420,15 -419,12 +428,21 @@@ export function renderElement(el: Slide
inner.style.fontSize = `${el.fontSize}px`
inner.style.fontFamily = el.fontFamily || doc.theme.fontFamily
inner.style.fontWeight = String(el.fontWeight)
- inner.style.color = el.color
+ const cg = el.colorGradient
+ if (cg && cg.stops && cg.stops.length) {
+ inner.style.backgroundImage = cssLinearGradient(cg)
+ inner.style.setProperty('-webkit-background-clip', 'text')
+ inner.style.setProperty('background-clip', 'text')
+ inner.style.color = 'transparent'
+ } else {
+ inner.style.color = el.color
+ }
++ // text-stroke composes on top: outline the glyphs (over gradient or solid fill)
+ const ts = el.textStroke
+ if (ts && ts.width) {
+ inner.style.setProperty('-webkit-text-stroke', `${ts.width}px ${ts.color}`)
+ if (ts.fill === 'none') inner.style.color = 'transparent'
+ }
inner.style.textAlign = el.align
inner.style.lineHeight = String(el.lineHeight)
if (el.letterSpacing) inner.style.letterSpacing = `${el.letterSpacing}px`