diff --git a/src/Docs.mdx b/src/Docs.mdx index ac6f87a..235b569 100644 --- a/src/Docs.mdx +++ b/src/Docs.mdx @@ -29,6 +29,7 @@ body { background-color: var(--bt-background-color); color: var(--bt-text-color); font-family: var(--bt-font-family); + margin: 0; } ``` diff --git a/src/Header/Header.stories.ts b/src/Header/Header.stories.ts index a2c7be4..1e48fd3 100644 --- a/src/Header/Header.stories.ts +++ b/src/Header/Header.stories.ts @@ -5,8 +5,11 @@ import { BTHeaderProps } from './Header'; const meta: Meta = { title: 'BTHeader', render: () => - html`
-
child text
+ html`
+

main text

diff --git a/src/Header/Header.ts b/src/Header/Header.ts index a966171..780cebb 100644 --- a/src/Header/Header.ts +++ b/src/Header/Header.ts @@ -1,5 +1,5 @@ -import { css, html } from 'lit'; -import { customElement, htmlToString } from '../utils'; +import { css } from 'lit'; +import { customElement } from '../utils'; export type BTHeaderProps = { title?: string; @@ -29,17 +29,4 @@ export type BTHeaderProps = { } `, }) -export class BTHeader extends HTMLElement { - template = document.createElement('template'); - - constructor() { - super(); - this.template.innerHTML = htmlToString(html` -

${this.title}

- `); - } - - connectedCallback() { - this.firstElementChild?.prepend(this.template.content.cloneNode(true)); - } -} +export class BTHeader extends HTMLElement {} diff --git a/src/Heading/Heading.ts b/src/Heading/Heading.ts index 05c0e23..756364c 100644 --- a/src/Heading/Heading.ts +++ b/src/Heading/Heading.ts @@ -7,10 +7,20 @@ export type BTHeadingProps = {}; name: 'bt-heading', extends: 'h1', styles: css` - [is="bt-heading"] { + [is='bt-heading'] { display: block; - color: var(--bt-strong-text-color); + color: var(--heading-color, var(--bt-strong-text-color)); + transition: color 0.3s; margin: unset; + + a:has(&) { + color: var(--bt-strong-text-color); + text-decoration: none; + } + + a:has(&):hover { + --heading-color: var(--bt-text-color); + } } `, })