Skip to content
Snippets Groups Projects
Unverified Commit c7d13715 authored by Lucas Hedding's avatar Lucas Hedding
Browse files

Issue #3409771: Provide optional toggle for warning about missing classes

parent 9af85b82
No related branches found
No related tags found
No related merge requests found
Pipeline #65899 passed with warnings
...@@ -5,6 +5,7 @@ declare(strict_types=1); ...@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Drupal\tailwindcss_utility\StackMiddleware; namespace Drupal\tailwindcss_utility\StackMiddleware;
use Drupal\Core\Render\HtmlResponse; use Drupal\Core\Render\HtmlResponse;
use Drupal\Core\Site\Settings;
use Drupal\tailwindcss_utility\RuleStorage; use Drupal\tailwindcss_utility\RuleStorage;
use Drupal\tailwindcss_utility\TailwindJsHandler; use Drupal\tailwindcss_utility\TailwindJsHandler;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
...@@ -309,7 +310,7 @@ EOF; ...@@ -309,7 +310,7 @@ EOF;
// in Tailwind js config. // in Tailwind js config.
if (\count($filtered_classes) > 0) { if (\count($filtered_classes) > 0) {
$tailwind_embed = $this->tailwindJsHandler->getTailwindEmbed($filtered_classes); $tailwind_embed = $this->tailwindJsHandler->getTailwindEmbed($filtered_classes);
if ($tailwind_embed === '') { if ($tailwind_embed === '' && Settings::get('tailwind_missing_classes_warning', TRUE)) {
$this->logger->warning('The following Tailwind classes could not be found %classes.', [ $this->logger->warning('The following Tailwind classes could not be found %classes.', [
'%classes' => \implode(', ', $filtered_classes), '%classes' => \implode(', ', $filtered_classes),
]); ]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment