-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor repeat select template by section (#3259)
* implement template select for reusability * fix feature card columns * fix feature counter number placement * fix hover styling in feature section * update framework template * Update design system imports * Consolidate css Co-authored-by: Michael Benson <[email protected]>
- Loading branch information
1 parent
ebdade6
commit 4e30a98
Showing
7 changed files
with
105 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 5 additions & 69 deletions
74
...te/src/app/components/content-placement-container/content-placement-container.template.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,9 @@ | ||
import { html, repeat, when } from "@microsoft/fast-element"; | ||
import { html, repeat } from "@microsoft/fast-element"; | ||
import { ContentPlacementContainer } from "./content-placement-container"; | ||
import { SiteContentPlacement } from "../content-placement"; | ||
|
||
const template = html<SiteContentPlacement>` ${(x, c) => c.parent.selectTemplate()} `; | ||
|
||
export const ContentPlacementContainerTemplate = html<ContentPlacementContainer>` | ||
${when( | ||
x => x.section === "framework", | ||
html<ContentPlacementContainer>` | ||
${repeat( | ||
x => x.frameworkContentPlacementData, | ||
html` | ||
<site-content-placement class="framework_ContentPlacement"> | ||
<h3> | ||
${x => (x.headerSubscript ? x.header + " " : x.header)} | ||
<small class="headerSubscript" | ||
>${x => x.headerSubscript}</small | ||
> | ||
</h3> | ||
<p slot="body">${x => x.body}</p> | ||
</site-content-placement> | ||
` | ||
)} | ||
` | ||
)} | ||
${when( | ||
x => x.section === "feature", | ||
html<ContentPlacementContainer>` | ||
<site-card-section> | ||
${repeat( | ||
x => x.featureCardData, | ||
html` | ||
<site-feature-card> | ||
<h4>${x => x.header}</h4> | ||
<p slot="body">${x => x.body}</p> | ||
<fast-anchor | ||
slot="footer" | ||
href=${x => x.githubLink} | ||
appearance="lightweight" | ||
>View Github</fast-anchor | ||
> | ||
<fast-anchor | ||
slot="footer" | ||
href=${x => x.documentationLink} | ||
appearance="lightweight" | ||
>Read Documentation</fast-anchor | ||
> | ||
</site-feature-card> | ||
` | ||
)} | ||
</site-card-section> | ||
` | ||
)} | ||
${when( | ||
x => x.section === "community", | ||
html<ContentPlacementContainer>` | ||
${repeat( | ||
x => x.communityContentPlacementData, | ||
html` | ||
<site-content-placement icon> | ||
<div slot="icon" :innerHTML=${x => x.icon}></div> | ||
<h3>${x => x.header}</h3> | ||
<p slot="body">${x => x.body}</p> | ||
<fast-anchor | ||
slot="action" | ||
appearance="lightweight" | ||
href=${x => x.actionLink} | ||
>${x => x.actionText}</fast-anchor | ||
> | ||
</site-content-placement> | ||
` | ||
)} | ||
` | ||
)} | ||
${repeat(x => x.selectData(), template)} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...st-website/src/app/components/content-placement-container/templates/community.template.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { html } from "@microsoft/fast-element"; | ||
|
||
const communityTemplate = html`<site-content-placement icon> | ||
<div slot="icon" :innerHTML=${x => x.icon}></div> | ||
<h3>${x => x.header}</h3> | ||
<p slot="body">${x => x.body}</p> | ||
<fast-anchor slot="action" appearance="lightweight" href=${x => x.actionLink} | ||
>${x => x.actionText}</fast-anchor | ||
> | ||
</site-content-placement> `; | ||
|
||
export default communityTemplate; |
14 changes: 14 additions & 0 deletions
14
...fast-website/src/app/components/content-placement-container/templates/feature.template.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { html } from "@microsoft/fast-element"; | ||
|
||
const featureTemplate = html`<site-feature-card> | ||
<h4>${x => x.header}</h4> | ||
<p slot="body">${x => x.body}</p> | ||
<fast-anchor slot="footer" href=${x => x.githubLink} appearance="lightweight" | ||
>View Github</fast-anchor | ||
> | ||
<fast-anchor slot="footer" href=${x => x.documentationLink} appearance="lightweight" | ||
>Read Documentation</fast-anchor | ||
> | ||
</site-feature-card> `; | ||
|
||
export default featureTemplate; |
11 changes: 11 additions & 0 deletions
11
...st-website/src/app/components/content-placement-container/templates/framework.template.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { html } from "@microsoft/fast-element"; | ||
|
||
const frameworkTemplate = html`<site-content-placement class="framework_ContentPlacement"> | ||
<h3> | ||
${x => (x.headerSubscript ? x.header + " " : x.header)} | ||
<small class="headerSubscript">${x => x.headerSubscript}</small> | ||
</h3> | ||
<p slot="body">${x => x.body}</p> | ||
</site-content-placement>`; | ||
|
||
export default frameworkTemplate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters