Skip to content

Skin false does not prevent loading of skins #53

Closed
@tomasbruckner

Description

@tomasbruckner

What is the correct configuration with Create React App when loading resources yourself?

I get this so far:

import React from 'react';
import { Editor } from '@tinymce/tinymce-react';

import 'tinymce/tinymce';
import 'tinymce/themes/silver/theme';
import 'tinymce/skins/ui/oxide/skin.min.css'
import 'tinymce/skins/ui/oxide/content.min.css'
import 'tinymce/plugins/link';
import 'tinymce/plugins/code';

const RichTextEditor = () => {
  return (
    <Editor
      initialValue="<p>hello</p>"
      init={{
        skin=false,
        plugins: ['link', 'code'],
        toolbar: 'bold italic',
      }}
    />
  );
};

RichTextEditor.propTypes = {
  ...Editor.propTypes,
};

export default RichTextEditor;

But I still get

tinymce.js:5320 Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:3000/static/js/skins/content/default/content.css".

Also there should be more clarification in documentation that modern theme is only for version 4 and you should use oxide with version 5, because in every part of the documentation, there is theme: modern and took me a while before I figured out that I should use oxide instead.

Activity

fyrkant

fyrkant commented on Feb 25, 2019

@fyrkant
Contributor

You should use the skin_url setting to point to the skin files, importing then into the js file won't work.

tomasbruckner

tomasbruckner commented on Feb 25, 2019

@tomasbruckner
Author

@fyrkant what do you mean it won't work. I can see that the CSS file is loaded and it works. My only concern is that the component tries to load /static/js/skins/content/default/content.css which is unfortunately redirected due to react router to index.html. Therefore it loads html instead of css and fails. Is there a way to prevent this request to content.css?

fyrkant

fyrkant commented on Feb 27, 2019

@fyrkant
Contributor

Seems like there is a bug in TinyMCE 5 that is loads the content css even if skin is set to false, we will fix this in a future version but for now I think you can skip loading the content css by setting the content_css setting to false as well.

tomasbruckner

tomasbruckner commented on Feb 27, 2019

@tomasbruckner
Author

Great, thank you for quick help.

realrickren

realrickren commented on Jul 9, 2020

@realrickren

This bug havent been fixed yet? I met this in 5.4.1

conorluddy

conorluddy commented on Jul 21, 2020

@conorluddy

I'm on 5.4.1 also and was struggling with this too, and ended up here.
Setting skin: false in my init object seemed to fix it, and I didn't need to set content_css at all.

I'm importing my CSS at the top of the component like this, and using the @tinymce/tinymce-react component.

import 'tinymce/skins/ui/oxide/skin.css'
import 'tinymce/skins/ui/oxide/content.inline.css'
redfox05

redfox05 commented on Aug 3, 2020

@redfox05

skin:false also fixed the issue for me with Webpack 4 and TinyMCE 4, and the content_css is set to our app.css. I found this solution from https://community.tiny.cloud/communityIdeaDetail?id=08761000000AT6yAAG and then found this github issue when I was trying to see if skin:false was a valid option to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @conorluddy@tomasbruckner@redfox05@fyrkant@realrickren

        Issue actions

          Skin false does not prevent loading of skins · Issue #53 · tinymce/tinymce-react