#Troubleshooting TextStateFeature: Rendering Colors in Frontend

11 messages · Page 1 of 1 (latest)

fair ridgeBOT
#

Did you ever get this working? I'm not sure what I need to pass to render the colours

Just in case anyone else knows how to, this is for the TextStateFeature for the frontend, what do I need to pass into the jsxConverters to get the colours to render? It looks great in the backend but nothing pulls through the front

cyan dewBOT
#

Original message from @cinder trellis - Moved from #general message

cinder trellis
cinder trellis
#

I have followed the guide here: https://nlvcodes.com/tutorials/payload-s-text-state-feature-explained , and the video too

Copied word for word but it just doesn't render at all

Obviously that guide is nearly a year old but it's the newest thing I could find, other than githubs asking the same thing but with no replies like: https://github.com/payloadcms/payload/discussions/14273

Learn how to use the TextStateFeature in Payload CMS to add inline styles such as color, background, font weight, and more to your Lexical editor.

GitHub

I added this: TextStateFeature({ state: { color: { ...defaultColors.text, }, background: { ...defaultColors.background, }, }, }) in defaultLexical.ts. In the editor, the toolbar appears and I can a...

#

Also tried this, nothing again

light fulcrum
#

Hey @cinder trellis I created this gist with the files that you can reference to get this working! Truth be told I ran into the same thing, I could see my colors in Payload admin, but no changes on the frontend.

Take a look and let me know if this helps!

https://gist.github.com/zubricks/aaf48987da076a3dcc3bc041990a1992

Gist

TextState Feature. GitHub Gist: instantly share code, notes, and snippets.

cinder trellis
light fulcrum
#

Go into payload? Like as an example, or in the docs?

cinder trellis