Skip to content

Commit

Permalink
feat: add tag name as attribute when custom registered
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjones243 authored and jason-capsule42 committed Oct 1, 2024
1 parent 5663e82 commit fd68035
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/auro-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

import { LitElement, html } from "lit";

// Import touch detection lib
import { ifDefined } from 'lit/directives/if-defined.js';

import AuroLibraryRuntimeUtils from '@aurodesignsystem/auro-library/scripts/utils/runtimeUtils.mjs';

import styleCss from "./style-css.js";
import tokensCss from "./tokens-css.js";
import colorCss from "./color-css.js";
Expand Down Expand Up @@ -41,6 +43,11 @@ export class AuroCard extends LitElement {

// Properly defines the role of this new custom element for screen readers.
this.setAttribute('role', 'article');

/**
* @private
*/
this.runtimeUtils = new AuroLibraryRuntimeUtils();
}

static get styles() {
Expand Down Expand Up @@ -76,6 +83,11 @@ export class AuroCard extends LitElement {
};
}

firstUpdated() {
// Add the tag name as an attribute if it is different than the component name
this.runtimeUtils.handleComponentTagRename(this, 'auro-card');
}

// function that renders the HTML and CSS into the scope of the component
render() {
const cardContent = html`
Expand Down

0 comments on commit fd68035

Please sign in to comment.