Skip to content

Commit

Permalink
create initial files for navigation component
Browse files Browse the repository at this point in the history
  • Loading branch information
khamudom committed May 12, 2020
1 parent 8dc8c69 commit cc52f3c
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions sites/fast-website/src/app/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { GradientPicker } from "./gradient-picker";
export { FASTSectionHeader } from "./section-header";
export { FastFrame } from "./fast-frame";
export { SiteNavigation } from "./site-navigation";
14 changes: 14 additions & 0 deletions sites/fast-website/src/app/components/site-navigation/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { customElement } from "@microsoft/fast-element";
import { SiteNavigation } from "./site-navigation";
import { SiteNavigationTemplate as template } from "./site-navigation.template";
import { SiteNavigationStyles as styles } from "./site-navigation.styles";

@customElement({
name: "fast-site-navigation",
template,
styles,
})
export class FASTSectionHeader extends SiteNavigation {}
export * from "./site-navigation.template";
export * from "./site-navigation.styles";
export * from "./site-navigation";
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { css } from "@microsoft/fast-element";
import { display } from "@microsoft/fast-components";

export const SiteNavigationStyles = css`
${display("flex")} :host {
font-family: var(--body-font);
color: var(--neutral-foreground-rest);
box-sizing: border-box;
}
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { html, repeat } from "@microsoft/fast-element";
import { SiteNavigation } from "./site-navigation";

export const SiteNavigationTemplate = html<SiteNavigation>`
<template>
<nav>
<ul>
${repeat(
x => x.items,
html` <li><fast-anchor>Component</fast-anchor></li> `
)}
</ul>
<slot></slot>
</nav>
</template>
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { FASTElement, attr, observable } from "@microsoft/fast-element";

export class SiteNavigation extends FASTElement {
@attr
public item: string;

@observable
public items: string[] = [];
}
1 change: 1 addition & 0 deletions sites/fast-website/src/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<header class="header">
<fast-anchor href="#" appearance="lightweight">Logo</fast-anchor>
<div class="header-link-group">
<fast-site-navigation>Component</fast-site-navigation>
<fast-anchor href="#" appearance="lightweight">Component</fast-anchor>
<fast-anchor href="#" appearance="lightweight">Integration</fast-anchor>
<fast-anchor href="#" appearance="lightweight">Documentation</fast-anchor>
Expand Down

0 comments on commit cc52f3c

Please sign in to comment.