Skip to content

Commit

Permalink
html構造が見やすいようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
IttetsuSato committed Nov 4, 2024
1 parent 8e7fd14 commit eb3f80b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/components/definitionList/sp-definition-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ const styles = new CSSStyleSheet();
styles.replaceSync(`${resetStyle} ${foundationStyle} ${spDefinitionListStyle}`);

export class SpDefinitionList extends HTMLElement {
#dlElement = document.createElement("dl");
#slotElement = document.createElement("slot");

constructor() {
super();
this.attachShadow({ mode: "open" });
Expand All @@ -22,9 +19,11 @@ export class SpDefinitionList extends HTMLElement {
...this.shadowRoot.adoptedStyleSheets,
styles,
];
this.#dlElement.classList.add("base");
this.#dlElement.appendChild(this.#slotElement);
this.shadowRoot.appendChild(this.#dlElement);
this.shadowRoot.innerHTML = `
<dl class="base">
<slot></slot>
</dl>
`;
}
}

Expand Down

0 comments on commit eb3f80b

Please sign in to comment.