]> _ Git - pmi.git/commitdiff
Fix regression in configuration that caused colours to be wrong in generated CSS...
authorStephen Cameron <stephen@cubedesigners.com>
Tue, 14 Jan 2020 10:23:48 +0000 (11:23 +0100)
committerStephen Cameron <stephen@cubedesigners.com>
Tue, 14 Jan 2020 10:23:48 +0000 (11:23 +0100)
webpack.mix.js

index 50024322e7d9afa191bab4c0080fd54eb614442c..a6d6bcab67d0cd764b08e5502fa9bdbb399ae005 100644 (file)
@@ -41,15 +41,21 @@ mix.js('resources/js/app.js', 'public/js')
 // });
 
 //=== Stylus / PostCSS
+// Since we have different configurations for Tailwind,
+// the PostCSS options need to be specified differently
+// due to a limitation in Laravel Mix.
+// Ref: https://github.com/tailwindcss/tailwindcss/issues/494
+// Ref: https://sandulat.com/blog/multiple-tailwind-configs-in-laravel/
 mix.stylus('resources/styles/app.styl', 'public/css', {
-    use: [
-        require('rupture')()
-    ]
-}).options({
-    postCss: [
+        use: [
+            require('rupture')()
+        ]
+    },
+    [   // postCssPlugins
         tailwindcss('tailwind.config.js'),
         require('lost'),
-    ],
+    ]
+    ).options({
     // autoprefixer: {
     //   options: {
     //     grid: true, // Enable CSS grid prefixes for IE
@@ -58,15 +64,15 @@ mix.stylus('resources/styles/app.styl', 'public/css', {
 });
 
 mix.stylus('resources/styles/michsci.styl', 'public/css', {
-    use: [
-        require('rupture')()
-    ]
-}).options({
-    postCss: [
+        use: [
+            require('rupture')()
+        ]
+    },
+    [   // postCssPlugins
         tailwindcss('tailwind-michsci.config.js'),
         require('lost'),
-    ],
-});
+    ]
+);
 
 //=== PurgeCSS to remove unused selectors
 mix.purgeCss({