Browse Source

Improvements to the code block CSS.

Aleksander Nowodzinski 6 years ago
parent
commit
843bdb44a0

+ 1 - 0
packages/ckeditor5-code-block/src/codeblockediting.js

@@ -143,6 +143,7 @@ export default class CodeBlockEditing extends Plugin {
 						editor.execute( 'enter' );
 
 						const newBlock = doc.selection.anchor.parent;
+
 						writer.rename( newBlock, DEFAULT_ELEMENT );
 						editor.model.schema.removeDisallowedAttributes( [ newBlock ], writer );
 						view.scrollToTheSelection();

+ 6 - 0
packages/ckeditor5-code-block/theme/codeblock.css

@@ -16,6 +16,12 @@
 
 	white-space: pre-wrap;
 
+	/* Don't inherit the style, e.g. when in a block quote. */
+	font-style: normal;
+
+	/* Don't let the code be squashed e.g. when in a table cell. */
+	min-width: 60px;
+
 	& code {
 		background: unset;
 		padding: 0;