commit c91f994d59c0e281743077573911d9fc9ab310fa Author: HOG Date: Thu Jul 23 00:10:50 2015 +0300 #2005546 Edited header theming, applied 181 patch. diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 3b156a5..94f15e6 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -344,14 +344,12 @@ function theme_get_setting($setting_name, $theme = NULL) { } // Generate the path to the logo image. - if ($cache[$theme]->get('features.logo')) { - $logo_path = $cache[$theme]->get('logo.path'); - if ($cache[$theme]->get('logo.use_default')) { - $cache[$theme]->set('logo.url', file_create_url($theme_object->getPath() . '/logo.svg')); - } - elseif ($logo_path) { - $cache[$theme]->set('logo.url', file_create_url($logo_path)); - } + $logo_path = $cache[$theme]->get('logo.path'); + if ($cache[$theme]->get('logo.use_default')) { + $cache[$theme]->set('logo.url', file_create_url($theme_object->getPath() . '/logo.svg')); + } + elseif ($logo_path) { + $cache[$theme]->set('logo.url', file_create_url($logo_path)); } // Generate the path to the favicon. @@ -1349,8 +1347,8 @@ function template_preprocess_page(&$variables) { $variables['front_page'] = \Drupal::url(''); $variables['language'] = $language_interface; $variables['logo'] = theme_get_setting('logo.url'); - $variables['site_name'] = (theme_get_setting('features.name') ? SafeMarkup::checkPlain($site_config->get('name')) : ''); - $variables['site_slogan']['#markup'] = (theme_get_setting('features.slogan') ? $site_config->get('slogan') : ''); + $variables['site_name'] = $site_config->get('name'); + $variables['site_slogan'] = $site_config->get('slogan'); // An exception might be thrown. try { diff --git a/core/lib/Drupal/Core/Extension/ThemeHandler.php b/core/lib/Drupal/Core/Extension/ThemeHandler.php index 4059d79..42e3cf0 100644 --- a/core/lib/Drupal/Core/Extension/ThemeHandler.php +++ b/core/lib/Drupal/Core/Extension/ThemeHandler.php @@ -22,10 +22,7 @@ class ThemeHandler implements ThemeHandlerInterface { * @var array */ protected $defaultFeatures = array( - 'logo', 'favicon', - 'name', - 'slogan', 'node_user_picture', 'comment_user_picture', 'comment_user_verification', diff --git a/core/modules/color/color.module b/core/modules/color/color.module index 9aa9327..722abe0 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -9,6 +9,7 @@ use Drupal\Component\Utility\Bytes; use Drupal\Component\Utility\Environment; use Drupal\Component\Utility\SafeMarkup; +use Drupal\Core\Block\BlockPluginInterface; use Drupal\Core\Cache\Cache; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Language\LanguageInterface; @@ -120,6 +121,27 @@ function color_preprocess_page(&$variables) { } /** + * Implements hook_block_view_BASE_BLOCK_ID_alter(). + */ +function color_block_view_system_branding_block_alter(array &$build, BlockPluginInterface $block) { + $build['#pre_render'][] = 'color_block_view_pre_render'; +} + +/** + * #pre_render callback: Sets color preset logo. + */ +function color_block_view_pre_render(array $build) { + $theme_key = \Drupal::theme()->getActiveTheme()->getName(); + + // Override logo. + $logo = \Drupal::config('color.theme.' . $theme_key)->get('logo'); + if ($logo && $build['content']['site_logo'] && preg_match('!' . $theme_key . '/logo.svg$!', $build['content']['site_logo']['#uri'])) { + $build['content']['site_logo']['#uri'] = file_create_url($logo); + } + return $build; +} + +/** * Retrieves the Color module information for a particular theme. */ function color_get_info($theme) { diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php index 4bbb408..d1ca0de 100644 --- a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php +++ b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php @@ -28,7 +28,7 @@ class ConfigTranslationUiTest extends WebTestBase { * * @var array */ - public static $modules = array('node', 'contact', 'contact_test', 'config_translation', 'config_translation_test', 'views', 'views_ui', 'contextual', 'filter', 'filter_test'); + public static $modules = ['node', 'contact', 'contact_test', 'config_translation', 'config_translation_test', 'views', 'views_ui', 'contextual', 'filter', 'filter_test', 'block']; /** * Languages to enable. @@ -158,6 +158,9 @@ public function testSiteInformationTranslationUi() { $this->assertFieldByName('translation[config_names][system.site][name]', $fr_site_name); $this->assertFieldByName('translation[config_names][system.site][slogan]', $fr_site_slogan); + // Place branding block with site name and slogan into header region. + $this->drupalPlaceBlock('system_branding_block', ['region' => 'header']); + // Check French translation of site name and slogan are in place. $this->drupalGet('fr'); $this->assertRaw($fr_site_name); diff --git a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php index 3f7994b..4645d68 100644 --- a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php +++ b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php @@ -393,6 +393,9 @@ function testUrlLanguageFallback() { // it is set by JavaScript. $this->drupalLogout(); + // Place a site branding block in the header region. + $this->drupalPlaceBlock('system_branding_block', ['region' => 'header']); + // Access the front page without specifying any valid URL language prefix // and having as browser language preference a non-default language. $http_header = array("Accept-Language: $langcode_browser_fallback;q=1"); @@ -406,7 +409,7 @@ function testUrlLanguageFallback() { $this->assertTrue($fields[0] == $languages[$langcode_browser_fallback]->getName(), 'The browser language is the URL active language'); // Check that URLs are rewritten using the given browser language. - $fields = $this->xpath('//strong[@class="site-name"]/a[@rel="home" and @href=:url]', $args); + $fields = $this->xpath('//div[@class="site-name"]/a[@rel="home" and @href=:url]', $args); $this->assertTrue($fields[0] == 'Drupal', 'URLs are rewritten using the browser language.'); } diff --git a/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php b/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php index c471cea..c186359 100644 --- a/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php +++ b/core/modules/page_cache/src/Tests/PageCacheTagsIntegrationTest.php @@ -91,6 +91,7 @@ function testPageCacheTags() { 'rendered', 'block_view', 'config:block_list', + 'config:block.block.bartik_branding', 'config:block.block.bartik_breadcrumbs', 'config:block.block.bartik_content', 'config:block.block.bartik_tools', @@ -125,6 +126,7 @@ function testPageCacheTags() { 'rendered', 'block_view', 'config:block_list', + 'config:block.block.bartik_branding', 'config:block.block.bartik_breadcrumbs', 'config:block.block.bartik_content', 'config:block.block.bartik_tools', diff --git a/core/modules/system/config/install/system.theme.global.yml b/core/modules/system/config/install/system.theme.global.yml index 5ee6cc7..b8da423 100644 --- a/core/modules/system/config/install/system.theme.global.yml +++ b/core/modules/system/config/install/system.theme.global.yml @@ -7,10 +7,7 @@ features: comment_user_picture: true comment_user_verification: true favicon: true - logo: true - name: true node_user_picture: true - slogan: true logo: path: '' url: '' diff --git a/core/modules/system/src/Form/ThemeSettingsForm.php b/core/modules/system/src/Form/ThemeSettingsForm.php index fd8b777..978ca80 100644 --- a/core/modules/system/src/Form/ThemeSettingsForm.php +++ b/core/modules/system/src/Form/ThemeSettingsForm.php @@ -141,9 +141,6 @@ public function buildForm(array $form, FormStateInterface $form_state, $theme = // Toggle settings $toggles = array( - 'logo' => t('Logo'), - 'name' => t('Site name'), - 'slogan' => t('Site slogan'), 'node_user_picture' => t('User pictures in posts'), 'comment_user_picture' => t('User pictures in comments'), 'comment_user_verification' => t('User verification status in comments'), diff --git a/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php b/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php index 16b0368..a4f8df7 100644 --- a/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php +++ b/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php @@ -160,10 +160,9 @@ public function build() { $build = array(); $site_config = $this->configFactory->get('system.site'); - $logo = theme_get_setting('logo'); $build['site_logo'] = array( '#theme' => 'image', - '#uri' => $logo['url'], + '#uri' => theme_get_setting('logo.url'), '#alt' => $this->t('Home'), '#access' => $this->configuration['use_site_logo'], ); diff --git a/core/modules/system/src/Tests/System/PageTitleTest.php b/core/modules/system/src/Tests/System/PageTitleTest.php index 6d56a6f..e757cc4 100644 --- a/core/modules/system/src/Tests/System/PageTitleTest.php +++ b/core/modules/system/src/Tests/System/PageTitleTest.php @@ -23,7 +23,7 @@ class PageTitleTest extends WebTestBase { * * @var array */ - public static $modules = array('node', 'test_page_test', 'form_test'); + public static $modules = ['node', 'test_page_test', 'form_test', 'block']; protected $contentUser; protected $savedTitle; @@ -71,13 +71,6 @@ function testTitleXSS() { $slogan = ''; $slogan_filtered = Xss::filterAdmin($slogan); - // Activate needed appearance settings. - $edit = array( - 'toggle_name' => TRUE, - 'toggle_slogan' => TRUE, - ); - $this->drupalPostForm('admin/appearance/settings', $edit, t('Save configuration')); - // Set title and slogan. $edit = array( 'site_name' => $title, @@ -85,6 +78,9 @@ function testTitleXSS() { ); $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration')); + // Place branding block with site name and slogan into header region. + $this->drupalPlaceBlock('system_branding_block', ['region' => 'header']); + // Load frontpage. $this->drupalGet(''); diff --git a/core/modules/system/src/Tests/System/ThemeTest.php b/core/modules/system/src/Tests/System/ThemeTest.php index 84745b7..493e795 100644 --- a/core/modules/system/src/Tests/System/ThemeTest.php +++ b/core/modules/system/src/Tests/System/ThemeTest.php @@ -122,9 +122,11 @@ function testThemeSettings() { $this->assertEqual((string) $elements[1], $explicit_file); $this->assertEqual((string) $elements[2], $local_file); - // Verify the actual 'src' attribute of the logo being output. + // Verify the actual 'src' attribute of the logo being output in a site + // branding block. + $this->drupalPlaceBlock('system_branding_block', ['region' => 'header']); $this->drupalGet(''); - $elements = $this->xpath('//header/a[@rel=:rel]/img', array( + $elements = $this->xpath('//header//a[@rel=:rel]/img', array( ':rel' => 'home', ) ); @@ -174,8 +176,9 @@ function testThemeSettings() { $fields = $this->xpath($this->constructFieldXpath('name', 'logo_path')); $uploaded_filename = 'public://' . $fields[0]['value']; + $this->drupalPlaceBlock('system_branding_block', ['region' => 'header']); $this->drupalGet(''); - $elements = $this->xpath('//header/a[@rel=:rel]/img', array( + $elements = $this->xpath('//header//a[@rel=:rel]/img', array( ':rel' => 'home', ) ); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index a826e69..1e915c6 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1062,10 +1062,7 @@ function system_rebuild_module_data() { */ function _system_default_theme_features() { return array( - 'logo', 'favicon', - 'name', - 'slogan', 'node_user_picture', 'comment_user_picture', 'comment_user_verification', diff --git a/core/modules/system/templates/block--system-branding-block.html.twig b/core/modules/system/templates/block--system-branding-block.html.twig index 63e0c3e..2a98687 100644 --- a/core/modules/system/templates/block--system-branding-block.html.twig +++ b/core/modules/system/templates/block--system-branding-block.html.twig @@ -17,12 +17,12 @@ #} {% block content %} {% if site_logo %} - + {{ 'Home'|t }} {% endif %} {% if site_name %} - {{ site_name }} + {{ site_name }} {% endif %} {{ site_slogan }} {% endblock %} diff --git a/core/modules/system/templates/page.html.twig b/core/modules/system/templates/page.html.twig index c5a3711..bf9e658 100644 --- a/core/modules/system/templates/page.html.twig +++ b/core/modules/system/templates/page.html.twig @@ -62,32 +62,6 @@
- {% if logo %} - - {{ 'Home'|t }} - - {% endif %} - - {% if site_name or site_slogan %} -
- - {# Use h1 when the content title is empty #} - {% if title %} - - {{ site_name }} - - {% else %} -

- {{ site_name }} -

- {% endif %} - - {% if site_slogan %} -
{{ site_slogan }}
- {% endif %} -
{# ./name-and-slogan #} - {% endif %} - {{ page.header }}
diff --git a/core/profiles/minimal/config/install/block.block.stark_branding.yml b/core/profiles/minimal/config/install/block.block.stark_branding.yml new file mode 100644 index 0000000..acf108f --- /dev/null +++ b/core/profiles/minimal/config/install/block.block.stark_branding.yml @@ -0,0 +1,18 @@ +id: stark_branding +theme: stark +weight: 0 +status: true +langcode: en +region: header +plugin: system_branding_block +settings: + id: system_branding_block + label: 'Site Branding' + provider: system + label_display: '0' +dependencies: + module: + - system + theme: + - stark +visibility: { } diff --git a/core/profiles/standard/config/install/block.block.bartik_branding.yml b/core/profiles/standard/config/install/block.block.bartik_branding.yml new file mode 100644 index 0000000..3bed730 --- /dev/null +++ b/core/profiles/standard/config/install/block.block.bartik_branding.yml @@ -0,0 +1,18 @@ +id: bartik_branding +theme: bartik +weight: 0 +status: true +langcode: en +region: header +plugin: system_branding_block +settings: + id: system_branding_block + label: 'Site Branding' + provider: system + label_display: '0' +dependencies: + module: + - system + theme: + - bartik +visibility: { } diff --git a/core/themes/bartik/bartik.libraries.yml b/core/themes/bartik/bartik.libraries.yml index 009a67f..ae1eacb 100644 --- a/core/themes/bartik/bartik.libraries.yml +++ b/core/themes/bartik/bartik.libraries.yml @@ -32,6 +32,7 @@ global-styling: css/components/shortcut.css: {} css/components/skip-link.css: {} css/components/sidebar.css: {} + css/components/site-branding.css: {} css/components/site-footer.css: {} css/components/table.css: {} css/components/tabs.css: {} diff --git a/core/themes/bartik/bartik.theme b/core/themes/bartik/bartik.theme index 4f83a9e..52927a3 100644 --- a/core/themes/bartik/bartik.theme +++ b/core/themes/bartik/bartik.theme @@ -41,9 +41,6 @@ function bartik_preprocess_html(&$variables) { * Implements hook_preprocess_HOOK() for page templates. */ function bartik_preprocess_page(&$variables) { - // Set the options that apply to both page and maintenance page. - _bartik_process_page($variables); - // Since the title and the shortcut link are both block level elements, // positioning them next to each other is much simpler with a wrapper div. if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) { @@ -76,9 +73,6 @@ function bartik_preprocess_maintenance_page(&$variables) { // Bartik has custom styling for the maintenance page. $variables['#attached']['library'][] = 'bartik/maintenance_page'; - - // Set the options that apply to both page and maintenance page. - _bartik_process_page($variables); } /** @@ -109,22 +103,3 @@ function bartik_preprocess_menu(&$variables) { $variables['attributes']['class'][] = 'clearfix'; } -/** - * Helper function for handling the site name and slogan. - */ -function _bartik_process_page(&$variables) { - $site_config = \Drupal::config('system.site'); - // Always print the site name and slogan, but if they are toggled off, we'll - // just hide them visually. - $variables['hide_site_name'] = theme_get_setting('features.name') ? FALSE : TRUE; - $variables['hide_site_slogan'] = theme_get_setting('features.slogan') ? FALSE : TRUE; - if ($variables['hide_site_name']) { - // If toggle_name is FALSE, the site_name will be empty, so we rebuild it. - $variables['site_name'] = SafeMarkup::checkPlain($site_config->get('name')); - } - if ($variables['hide_site_slogan']) { - // If toggle_site_slogan is FALSE, the site_slogan will be empty, so we - // rebuild it. - $variables['site_slogan']['#markup'] = $site_config->get('slogan'); - } -} diff --git a/core/themes/bartik/css/colors.css b/core/themes/bartik/css/colors.css index d56f24b..0c722b2 100644 --- a/core/themes/bartik/css/colors.css +++ b/core/themes/bartik/css/colors.css @@ -46,10 +46,10 @@ a:active, .region-header, .region-header a, .region-header li a.is-active, -#name-and-slogan, -.site-branding-block, -#name-and-slogan a, -.site-branding-block a, +.site-branding__text, +.site-branding, +.site-branding__text a, +.site-branding a, .region-secondary-menu .menu-item a { color: #fffeff; } diff --git a/core/themes/bartik/css/components/header.css b/core/themes/bartik/css/components/header.css index 031d0b2..fbaeb2b 100644 --- a/core/themes/bartik/css/components/header.css +++ b/core/themes/bartik/css/components/header.css @@ -6,112 +6,92 @@ position: relative; } .region-header { - float: right; /* LTR */ - margin: .5em 5px .75em; + padding: 0 15px; } -[dir="rtl"] .region-header { - float: left; + + +#logo { + width: 6%; } -@media all and (min-width: 461px) and (max-width: 900px) { - .region-header { - margin: .5em 5px .75em; - } +#logo, +#name-and-slogan, +.region-header { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + display: inline-block; + max-width: 100%; + vertical-align: middle; } -@media all and (min-width: 901px) { - .region-header { - margin: 1em 5px 1.5em; - } +#name-and-slogan { + color: #fff; + width: 43%; } -#logo, -.site-logo { - float: left; /* LTR */ - padding: 4px 4px 4px 9px; /* LTR */ +#name-and-slogan a { + color: #fff; } -[dir="rtl"] #logo, -[dir="rtl"] .site-logo { - padding: 4px 9px 4px 4px; +.region-header { + width: 50%; } -@media all and (min-width: 461px) and (max-width: 900px) { - #logo, - .site-logo { - padding: 5px 0 0 5px; /* LTR */ - } - [dir="rtl"] #logo, - [dir="rtl"] .site-logo { - padding: 5px 5px 0 0; +@media all and (max-width: 900px) { + .region-header { + text-align: center; } -} -@media all and (min-width: 901px) { #logo, - .site-logo { - padding: 9px 4px 4px 9px; /* LTR */ + #name-and-slogan { + width: auto; } - [dir="rtl"] #logo, - [dir="rtl"] .site-logo { - padding: 9px 9px 4px 4px; + .region-header { + width: 100%; + text-align: center; } } -#name-and-slogan, -.site-branding-text { - float: left; /* LTR */ - margin: 0; - padding: 5px 10px 8px; + + +.region-header .site-branding { + margin-top: 0.429em; } -[dir="rtl"] #name-and-slogan, -[dir="rtl"] .site-branding-text { - margin: 0 15px 30px 0; +.region-header .site-branding:only-child { + margin-bottom: 2.714em; } -@media all and (min-width: 461px) and (max-width: 900px) { - #name-and-slogan, - .site-branding-text { - padding: 10px 10px 8px; +@media all and (min-width: 461px) { + .region-header .site-branding:only-child { + margin-bottom: 1.857em; } } -@media all and (min-width: 901px) { - #name-and-slogan, - .site-branding-text { - padding: 26px 0 0; - margin: 0 0 30px 15px; /* LTR */ +@media all and (min-width: 461px) { + .region-header .block { + float: right; /* LTR */ + margin-top: 0.714em; + } + [dir="rtl"] .region-header .block { + float: left; + } + .region-header .site-branding { + float: left; /* LTR */ + margin-bottom: 1.857em; } - [dir="rtl"] #name-and-slogan, - [dir="rtl"] .site-branding-text { - margin: 0 15px 30px 0; + [dir="rtl"] .region-header .site-branding { + float: right; } } -#site-name, -.site-name { - font-size: 1.6em; - color: #686868; - line-height: 1; + +/* Region header blocks. */ +.region-header .block:not(.site-branding) { + font-size: 0.857em; + margin: 0 0 1em; + clear: right; } @media all and (min-width: 901px) { - #site-name, - .site-name { - font-size: 1.821em; + .region-header .block:not(.site-branding) { + margin: 1.167em 0 1em; } } -h1#site-name, -h1.site-name { - margin: 0; -} -#site-name a, -.site-name a { - font-weight: normal; -} -#site-slogan, -.site-slogan { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 0.929em; - margin-top: 7px; - word-spacing: 0.1em; - font-style: italic; -} -/* Region header blocks. */ -.region-header .block { - font-size: 0.857em; - float: left; /* LTR */ - margin: 0 10px; - padding: 0; +@media all and (max-width: 460px) { + .region-header .block { + clear: both; + float: none; + } } .region-header .block > h2 { /* @extend .visually-hidden */ @@ -133,6 +113,9 @@ h1.site-name { list-style-image: none; padding: 0; } +.region-header .branding { + font-size: 1em; +} .region-header .form-text { background: #fefefe; background: rgba(255, 255, 255, 0.7); @@ -146,8 +129,8 @@ h1.site-name { margin-right: 0; } .region-header .form-text:hover, -.region-header .form-text:active, -.region-header .form-text:focus { +.region-header .form-text:focus, +.region-header .form-text:active { background: #fff; background: rgba(255, 255, 255, 0.8); } @@ -170,15 +153,15 @@ h1.site-name { padding: 3px 7px; } .region-header .block-menu li a:hover, -.region-header .block-menu li a:active, -.region-header .block-menu li a:focus { +.region-header .block-menu li a:focus, +.region-header .block-menu li a:active { text-decoration: none; background: rgba(255, 255, 255, 0.15); } .region-header .block-menu li:last-child a { border-bottom: 0; } -/* User Login block in the header region */ +/* User Login block in the header region. */ .region-header #block-user-login { width: auto; } @@ -236,14 +219,23 @@ h1.site-name { background: #fff; background: rgba(255, 255, 255, 0.9); } -/* Search block in region header. */ +/* Search block in header region. */ .region-header #block-search-form { width: 208px; } .region-header #block-search-form .form-text { width: 154px; } -/* Language switcher block in region header. */ +.region-header .search-block-form { + float: right; +} +@media all and (max-width: 900px) { + .region-header .search-block-form { + float: none; + } +} + +/* Language switcher block in header region. */ .region-header .block-locale ul li { display: inline; padding: 0 0.5em; @@ -252,11 +244,9 @@ h1.site-name { border-bottom: none; } -[dir="rtl"] #logo, +[dir="rtl"] .branding, [dir="rtl"] .site-logo, -[dir="rtl"] #name-and-slogan, [dir="rtl"] .site-branding-text, -[dir="rtl"] .region-header .block, [dir="rtl"] .region-header #block-user-login .form-item, [dir="rtl"] .region-header #block-user-login .item-list li { float: right; diff --git a/core/themes/bartik/css/components/site-branding.css b/core/themes/bartik/css/components/site-branding.css new file mode 100644 index 0000000..dd5e993 --- /dev/null +++ b/core/themes/bartik/css/components/site-branding.css @@ -0,0 +1,41 @@ +/** + * @file + * Visual styles for the Site Branding block in Bartik. + */ + +.site-branding__logo { + display: inline-block; + margin-right: 0.857em; /* LTR */ + margin-bottom: 0.286em; +} +[dir="rtl"] .site-branding__logo { + margin-right: 0; + margin-left: 0.857em; +} +.site-branding__text { + display: inline-block; + vertical-align: top; +} +@media all and (min-width: 901px) { + .site-branding__text { + vertical-align: bottom; + padding-bottom: 0.286em; + } +} +.site-branding__name { + font-size: 1.6em; + color: #686868; + line-height: 1; +} +@media all and (min-width: 901px) { + .site-branding__name { + font-size: 1.821em; + } +} +.site-branding__slogan { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 0.929em; + margin-top: 7px; + word-spacing: 0.1em; + font-style: italic; +} diff --git a/core/themes/bartik/css/maintenance-page.css b/core/themes/bartik/css/maintenance-page.css index 9a08d04..ffe0a61 100644 --- a/core/themes/bartik/css/maintenance-page.css +++ b/core/themes/bartik/css/maintenance-page.css @@ -35,19 +35,19 @@ body.maintenance-page { background-color: #fff; background-image: none; } -.maintenance-page #name-and-slogan { +.maintenance-page .site-branding-text { margin-bottom: 50px; margin-left: 0; /* LTR */ padding-top: 20px; font-size: 90%; } -[dir="rtl"] .maintenance-page #name-and-slogan { +[dir="rtl"] .maintenance-page .site-branding-text { margin-right: 0; } -.maintenance-page #name-and-slogan, -.maintenance-page #name-and-slogan a, -.maintenance-page #name-and-slogan a:hover, -.maintenance-page #name-and-slogan a:focus { +.maintenance-page .site-branding-text, +.maintenance-page .site-branding-text a, +.maintenance-page .site-branding-text a:hover, +.maintenance-page .site-branding-text a:focus { color: #777; } .maintenance-page h1#page-title { diff --git a/core/themes/bartik/templates/block--system-branding-block.html.twig b/core/themes/bartik/templates/block--system-branding-block.html.twig index 4a4b733..9bf4f3d 100644 --- a/core/themes/bartik/templates/block--system-branding-block.html.twig +++ b/core/themes/bartik/templates/block--system-branding-block.html.twig @@ -13,21 +13,22 @@ * - site_slogan: Slogan for site as defined in Site information settings. */ #} +{% set attributes = attributes.addClass('site-branding') %} {% block content %} {% if site_logo %} - {% endif %} {% if site_name or site_slogan %} -
+
{% if site_name %} - - {{ site_name }} - + {% endif %} {% if site_slogan %} -
{{ site_slogan }}
+
{{ site_slogan }}
{% endif %}
{% endif %} diff --git a/core/themes/bartik/templates/page.html.twig b/core/themes/bartik/templates/page.html.twig index d1ba506..4f3c5a2 100644 --- a/core/themes/bartik/templates/page.html.twig +++ b/core/themes/bartik/templates/page.html.twig @@ -25,13 +25,7 @@ * name has been disabled in the theme settings. * - site_slogan: The slogan of the site. This is empty when displaying the site * slogan has been disabled in theme settings. - * - hide_site_name: A flag indicating if the site name has been toggled off on - * the theme settings page. If hidden, the "visually-hidden" class is added - * to make the site name visually hidden, but still accessible. - * - hide_site_slogan: A flag indicating if the site slogan has been toggled off - * on the theme settings page. If hidden, the "visually-hidden" class is - * added to make the site slogan visually hidden, but still accessible. - * + * Page content (in order of occurrence in the default page.html.twig): * - title_prefix: Additional output populated by modules, intended to be * displayed in front of the main title tag that appears in the template. @@ -77,34 +71,6 @@