import {LitElement, html, css, unsafeCSS} from 'lit';
import {customElement} from 'lit/decorators.js';
import { breakpoints } from '../../breakpoints';

@customElement('iu-breadcrumbs')

export class Breadcrumbs extends LitElement {
  static override styles = css`
    :host{
      display: block;
      margin-top: var(--iu-spacing-3);
    }
    @media ${unsafeCSS(breakpoints.md)} {
      :host{
        margin-top: var(--iu-spacing-7);
      }
    }
    @media ${unsafeCSS(breakpoints.xl)} {
      :host{
        margin-top: var(--iu-spacing-10);
      }
    }
    :host ul{
      margin: 0;
      padding: 0;
      list-style-type: none;
    }
    :host iu-container{
      margin-bottom: 0;
    }
  `;

  override render() {
    return html`
      <iu-container>
        <nav aria-label="Breadcrumbs">
          <ul>
            <slot></slot>
          </ul>
        </nav>
      </iu-container>
    `;
  }

}

declare global {
  interface HTMLElementTagNameMap {
    'iu-breadcrumbs': Breadcrumbs;
  }
}