]> _ Git - ccv-wordpress.git/commitdiff
Done #3394 @2
authorStephen Cameron <s@hybridvision.net>
Wed, 5 Feb 2020 18:10:56 +0000 (16:10 -0200)
committerStephen Cameron <s@hybridvision.net>
Wed, 5 Feb 2020 18:10:56 +0000 (16:10 -0200)
.gitignore
wp-content/themes/CCV/app/setup.php
wp-content/themes/CCV/package.json
wp-content/themes/CCV/webpack.mix.js
wp-content/themes/CCV/yarn.lock

index 90a5ca067302d18812f1d5bab4d99dc88b692f7f..de21215ffa07492179f9baf2be9e91d048eeb3cc 100644 (file)
@@ -1,5 +1,6 @@
 .DS_Store
 *.log
+.uploads-proxy
 local-config.php
 node_modules
 /wp-content/*
index c6c770da2acae071ae0d24b721cad5f4203e91b0..ba18817be5f8f9063fd04685b4a4226b081eecd4 100755 (executable)
@@ -155,3 +155,40 @@ add_action('widgets_init', function () {
             'id'            => 'sidebar-footer-copyright'
         ] + $config);
 });
+
+
+/**
+ * Add Custom Styles to TinyMCE editor
+ */
+// https://codex.wordpress.org/TinyMCE_Custom_Styles
+// Callback function to insert 'styleselect' into the $buttons array
+add_filter( 'mce_buttons_2', function($buttons) {
+    array_unshift( $buttons, 'styleselect' );
+    return $buttons;
+});
+
+// Add format classes to
+add_filter( 'tiny_mce_before_init', function($init_array) {
+    $sizes = [
+        'xs',
+        'sm',
+        'lg',
+        'xl',
+    ];
+
+    // Text size styles
+    foreach ($sizes as $size) {
+        $style_formats[] = [
+            'title' => 'Text '. strtoupper($size),
+            'inline' => 'span',
+            'selector' => 'h1, h2, h3, h4, h5, p, div',
+            'classes' => 'text-'. $size,
+            'wrapper' => false,
+        ];
+    }
+
+    // Insert the array, JSON ENCODED, into 'style_formats'
+    $init_array['style_formats'] = json_encode( $style_formats );
+
+    return $init_array;
+});
index 000fb9f93042e54e946a5ba472c28dc0549c78f4..8fbfeb178a73e316f1e17cd517f880de245d183f 100644 (file)
@@ -30,7 +30,7 @@
     "mix-tailwindcss": "^1.0.2",
     "mmenu-light": "^2.3.1",
     "npm-run-all": "^4.1",
-    "purgecss-with-wordpress": "knowler/purgecss-with-wordpress#more-wp-generated-classes",
+    "purgecss-with-wordpress": "^1.1.0",
     "rimraf": "^2.6",
     "rupture": "^0.7.1",
     "stylelint": "^10.1",
index f1ff7448fd1ca4bfe60161d16ac67b92a24cc09b..946c1ff2d7c05e542eb4fc15e307f7dfc89aaead 100644 (file)
@@ -84,6 +84,15 @@ mix.purgeCss({
    */
   whitelist: [
     ...whitelist,
+    'text-xs',
+    'text-sm',
+    'text-base',
+    'text-lg',
+    'text-xl',
+    'text-2xl',
+    'text-3xl',
+    'italic',
+    'mt-2',
   ],
   whitelistPatterns: [
     ...whitelistPatterns,
index 9407d5cd0177c000afbc43a38da59ea7e8dca6fe..63dcb9e229c00adbc0a78ca76ffe21514fbbf798 100644 (file)
@@ -6556,9 +6556,10 @@ purgecss-webpack-plugin@^1.3.0:
     purgecss "^1.3.0"
     webpack-sources "^1.3.0"
 
-purgecss-with-wordpress@knowler/purgecss-with-wordpress#more-wp-generated-classes:
-  version "1.0.0"
-  resolved "https://codeload.github.com/knowler/purgecss-with-wordpress/tar.gz/0838cc9c88d83f0cc1c0f2e61cef43a0242c2392"
+purgecss-with-wordpress@^1.1.0:
+  version "1.1.0"
+  resolved "https://registry.yarnpkg.com/purgecss-with-wordpress/-/purgecss-with-wordpress-1.1.0.tgz#ceeef62f9e092fef1c2f4748a447cbf6b790382a"
+  integrity sha512-7hlRdGToDyyh+GF/At1GNB07viUG+dppvdq34H7DUm8ySgp4OULPr58R2Ww8/Fe5nOsCQ6YihTDjFHFlSwwCsQ==
 
 purgecss@^1.3.0:
   version "1.3.0"