Skip to content

Commit

Permalink
feat(cxl-ui): [cxl-certificate-header] update styles
Browse files Browse the repository at this point in the history
  • Loading branch information
anoblet committed Feb 22, 2024
1 parent 374c4f3 commit 475426e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/cxl-ui/scss/cxl-certificate-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
}

.title {
font-size: var(--lumo-font-size-xxl);
margin: 0;
}

Expand Down
24 changes: 20 additions & 4 deletions packages/cxl-ui/src/components/cxl-certificate-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { customElement, property } from 'lit/decorators.js';
import '@conversionxl/cxl-lumo-styles';
import '@conversionxl/cxl-ui/src/components/cxl-section.js';
import { registerGlobalStyles } from '@conversionxl/cxl-lumo-styles/src/utils';
import { MediaQueryController } from '@vaadin/component-base/src/media-query-controller.js';

import cxlCertificateHeaderStyles from '../styles/cxl-certificate-header-css.js';
import cxlCertificateHeaderGlobalStyles from '../styles/global/cxl-certificate-header-css.js';
Expand All @@ -27,16 +28,31 @@ export class CXLCertificateHeaderElement extends LitElement {

@property({ type: Boolean, attribute: 'hide-credential' }) hideCredential = false;

@property({ type: Boolean, reflect: true })
wide;

_wideMediaQuery = '(min-width: 528px)';

constructor() {
super();

this.addController(
new MediaQueryController(this._wideMediaQuery, (matches) => {
this.wide = matches;
})
);
}

// eslint-disable-next-line class-methods-use-this
_renderCompletedEmblem() {
if (!this.theme.includes('completed')) {
return nothing;
}

return html`<h2 class="completed">
return html`<h3 class="completed">
<span class="completed-icon"><vaadin-icon icon="lumo:checkmark"></vaadin-icon></span>
Training completed
</h2>`;
Certificate earned
</h3>`;
}

// eslint-disable-next-line class-methods-use-this
Expand Down Expand Up @@ -77,7 +93,7 @@ export class CXLCertificateHeaderElement extends LitElement {
${this._renderStats()}
${this._renderActions()}
</div>
${this._renderCredential()}
${this.wide ? this._renderCredential() : nothing}
</div>
</cxl-section>
`;
Expand Down

0 comments on commit 475426e

Please sign in to comment.