File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
packages/uikit-workshop/src/scripts/lit-components Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable no-unused-vars, no-param-reassign */
2
2
import { store } from '../../store.js' ; // connect to redux
3
+ import { ifDefined } from 'lit-html/directives/if-defined' ;
3
4
import { html } from 'lit-html' ;
4
5
import { BaseLitComponent } from '../../components/base-component' ;
5
6
import { customElement } from 'lit-element' ;
@@ -116,7 +117,8 @@ class Header extends BaseLitComponent {
116
117
: window . config ?. theme ?. logo ?. url || '/' } "
117
118
alt-text ="${ window . config ?. theme ?. logo ?. altText || '' } "
118
119
theme ="${ this . themeMode } "
119
- ratio ="${ window . config ?. theme ?. logo ?. ratio || '' } "
120
+ width ="${ ifDefined ( window . config ?. theme ?. logo ?. width ) } "
121
+ height ="${ ifDefined ( window . config ?. theme ?. logo ?. height ) } "
120
122
text ="${ window . config ?. theme ?. logo ?. text === '' ||
121
123
window . config ?. theme ?. logo ?. text === false ||
122
124
window . config ?. theme ?. logo ?. text === 'none'
Original file line number Diff line number Diff line change 1
1
import { store } from '../../store.js' ; // connect to redux
2
+ import { ifDefined } from 'lit-html/directives/if-defined' ;
2
3
import { html } from 'lit-html' ;
3
4
import { customElement } from 'lit-element' ;
4
5
import { BaseLitComponent } from '../../components/base-component' ;
@@ -20,7 +21,8 @@ class Logo extends BaseLitComponent {
20
21
21
22
static get properties ( ) {
22
23
return {
23
- ratio : String ,
24
+ width : String ,
25
+ height : String ,
24
26
theme : String ,
25
27
url : String ,
26
28
text : String ,
@@ -48,6 +50,8 @@ class Logo extends BaseLitComponent {
48
50
alt =${ this . altText || 'Pattern Lab Logo' }
49
51
src =${ imageSrc }
50
52
class="pl-c-logo__img"
53
+ width="${ ifDefined ( this . width ) } "
54
+ height="${ ifDefined ( this . height ) } "
51
55
/>
52
56
${ this . text && this . text !== ''
53
57
? html `
You can’t perform that action at this time.
0 commit comments