Skip to content

Commit

Permalink
sp-element-title: apply foundation.css
Browse files Browse the repository at this point in the history
  • Loading branch information
ko-noguchi committed Oct 26, 2024
1 parent a1c609c commit a7ab4a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/components/elementTitle/element-title.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@

.text-links {
display: flex;
flex-shrink: 0;
align-items: center;
gap: 16px;
}

.buttons {
display: flex;
flex-shrink: 0;
align-items: center;
gap: 8px;
}
Expand Down
9 changes: 4 additions & 5 deletions src/components/elementTitle/sp-element-title.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// @ts-ignore
import resetStyle from "@acab/reset.css?inline" assert { type: "css" };
// @ts-ignore
import foundationStyle from "../foundation.css?inline" assert { type: "css" };
// @ts-ignore
import elementTitleStyle from "./element-title.css?inline" assert { type: "css" };

const resetStyles = new CSSStyleSheet();
resetStyles.replaceSync(resetStyle);

const styles = new CSSStyleSheet();
styles.replaceSync(elementTitleStyle);
styles.replaceSync(`${resetStyle} ${foundationStyle} ${elementTitleStyle}`);

export class SpElementTitle extends HTMLElement {
#headingElement = document.createElement("h3");
Expand All @@ -26,7 +25,7 @@ export class SpElementTitle extends HTMLElement {
super();
this.attachShadow({ mode: "open" });

this.shadowRoot.adoptedStyleSheets = [resetStyles, styles];
this.shadowRoot.adoptedStyleSheets = [styles];

this.#textLinkSlotElement.name = "text-links";
this.#buttonSlotElement.name = "buttons";
Expand Down

0 comments on commit a7ab4a3

Please sign in to comment.