0

I'm trying to use Draft.js with the Image plugin. Here are my problems. I manage to get it to work, but the styles aren't loaded and the editor takes the whole page and the buttons aren't styled.

enter image description here

I load the styles from the provided CSS

import './Draft.css';
import editorStyles from './editorStyles.css';
import 'draft-js-image-plugin/lib/plugin.css';

But it doesn't do anything. I'm working with Create React App, so style-loader and css-loader should be working fine.

Thanks for the help.

Hash
  • 7,726
  • 9
  • 34
  • 53
aspiring_dev
  • 83
  • 4
  • 12

1 Answers1

2

About styles in draft-js-image-plugin/lib/plugin.css. It looks like a mistake in the plugin documentation. We can read there:

The plugin ships with a default styling available at this location in the installed package: node_modules/draft-js-image-plugin/lib/plugin.css

But if we check this file in our node_modules directory, we see that this file is empty. No any styles.

enter image description here

About other styles. Check that you have Draft.css and editorStyles.css files and this files located in the same directory that your component. Do you have some errors in the console? It would be great if you provide full your code.

Mikhail Shabrikov
  • 8,453
  • 1
  • 28
  • 35
  • No, I'm not seeing any console errors and the css files are in the same directory. But, is there some way I can get the plugin.css content so I can paste it there? – aspiring_dev Nov 27 '17 at 12:18
  • Only members of this plugin developers team know what the styles should be in this file. I think you can open an issue in official repository and ask them. – Mikhail Shabrikov Nov 27 '17 at 12:27