Commit 3c80c6ae authored by Alex Bronstein's avatar Alex Bronstein
Browse files

Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson,...

Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core

(cherry picked from commit 1786bc19)
parent bd2b7454
Loading
Loading
Loading
Loading

core/.stylelintignore

0 → 100644
+2 −0
Original line number Diff line number Diff line
themes/claro/**/*.css
!themes/claro/**/*.pcss.css
+1 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@
        "drupal/book": "self.version",
        "drupal/breakpoint": "self.version",
        "drupal/ckeditor": "self.version",
        "drupal/claro": "self.version",
        "drupal/classy": "self.version",
        "drupal/color": "self.version",
        "drupal/comment": "self.version",
+14 −4
Original line number Diff line number Diff line
@@ -52,8 +52,13 @@ function shortcut_schema() {
function shortcut_install() {
  // Theme settings are not configuration entities and cannot depend on modules
  // so to set a module-specific setting, we need to set it with logic.
  if (\Drupal::service('theme_handler')->themeExists('seven')) {
    \Drupal::configFactory()->getEditable('seven.settings')->set('third_party_settings.shortcut.module_link', TRUE)->save(TRUE);
  foreach (['seven', 'claro'] as $theme) {
    if (\Drupal::service('theme_handler')->themeExists($theme)) {
      \Drupal::configFactory()
        ->getEditable("$theme.settings")
        ->set('third_party_settings.shortcut.module_link', TRUE)
        ->save(TRUE);
    }
  }
}

@@ -63,7 +68,12 @@ function shortcut_install() {
function shortcut_uninstall() {
  // Theme settings are not configuration entities and cannot depend on modules
  // so to unset a module-specific setting, we need to unset it with logic.
  if (\Drupal::service('theme_handler')->themeExists('seven')) {
    \Drupal::configFactory()->getEditable('seven.settings')->clear('third_party_settings.shortcut')->save(TRUE);
  foreach (['seven', 'claro'] as $theme) {
    if (\Drupal::service('theme_handler')->themeExists($theme)) {
      \Drupal::configFactory()
        ->getEditable("$theme.settings")
        ->clear('third_party_settings.shortcut')
        ->save(TRUE);
    }
  }
}
+7 −5
Original line number Diff line number Diff line
@@ -435,11 +435,13 @@ function shortcut_toolbar() {
 * Implements hook_themes_installed().
 */
function shortcut_themes_installed($theme_list) {
  if (in_array('seven', $theme_list)) {
  // Theme settings are not configuration entities and cannot depend on modules
  // so to set a module-specific setting, we need to set it with logic.
    if (\Drupal::moduleHandler()->moduleExists('shortcut')) {
      \Drupal::configFactory()->getEditable('seven.settings')->set('third_party_settings.shortcut.module_link', TRUE)->save(TRUE);
  foreach (['seven', 'claro'] as $theme) {
    if (in_array($theme, $theme_list, TRUE)) {
      \Drupal::configFactory()->getEditable("$theme.settings")
        ->set('third_party_settings.shortcut.module_link', TRUE)
        ->save(TRUE);
    }
  }
}
+36 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\FunctionalJavascriptTests\Theme;

use Drupal\Tests\block\FunctionalJavascript\BlockFilterTest;

/**
 * Runs BlockFilterTest in Claro.
 *
 * @group block
 *
 * @see \Drupal\Tests\block\FunctionalJavascript\BlockFilterTest.
 */
class ClaroBlockFilterTest extends BlockFilterTest {

  /**
   * Modules to enable.
   *
   * Install the shortcut module so that claro.settings has its schema checked.
   * There's currently no way for Claro to provide a default and have valid
   * configuration as themes cannot react to a module install.
   *
   * @var string[]
   */
  public static $modules = ['shortcut'];

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();
    $this->container->get('theme_installer')->install(['claro']);
    $this->config('system.theme')->set('default', 'claro')->save();
  }

}
Loading