Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme: Reference SVG logos with img element instead of object. #8282

Merged
merged 1 commit into from
Feb 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion site/includes/brand.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="wb-sttl" class="col-md-8">
<a href="{{assets}}/index-{{#contains language "fr"}}{{language}}{{else}}en{{/contains}}.html">
<object type="image/svg+xml" tabindex="-1" data="{{assets}}/../{{site.theme}}/assets/logo.svg"></object>
<img src="{{assets}}/../{{site.theme}}/assets/logo.svg" alt="" />
<span>{{{i18n "site-title"}}}<span class="wb-inv">{{{i18n "comma-space"}}}</span><small>{{{i18n "site-tagline"}}}</small></span>
</a>
</div>
30 changes: 16 additions & 14 deletions site/layouts/splashpage.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
"layout": "core.hbs"
}
---
<header role="banner">
<div id="wb-bnr">
<div class="container">
<div class="row mrgn-tp-lg mrgn-bttm-lg">
<div class="col-md-8 col-md-offset-2">
<object type="image/svg+xml" tabindex="-1" role="img" data="{{assets}}/../{{site.theme}}/assets/logo.svg" aria-label="{{{i18n "site-title"}}}"></object>
<div class="wb-sppe">
<header role="banner">
<div id="wb-bnr">
<div class="container">
<div class="row mrgn-tp-lg mrgn-bttm-lg">
<div id="wb-spllg" class="col-md-8 col-md-offset-2">
<img src="{{assets}}/../{{site.theme}}/assets/logo.svg" alt="{{{i18n "site-title"}}}" />
</div>
</div>
</div>
</div>
</div>
</header>
<main role="main" property="mainContentOfPage" class="container">
<div class="row mrgn-tp-lg">
<div class="col-md-12">
{{>body}}
</header>
<main role="main" property="mainContentOfPage" class="container">
<div class="row mrgn-tp-lg">
<div class="col-md-12">
{{>body}}
</div>
</div>
</div>
</main>
</main>
</div>
3 changes: 3 additions & 0 deletions theme/banner/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
Banner
*/

// Needed for backwards compatibility with WET 4.0.27 and below's HTML markup.
// Remove object references from all of this theme's logo selectors in WET 4.1+.
.wb-sppe {
img,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where and when the CSS class .wb-sppe is used? I am not able to find any reference or description of it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was first introduced it in #5293 to prevent the splash page's logo from shrinking when printing in IE (including IE11). Then the HTML markup that referenced that class was apparently inadvertently removed in #6113. Since then, the SCSS selector for it has been present in the WET theme, but wasn't tied to any HTML markup to make it take effect.

As a part of this PR I needed a way of targeting the splash page's logo image. I was going to introduce my own class for that purpose, but then stumbled upon the wb-sppe class and looked into its history. Since it was trying to achieve the same purpose as I was and was accidentally removed, I figured the best way forward would be to restore it.

object {
width: 100%;
}
Expand Down
14 changes: 14 additions & 0 deletions theme/banner/_print.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
/*
Banner (print view)
*/
%theme-wet-boew-banner-img-print-brightness-0 {
img {
filter: brightness(0);
}
}

#wb-bar {
@extend %theme-wet-boew-print-display-none-important;
}

.wb-sppe {
header {
@extend %theme-wet-boew-banner-img-print-brightness-0;
}
}

#wb-sttl {
@extend %theme-wet-boew-banner-img-print-brightness-0;

a {
&:after {
@extend %theme-wet-boew-print-display-none-important;
Expand Down