Skip to content

Commit c31e493

Browse files
committed
feat: enable the logo theming via CSS variables
1 parent defd3b1 commit c31e493

File tree

9 files changed

+238
-97
lines changed

9 files changed

+238
-97
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ Regarding BREAKING CHANGES in between, please have a look into [the migration gu
1212

1313
## [Unreleased]
1414

15+
### Changed
16+
17+
- Enable the logo theming via CSS variables
1518
## [0.12.0] - 2022-05-04
1619

1720
### Changed

assets/images/db_logo.svg

Lines changed: 4 additions & 1 deletion
Loading

package-lock.json

Lines changed: 145 additions & 95 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.DO-NOT-COPY-THIS-CLASS-example-logo-list {
2+
list-style: none;
3+
4+
padding-left: 0;
5+
6+
color: $db-color-cool-gray-700;
7+
8+
li {
9+
display: inline-block;
10+
box-sizing: border-box;
11+
12+
margin: 4px;
13+
padding: 80px;
14+
border-radius: 4px;
15+
16+
color: $db-color-cool-gray-700;
17+
18+
&.DO-NOT-COPY-THIS-CLASS-example-bg-variants-cool-gray {
19+
background-color: $db-color-cool-gray-100;
20+
}
21+
&.DO-NOT-COPY-THIS-CLASS-example-bg-variants-red {
22+
background-color: $db-color-red-500;
23+
24+
--db-logo-color: #{$db-color-white};
25+
}
26+
&.DO-NOT-COPY-THIS-CLASS-example-bg-variants-image {
27+
background-image: url(https://marketingportal.extranet.deutschebahn.com/sites/default/files/2021-12-13/Ausn01.png);
28+
background-repeat: no-repeat;
29+
background-size: cover;
30+
31+
display: block;
32+
33+
padding-top: 37px;
34+
padding-left: 37px;
35+
36+
width: 600px;
37+
height: 358px;
38+
39+
--db-logo-backgroundcolor: #{$db-color-white};
40+
}
41+
}
42+
}

source/_patterns/logo/logo.hbs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<ul class="DO-NOT-COPY-THIS-CLASS-example-logo-list">
2+
{{#each example-bgs }}
3+
<li class="DO-NOT-COPY-THIS-CLASS-example-bg-variants-{{ variant }}">
4+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="56" aria-hidden="true">
5+
<use href="../../images/db_logo.svg#logo"></use>
6+
</svg>
7+
</li>
8+
{{/each }}
9+
</ul>

source/_patterns/logo/logo.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"example-bgs": [
3+
{
4+
"variant": "regular"
5+
},
6+
{
7+
"variant": "cool-gray"
8+
},
9+
{
10+
"variant": "red"
11+
},
12+
{
13+
"variant": "image"
14+
}
15+
]
16+
}

source/_patterns/logo/logo.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: Deutsche Bahn Logo
3+
---
4+
5+
Please find a lot of more information regarding our logo and how to use it within the Marketingportal: <https://marketingportal.extranet.deutschebahn.com/de/logo-3>
6+
7+
#### Adapt logos colors (background and fill)
8+
9+
You could easily change the line-colors of the logo as well as the background color by defining different color values for both CSS variables:
10+
11+
- `--db-logo-color`
12+
- `--db-logo-backgroundcolor`
13+
14+
The fallback for an undefined `--db-logo-color` is our DB Red (`#f01414`), and `--db-logo-backgroundcolor` would fall back to `transparent`, which is the general background defined by brand.

source/css/db-ui-base.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
} */
77

88
@import "../_patterns/icons/icons.demonstration";
9+
@import "../_patterns/logo/logo.demonstration";

source/images/db_logo.svg

Lines changed: 4 additions & 1 deletion
Loading

0 commit comments

Comments
 (0)