[Feature]: Inline text styling within a single text element
Problem
Hi,
First of all, thank you for your work on Instatic CMS.
I would like to suggest adding support for inline text styling within a single text element.
Problem
Currently, it does not seem possible to apply different styles inside the same text block. For example, within one paragraph or heading, I would like to be able to style specific words differently.
Expected behavior
It would be very useful to have the ability to apply inline styles such as:
Different font families for specific words Different colors within the same text element Underline Bold / italic Highlighted text Possibly other inline formatting options
For example:
This sentence could contain one word in another font, another word in a different color, and another one underlined.
Why this matters
As a web developer with more than 10 years of experience, I believe this is an essential feature for building flexible and visually refined websites.
In real-world web design, it is very common to need mixed typography or color variations inside the same text element. Splitting the content into multiple separate blocks is usually not ideal because it can make content harder to manage, affect semantic structure, and create layout issues.
Having span-level styling inside rich text would make the CMS much more powerful for designers, developers, and content editors.
Proposed solution
Possible implementation
This could be handled through a richer text editor that supports inline marks or spans, allowing each text selection to have its own style properties.
Thanks again for the project, and I hope this feature can be considered.
Alternatives considered
No response
Area
Visual editor
I agree that this is needed, but it already is possible to do. It takes a few steps but it's not very hard to do and is very flexible.
You can switch your HTML tag of text to none, which essentially removes any wrapper and produces just the text content (so classes and styles won't work until it has some tag), you can wrap several text elements that has none tag, with a container that you switch to "p" tag (or h1, h2, etc). Then you can switch one of those text elements to span, or whatever you want and style it.
Try it out, and let me know what you think.
Hello! Thanks for the feedback. I should have specified: I did try that method, and it works, but it makes editing the content rather inconvenient.
Hi @DavidBabinec, thanks for Instatic and for the workaround you described above. We using it on a production site right now and ran into the same editing friction @Nik0w mentions: once a paragraph is split into none / strong / span text nodes, editors can no longer click into the paragraph and type across the formatting, and toggling bold off means restructuring nodes in the Layers panel.
We built an editor-side solution and have been running it in production on top of v0.0.20. I'd like to propose it upstream. Before opening the PR, I wanted to check that the approach fits your plans for this issue.
Approach: an editor layer over the existing node model, with no data-model change
- Double-clicking a paragraph opens it as one rich text. The paragraph can be a
p/h1–h6/licontainer whose children are only text and childless link nodes, or a singlebase.textparagraph. The editor is a lazily loaded, restricted TipTap instance mounted in the canvas iframe. - Selecting words opens a small floating menu: bold, italic, link and "clear formatting", with shortcuts. The link panel supports page references (
cms:page:<id>) and validated URLs. - On commit, the result is written back as the same structure your workaround produces: a container plus
base.text/base.link/brchildren. It is normalized (empty nodes dropped, neighbours merged, back to a singlebase.textwhen no formatting is left) and recorded as one undo step. - The publisher, the HTML import, the MCP tools and the stored JSON are unchanged. Untouched paragraphs publish byte-identically.
- A new site setting, Text formats, decides which tag and classes each format writes. Optional "also recognize" class sets cover sites that use several equivalent classes. Nodes the editor doesn't recognize (foreign classes, inline styles, attributes) are kept untouched; only their text is editable.
- It includes a conflict guard, a presence-based "being edited" check, unit tests and a Playwright E2E spec.
It covers bold, italic and links as asked here. It does not cover per-word fonts or colours beyond what you configure as additional formats (span + class).
Would you be open to a PR along these lines? I'd split it into the feature PR plus two small independent fixes we found along the way:
- settings opened outside the site editor don't reload after a site import;
- collaborators without a display name don't publish presence.
Happy to adjust the design to whatever direction you already have in mind.