I am trying to activate the “DETAILS” native Tiptap extension.
So following this guide Extensions | Umbraco CMS is a good start, and it brought me to the point where we have a toggle for details in the toolbar that actually works.
Obviously the button needs some styling, and there’s a lot more to improve.
At this point I’m unsure if Tiptap should have “brought” any styles of it own to make this look better but I assume this is expected and thus I move to the next step to solve it.
This is the main typescript file of my extension. The equivalent from the tutorial here is the file highlight.tiptap-api.js :
import { UmbTiptapExtensionApiBase } from "@umbraco-cms/backoffice/tiptap";
import { Details } from "@tiptap/extension-details";
import { DetailsContent } from "@tiptap/extension-details-content";
import { DetailsSummary } from "@tiptap/extension-details-summary";
import { Highlight } from '@tiptap/extension-highlight';
import './styles.css';
export default class UmbTiptapDetailsExtensionApi extends UmbTiptapExtensionApiBase {
getTiptapExtensions = () => [Highlight, Details.configure({
persist: true
}), DetailsContent, DetailsSummary];
}
Note the styles import. This is from what I gather the proper way to introduce styles.
However, I can’t figure out how to get the styles imported in the backoffice.
No matter what styles I apply, I can’t see any effect of them and I can’t see any css file regarding this component being loaded.
Does anyone here know how to include css the import way like above and actually have the backoffice load it?
The vite build results in the css file in my App_Plugins folder, and I’ve also tried a variant where I make sure that css file has a hash in the filename like the other generated js files for example. It is never loaded however.
I cannot get the paragraph lead style to work, so need to find out a way I can add custom styles that can be selected in the RTE by editors etc. Not sure if this will help.