Skip to content

Commit

Permalink
chore: add feature card to content-placement-container and update hov…
Browse files Browse the repository at this point in the history
…er styles (#3177)

* add svg, update padding and text variables, add borders to framework to align with design

* remove class's for framework content placement and use nth-of-type. update h3 style. update section container class naming function

* add feature-card to content-placement-container

* removed comented out text from index, make style changes needed post rebase, and remove unused imports

* add updated hover design to features and community

* switched box-shadow for elevation algorithm. removed back shadow on individual cards

* add with behaviors to styles

* update comment

* fix layout issue after rebase
  • Loading branch information
SamanthaAO authored and chrisdholt committed Jun 4, 2020
1 parent 5fdd97f commit acb636b
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 64 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { css } from "@microsoft/fast-element";
import { display } from "@microsoft/fast-foundation";
import { elevation } from "@microsoft/fast-components/dist/esm/styles/elevation.js";
import {
neutralForegroundHintBehavior,
neutralForegroundHoverBehavior,
neutralOutlineRestBehavior,
neutralFillActiveBehavior,
} from "@microsoft/fast-components";

export const ContentPlacementContainerStyles = css`
${display("block")}:host {
Expand All @@ -16,6 +23,13 @@ export const ContentPlacementContainerStyles = css`
justify-content: center;
}
.feature_container {
display: grid;
grid-template-rows: repeat(4, min-content);
grid-auto-flow: var(--flow);
justify-content: center;
}
.framework_ContentPlacement {
border: var(--border);
border-width: 0 0 var(--border-width);
Expand All @@ -33,10 +47,18 @@ export const ContentPlacementContainerStyles = css`
}
@media screen and (min-width: 700px) and (max-width: 999px) {
:host {
--flow: row;
}
.framework_container {
grid-template-columns: repeat(2, 1fr);
}
.community_container {
grid-template-columns: repeat(3, 1fr);
}
.framework_ContentPlacement:nth-of-type(even) {
border-right: none;
}
Expand All @@ -48,6 +70,10 @@ export const ContentPlacementContainerStyles = css`
}
@media screen and (min-width: 1000px) {
:host {
--flow: column;
}
.framework_container,
.community_container {
grid-template-columns: repeat(3, 1fr);
Expand All @@ -68,14 +94,39 @@ export const ContentPlacementContainerStyles = css`
/* only two items on a row that should fit three */
border-bottom: none;
}
.framework_ContentPlacement:nth-of-type(6) {
border: none;
}
}
/* This creates the color, background, and elevation changes on hover */
/* start */
.community_container:hover site-content-placement,
.feature_container:hover site-feature-card {
color: var(--neutral-foreground-hint);
}
.community_container:hover site-content-placement:hover,
.feature_container:hover site-feature-card:hover {
--elevation: 4;
background: var(--neutral-fill-active);
border-radius: calc(var(--corner-radius) * 1px);
color: var(--neutral-foreground-hover);
${elevation}
}
/* end */
.icon {
fill: currentColor;
}
h3 {
margin-top: 0 0 calc(var(--design-unit) * 5px) 0;
margin: 0 0 calc(var(--design-unit) * 5px) 0;
font-size: var(--type-ramp-plus-2-font-size);
}
`;
`.withBehaviors(
neutralForegroundHintBehavior,
neutralForegroundHoverBehavior,
neutralOutlineRestBehavior,
neutralFillActiveBehavior
);
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { html, repeat, when } from "@microsoft/fast-element";
import { ContentPlacementContainer } from "./content-placement-container";
import { CommunityContentPlacementData } from "../../data/community.data";

export const ContentPlacementContainerTemplate = html<ContentPlacementContainer>`
<div
class="container ${x =>
["framework", "community"].includes(x.section)
["framework", "feature", "community"].includes(x.section)
? `${x.section}_container`
: ""}"
>
Expand All @@ -21,6 +20,31 @@ export const ContentPlacementContainerTemplate = html<ContentPlacementContainer>
)}
`
)}
${when(
x => x.section === "feature",
html<ContentPlacementContainer>`
${repeat(
x => x.featureCardData,
html`<site-feature-card>
<div>${x => x.item}</div>
<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>`
)}
`
)}
${when(
x => x.section === "community",
html<ContentPlacementContainer>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import {
FrameworkContentPlacementData,
frameworkContentPlacementData,
} from "../../data/framework.data";
import { FeatureCardData, featureCardData } from "../../data/feature.data";

export class ContentPlacementContainer extends FASTElement {
@attr section: string;

communityContentPlacementData: CommunityContentPlacementData[] = communityContentPlacementData;
frameworkContentPlacementData: FrameworkContentPlacementData[] = frameworkContentPlacementData;
featureCardData: FeatureCardData[] = featureCardData;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const ContentPlacementStyles = css`
text-align: left;
display: flex;
flex-direction: column;
box-shadow: none;
}
fast-card ::slotted([slot="body"]) {
Expand Down
74 changes: 74 additions & 0 deletions sites/fast-website/src/app/data/feature.data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
export interface FeatureCardData {
body: string;
documentationLink: string;
githubLink: string;
header: string;
item: string;
}

export const featureCardData: FeatureCardData[] = [
{
body:
"Create new component compositions by nesting, styling base components, and passing unhandled props. The combinations are endless.",
documentationLink: "#",
githubLink: "#",
header: "Composition",
item: "01",
},
{
body:
"Use Fluent by default or customize design system properties to make it your own. Or, create your own design system to use with FAST components.",
documentationLink: "#",
githubLink: "#",
header: "Design Systems",
item: "02",
},
{
body:
"Out of the box, FAST components are built on React, but you can build components on any modern framework using the FAST system.",
documentationLink: "#",
githubLink: "#",
header: "Technology",
item: "03",
},
{
body:
"All FAST components follow WCAG 2.1, are W3C spec-compliant and use the W3C interaction models when available.",
documentationLink: "#",
githubLink: "#",
header: "Web Standards",
item: "04",
},
{
body:
"Design sophisticated animation sequences with the animation library, an interface for the Web Animations API.",
documentationLink: "#",
githubLink: "#",
header: "Animation",
item: "05",
},
{
body:
"Create color palettes, extract colors from images, and handle other color operations using our color library.",
documentationLink: "#",
githubLink: "#",
header: "Colors",
item: "06",
},
{
body:
"Build layouts such as a 12 column grid for content or an application grid with resizable panels.",
documentationLink: "#",
githubLink: "#",
header: "Layout / Grid",
item: "07",
},
{
body:
"Leverage a toolkit of general utilities such as keyboarding, Right-To-Left (RTL), number, and string manipulation.",
documentationLink: "#",
githubLink: "#",
header: "Other",
item: "08",
},
];
61 changes: 1 addition & 60 deletions sites/fast-website/src/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,66 +92,7 @@

<!-- documentation:start -->
<section class="section">
<div class="section-component">
<site-card-section>
<site-feature-card>
<div>01</div>
<h4>Composition</h4>
<p slot="body">Create new component compositions by nesting, styling base components, and passing unhandled props. The combinations are endless.</p>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">View Github</fast-anchor>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">Read Documentation</fast-anchor>
</site-feature-card>
<site-feature-card>
<div>02</div>
<h4>Design Systems</h4>
<p slot="body">Use Fluent by default or customize design system properties to make it your own. Or, create your own design system to use with FAST components.</p>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">View Github</fast-anchor>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">Read Documentation</fast-anchor>
</site-feature-card>
<site-feature-card>
<div>03</div>
<h4>Technology</h4>
<p slot="body">Out of the box, FAST components are built on React, but you can build components on any modern framework using the FAST system.</p>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">View Github</fast-anchor>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">Read Documentation</fast-anchor>
</site-feature-card>
<site-feature-card>
<div>04</div>
<h4>Web Standards</h4>
<p slot="body">All FAST components follow WCAG 2.1, are W3C spec-compliant and use the W3C interaction models when available.</p>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">View Github</fast-anchor>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">Read Documentation</fast-anchor>
</site-feature-card>
<site-feature-card>
<div>05</div>
<h4>Animation</h4>
<p slot="body">Design sophisticated animation sequences with the animation library, an interface for the Web Animations API.</p>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">View Github</fast-anchor>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">Read Documentation</fast-anchor>
</site-feature-card>
<site-feature-card>
<div>06</div>
<h4>Colors</h4>
<p slot="body">Create color palettes, extract colors from images, and handle other color operations using our color library.</p>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">View Github</fast-anchor>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">Read Documentation</fast-anchor>
</site-feature-card>
<site-feature-card>
<div>07</div>
<h4>Layout / Grid</h4>
<p slot="body">Build layouts such as a 12 column grid for content or an application grid with resizable panels.</p>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">View Github</fast-anchor>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">Read Documentation</fast-anchor>
</site-feature-card>
<site-feature-card>
<div>08</div>
<h4>Other</h4>
<p slot="body">Leverage a toolkit of general utilities such as keyboarding, Right-To-Left (RTL), number, and string manipulation.</p>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">View Github</fast-anchor>
<fast-anchor slot="footer" class="link" href="#" appearance="lightweight">Read Documentation</fast-anchor>
</site-feature-card>
</site-card-section>
</div>
<site-content-placement-container section="feature"></site-content-placement-container>
</section>
<!-- documentation:end -->

Expand Down

0 comments on commit acb636b

Please sign in to comment.