Skip to content

Rendering prose (Tailwind) for all headings and paragraphs #34

Answered by formfcw
notflip asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you for your question!

There are two ways:

  1. Add your Tailwind classes directly to the FlexibleEditorContent Vue component (https://github.com/formfcw/directus-extension-flexible-editor/tree/main/content#vue):

    <template>
        <FlexibleEditorContent
            :content="data.description"
            :componentSerializers="componentSerializers"
            :relationBlocks="relationBlocks"
            class="[&>*~*]:mt-1 [&_ul]:pl-1 [&_ul]:list-['-_'] [&_strong]:font-bold [&_a]:link whitespace-pre-line"
        />
    </template>
  2. By using a component-serializer:

    <script setup lang="ts">
        import FlexibleEditorContent, { VueComponentSerializers } from "directus-extension-flexible-editor/content/vue";
    
        //

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@notflip
Comment options

@notflip
Comment options

@formfcw
Comment options

@notflip
Comment options

@formfcw
Comment options

Answer selected by formfcw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants