From 10c8047151cfd33a530645579c4a6caf3a09c10c Mon Sep 17 00:00:00 2001 From: derweili Date: Wed, 1 Jun 2016 02:10:35 +0200 Subject: [PATCH] Add foundation.css as editor styles Most people have problems because the Tiny MCE Editor looks different then the theme. To prevent this, the main CSS file can be included. --- assets/scss/foundation.scss | 1 + assets/scss/modules/_editor-style.scss | 5 +++++ library/theme-support.php | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 assets/scss/modules/_editor-style.scss diff --git a/assets/scss/foundation.scss b/assets/scss/foundation.scss index 4673439eb..fc8e3f0a3 100755 --- a/assets/scss/foundation.scss +++ b/assets/scss/foundation.scss @@ -79,6 +79,7 @@ @import "modules/navigation"; @import "modules/footer"; @import "modules/sidebar"; +@import "modules/editor-style"; // Components @import "components/buttons"; diff --git a/assets/scss/modules/_editor-style.scss b/assets/scss/modules/_editor-style.scss new file mode 100644 index 000000000..778fcb5fd --- /dev/null +++ b/assets/scss/modules/_editor-style.scss @@ -0,0 +1,5 @@ +body#tinymce{ + height: auto; //Fix editor style bug + max-width: $grid-row-width; //Give the editor a max-width + padding: rem-calc(20) !important; +} \ No newline at end of file diff --git a/library/theme-support.php b/library/theme-support.php index 6dfc70a76..ccfdd49af 100755 --- a/library/theme-support.php +++ b/library/theme-support.php @@ -37,7 +37,10 @@ function foundationpress_theme_support() { // Declare WooCommerce support per http://docs.woothemes.com/document/third-party-custom-theme-compatibility/ add_theme_support( 'woocommerce' ); + + // Add foundation.css as editor style https://codex.wordpress.org/Editor_Style + add_editor_style( 'assets/stylesheets/foundation.css' ); } add_action( 'after_setup_theme', 'foundationpress_theme_support' ); -endif; +endif; \ No newline at end of file