Issue with loading contentsCss in CKEDITOR with VUEJS2

Currently in the process of developing a website using Vue.js 2, we incorporated the ckeditor4-vue plugin some time ago.

An issue has recently come up regarding the font not matching the rest of the application. The preference is to default to 'Lato', sans-serif.

Upon inspection at the end of the implementation, it's evident that we utilize contentsCss in our configuration to load an internal CSS stylesheet. (Located at localhost:8080/ckeditor/content.css)

However, this doesn't seem to load as expected. Is contentsCss supported for ckeditor4-vue? Are there alternative solutions?

The ckeditor instance is currently being loaded in main.js as shown below;

...
import CKEditor from "ckeditor4-vue";
Vue.use(CKEditor);
...
const app = new Vue({
  store,
  router,
  i18n,
  render: h => h(App)
}).$mount("#app");
...

We have created a wrapper for our CKEditor component for reusability purposes, instead of defining it multiple times. This component is configured as follows; (shown in a condensed form)

<template>
  <ckeditor
    @ready="onReady"
    :value="value"
    @input="handleInput"
    :config="{ ...localConfig, readOnly: readOnly, fullPage: true }"
  >
  </ckeditor>
</template>

export default {
  name: "RTE",
  props: {
    editorConfig: {
      required: false,
      type: Object
    },
    value: {},
    targetObject: { required: true, type: String },
    targetUuid: { type: String },
    readOnly: { required: false, type: Boolean, default: false }
  },
  computed: {
    config() {
      return {
        language: i18n._vm.locale,
        toolbar: [
          // { name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
          {
            name: "basicstyles",
            items: [
              "Bold",
              "Italic",
              "Underline",
              "Strike",
              "Subscript",
              "Superscript",
              "-",
              "CopyFormatting",
              "RemoveFormat"
            ]
          },
          {
            name: "paragraph",
            items: [
              "NumberedList",
              "BulletedList",
              "-",
              "Outdent",
              "Indent",
              "-",
              "Blockquote",
              "-",
              "JustifyLeft",
              "JustifyCenter",
              "JustifyRight",
              "JustifyBlock"
            ]
          },
          { name: "links", items: ["Link", "Unlink"] },
          {
            name: "insert",
            items: ["Image", "Table", "HorizontalRule", "SpecialChar"]
          },
          "/",
          { name: "clipboard", items: ["Undo", "Redo", "-"] },
          { name: "styles", items: ["Format", "FontSize"] },
          { name: "colors", items: ["TextColor", "BGColor"] },
          { name: "tools", items: ["Maximize", "-"] },
          { name: "document", items: ["Source", "-", "Sourcedialog"] }
        ],
        extraPlugins:
          "format,font,colorbutton,justify,uploadimage,image,sourcedialog",
        uploadUrl:
          "https://a.link.com/there/needs/to/be/a/random/url/in/here",
        removePlugins: "sourcearea",
        height: 300,
        allowedContent: true,
        filebrowserUploadUrl: this.isAwareness()
          ? "https://a.link.com/there/needs/to/be/a/random/url/in/here"
          : "",
        contentsCss: ["/ckeditor/content.css"]
      };
    }
  }

Answer №1

It appears that setting fullPage: true in my configuration is preventing the contentsCss from being applied. However, if I disable fullPage, the css will be loaded successfully.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Aligning elements vertically in Bootstrap 4 with the power of flexbox

Seeking assistance with a frustrating issue in Bootstrap 4: I tried to implement the align-self-start flexbox alignment using the code from this page . However, the example provided on that page does not seem to work. Is there a simpler way to achieve the ...

Alternative techniques apart from submitting

Within my PHP submit form, I have integrated a PHP image gallery that pulls images from a specific folder (with a dropdown to select images from different folders). When I click on an image in the gallery, the path to that image is automatically entered i ...

Creating a div that takes up 100% of its parent's height, regardless of the children's dimensions, in a sophisticated layout

My webpage layout is structured as follows: https://i.sstatic.net/5rdiw.png The left side, identified as D, functions perfectly. It contains a significant amount of content that scrolls correctly. Even as the content increases, the height stays at 100% o ...

The functionality of the button for selecting and deselecting all checkboxes is currently malfunctioning

I have a button in my ng-grid that successfully selects all checkboxes. However, I am also trying to implement functionality to deselect the checkboxes using the same button. Here is the initial code: app.directive('selectAll',function(){ ret ...

Generate slanted projection mapboxgl

Trying to develop a building simulator based on zoning codes. I can measure values, create floors, but struggling to extrude diagonally or create a perpendicular plane to the floor for evaluating angles from the street to limit building height (see image 2 ...

Storing User Information in Discord.js to Prevent Spam

I'm currently working on creating an anti-spam feature using Discord.js. However, I am facing a challenge in saving data such as the timestamp of the user's last message sent. ...

Adjust the prop value whenever there is a modification in the Vuex store

Following a successful mutation to the vuex store (state.posts.post.comments) with the use of this code snippet and implementing Vue.set for Vue to acknowledge the addition of an object property: store/modules/post.js const mutations = { [types.SET_P ...

how to dynamically update a button's text using Vue.js

I have a challenge where I need to dynamically change the text of a button based on whether a value is true or false. Below is the code snippet that I have been working on: <button class="btn btn-primary table-button" type="button&quo ...

Issue: My VuePWA/Web Push service worker is not prompting the user to grant permission

After completing the Google Introduction to Push notification code lab, I am eager to incorporate Push notifications into my VueJS PWA. The only hurdle I face is that the service worker fails to prompt users for notification permissions. The code snippet ...

Navigating Date Conversion within Component in Angular 2 Application

Searching for a way to update the display of certain dates in my Angular 2 application, I encountered a roadblock. Using the date pipe in conjunction with string interpolation wasn't viable due to the structure of my template code: <input class="a ...

Modify the background hue of a personalized WordPress HTML block using supplementary CSS styling

My current challenge involves modifying the background color of a specific custom HTML WordPress block. However, when I make changes to one block, it affects the background color of all other custom HTML blocks on different pages. Here is the CSS code I a ...

The image fails to display when using THREE.js and Panolens.js

Trying to create a 360-degree environment with informational buttons using THREE.js and Panolens.JS However, I'm unable to resolve why the image is not appearing. Continuously encountering the error: Uncaught ReferenceError: process is not defined. ...

Using console.log() within a method while chaining in JavaScript/jQuery

I've been experimenting with developing jQuery plugins and I'm interested in chaining methods. The jQuery tutorial (found here: https://learn.jquery.com/plugins/basic-plugin-creation/) mentions that you can chain methods by adding return this; at ...

What is the best way to simulate axios API calls in Jest for mocking purposes?

I am currently testing a Vuex action async function that calls an API using axios. However, I am facing an issue where I am getting an error message that says: "TypeError: Cannot destructure property data of 'undefined' or 'null'." 3 ...

Is there a way to capture the stdout and stderr output from a WebAssembly module that has been generated using Emscripten in JavaScript?

In my C++ code snippet below: #include <iostream> int main() { std::cout << "Hello World!" << std::endl; return 0; } I compile the code using: emcc -s ENVIRONMENT=shell -s WASM=1 -s MODULARIZE=1 main.cpp -o main.js This c ...

Best practices for handling APIs in Vue

After spending hours reading documentation and searching online for the best way to manage API calls in larger projects, I have yet to find a solution that meets my needs. My goal is to create a service or facade for the backend that can be easily integra ...

Ways to stop the floating label from blending with the input field

Attempting to incorporate the Bootstrap Material design theme into my project, I have implemented a basic text input field using the code below: <div class="form-control-wrapper"> <input class="form-control empty" type="text"></input> ...

The Disabled element does not exhibit effective styling

When we include the disabled attribute in the text element, the style does not work. Can you explain why? <input pInputText [style]="{'padding-bottom':'10px','padding-top':'10px','width':'100%&apos ...

Directive for Angular JS that creates a custom table

Working on a project that involves a significant amount of serial true/false data to be displayed in various ways. Developed a directive to pass in the model, table header, and an important aspect - the number of columns. <serial-checkbox-table title=" ...

What is the secret to aligning two elements flawlessly?

I'm currently working on completing a theme and I've hit a roadblock. I am trying to add header support, but it's causing issues with my layout. Everything was running smoothly until I inserted this line of code: <img src="<?php heade ...