Skip to content

Commit 97ac11a

Browse files
authored
fix(development-site): update styling (#416)
* polish * fixing border * fixing lint error * fixing snapshots
1 parent 5615c97 commit 97ac11a

File tree

10 files changed

+57
-47
lines changed

10 files changed

+57
-47
lines changed

packages/fast-components-react-msft/src/image/__snapshots__/image.spec.ts.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`image image: 0 1`] = `
55
alt="Placeholder with grey background and dimension watermark without any imagery"
66
className="image-0-1-1 image_round-0-1-2"
77
sizes={null}
8-
src="https://placehold.it/2048x600/2F2F2F/171717"
8+
src="https://placehold.it/600x600/2F2F2F/171717"
99
srcSet={null}
1010
/>
1111
`;
@@ -15,8 +15,8 @@ exports[`image image: 1 1`] = `
1515
alt="Placeholder with grey background and dimension watermark without any imagery"
1616
className="image-0-1-4 image_round-0-1-5"
1717
sizes="100vw"
18-
src="https://placehold.it/539x300/2F2F2F/171717"
19-
srcSet="https://placehold.it/2048x600/2F2F2F/171717 2048w, https://placehold.it/1778x600/2F2F2F/171717 1778w, https://placehold.it/1399x600/2F2F2F/171717 1399w, https://placehold.it/1083x500/2F2F2F/171717 1083w, https://placehold.it/767x400/2F2F2F/171717 767w, https://placehold.it/539x300/2F2F2F/171717 0w"
18+
src="https://placehold.it/300x300/2F2F2F/171717"
19+
srcSet="https://placehold.it/600x600/2F2F2F/171717 2048w, https://placehold.it/600x600/2F2F2F/171717 1778w, https://placehold.it/1600x600/2F2F2F/171717 1399w, https://placehold.it/500x500/2F2F2F/171717 1083w, https://placehold.it/400x400/2F2F2F/171717 767w, https://placehold.it/300x300/2F2F2F/171717 0w"
2020
/>
2121
`;
2222

@@ -25,7 +25,7 @@ exports[`image image: 2 1`] = `
2525
alt="Placeholder with grey background and dimension watermark without any imagery"
2626
className="image-0-1-7 image_round-0-1-8"
2727
sizes={null}
28-
src="https://placehold.it/539x300/2F2F2F/171717"
28+
src="https://placehold.it/300x300/2F2F2F/171717"
2929
srcSet={null}
3030
/>
3131
`;
@@ -35,7 +35,7 @@ exports[`image image: 3 1`] = `
3535
alt="Placeholder with grey background and dimension watermark without any imagery"
3636
className="image-0-1-10"
3737
sizes={null}
38-
src="https://placehold.it/2048x600/2F2F2F/171717"
38+
src="https://placehold.it/600x600/2F2F2F/171717"
3939
srcSet={null}
4040
/>
4141
`;

packages/fast-components-react-msft/src/image/examples.data.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,34 @@ export default {
1010
data: [
1111
{
1212
round: true,
13-
src: "https://placehold.it/2048x600/2F2F2F/171717",
14-
vp5: "https://placehold.it/1778x600/2F2F2F/171717",
15-
vp4: "https://placehold.it/1399x600/2F2F2F/171717",
16-
vp3: "https://placehold.it/1083x500/2F2F2F/171717",
17-
vp2: "https://placehold.it/767x400/2F2F2F/171717",
18-
vp1: "https://placehold.it/539x300/2F2F2F/171717",
13+
src: "https://placehold.it/600x600/2F2F2F/171717",
14+
vp5: "https://placehold.it/600x600/2F2F2F/171717",
15+
vp4: "https://placehold.it/600x600/2F2F2F/171717",
16+
vp3: "https://placehold.it/500x500/2F2F2F/171717",
17+
vp2: "https://placehold.it/400x400/2F2F2F/171717",
18+
vp1: "https://placehold.it/300x300/2F2F2F/171717",
1919
alt: "Placeholder with grey background and dimension watermark without any imagery"
2020
},
2121
{
2222
round: true,
23-
src: "https://placehold.it/539x300/2F2F2F/171717",
23+
src: "https://placehold.it/300x300/2F2F2F/171717",
2424
/* tslint:disable-next-line */
25-
srcSet: "https://placehold.it/2048x600/2F2F2F/171717 2048w, https://placehold.it/1778x600/2F2F2F/171717 1778w, https://placehold.it/1399x600/2F2F2F/171717 1399w, https://placehold.it/1083x500/2F2F2F/171717 1083w, https://placehold.it/767x400/2F2F2F/171717 767w, https://placehold.it/539x300/2F2F2F/171717 0w",
25+
srcSet: "https://placehold.it/600x600/2F2F2F/171717 2048w, https://placehold.it/600x600/2F2F2F/171717 1778w, https://placehold.it/1600x600/2F2F2F/171717 1399w, https://placehold.it/500x500/2F2F2F/171717 1083w, https://placehold.it/400x400/2F2F2F/171717 767w, https://placehold.it/300x300/2F2F2F/171717 0w",
2626
sizes: "100vw",
2727
alt: "Placeholder with grey background and dimension watermark without any imagery"
2828
},
2929
{
3030
round: true,
31-
src: "https://placehold.it/539x300/2F2F2F/171717",
31+
src: "https://placehold.it/300x300/2F2F2F/171717",
3232
alt: "Placeholder with grey background and dimension watermark without any imagery"
3333
},
3434
{
35-
src: "https://placehold.it/2048x600/2F2F2F/171717",
36-
vp5: "https://placehold.it/1778x600/2F2F2F/171717",
37-
vp4: "https://placehold.it/1399x600/2F2F2F/171717",
38-
vp3: "https://placehold.it/1083x500/2F2F2F/171717",
39-
vp2: "https://placehold.it/767x400/2F2F2F/171717",
40-
vp1: "https://placehold.it/539x300/2F2F2F/171717",
35+
src: "https://placehold.it/600x600/2F2F2F/171717",
36+
vp5: "https://placehold.it/600x600/2F2F2F/171717",
37+
vp4: "https://placehold.it/600x600/2F2F2F/171717",
38+
vp3: "https://placehold.it/500x500/2F2F2F/171717",
39+
vp2: "https://placehold.it/400x400/2F2F2F/171717",
40+
vp1: "https://placehold.it/300x300/2F2F2F/171717",
4141
alt: "Placeholder with grey background and dimension watermark without any imagery"
4242
},
4343
{

packages/fast-development-site-react/src/components/shell/action-bar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const style: ComponentStyles<IShellActionBarManagedClasses, IDevSiteDesignSystem
1515
background: (config: IDevSiteDesignSystem): string => {
1616
return config.backgroundColor;
1717
},
18-
height: toPx(39),
18+
height: toPx(40),
1919
overflow: "hidden",
2020
borderBottom: `${toPx(1)} solid #CCCCCC`
2121
}

packages/fast-development-site-react/src/components/shell/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const style: ComponentStyles<IShellManagedClasses, IDevSiteDesignSystem> = {
3030
shell: {
3131
fontFamily: "Segoe UI, SegoeUI, Helvetica Neue, Helvetica, Arial, sans-serif",
3232
fontSize: toPx(14),
33-
height: "100vh"
33+
height: "100vh",
34+
display: "flex",
35+
flexDirection: "column"
3436
}
3537
};
3638

packages/fast-development-site-react/src/components/shell/pane.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface IShellPaneManagedClasses {
1717

1818
const style: ComponentStyles<IShellPaneManagedClasses, IDevSiteDesignSystem> = {
1919
shellPane: {
20-
display: "inline-block",
20+
flexShrink: "0",
2121
overflowX: "hidden",
2222
backgroundColor: (config: IDevSiteDesignSystem): string => {
2323
return config.lightGray;

packages/fast-development-site-react/src/components/shell/row.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const style: ComponentStyles<IShellRowManagedClasses, IDevSiteDesignSystem> = {
1414
shellRow: {
1515
display: "flex",
1616
alignItems: "stretch",
17-
height: (config: IDevSiteDesignSystem): string => `calc(100% - ${toPx(config.navigationBarHeight * 2)}`
17+
flexGrow: "1"
1818
}
1919
};
2020

packages/fast-development-site-react/src/components/site/action-bar.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,14 @@ const styles: ComponentStyles<IActionBarClassNameContract, IDevSiteDesignSystem>
8787
flexGrow: "1"
8888
},
8989
actionBar_menu_button: {
90-
...menuButtonBase()
90+
...menuButtonBase(),
91+
"&:active": {
92+
background: "#EBEBEB"
93+
}
9194
},
9295
actionBar_menu_button__active: {
9396
...menuButtonBase(),
94-
background: "#EBEBEB",
95-
"&::after": {
96-
content: "''",
97-
position: "absolute",
98-
display: "block",
99-
width: "100%",
100-
bottom: "0",
101-
height: toPx(2),
102-
background: (config: IDevSiteDesignSystem): string => config.brandColor
103-
}
97+
background: "#EBEBEB"
10498
}
10599
};
106100

packages/fast-development-site-react/src/components/site/component-view.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ const style: ComponentStyles<IComponentViewManagedClasses, IDevSiteDesignSystem>
2020
componentView: {
2121
overflow: "auto",
2222
flexGrow: "1",
23-
width: "100%"
23+
width: "100%",
24+
display: "grid",
25+
gridTemplateColumns: "1fr 1fr 1fr",
2426
}
2527
};
2628

packages/fast-development-site-react/src/components/site/component-wrapper.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,27 @@ export interface IComponentWrapperProps<T> {
2121
onClick: (activeIndex: number) => void;
2222
}
2323

24-
const baseStyle: ICSSRules<IDevSiteDesignSystem> = {
25-
display: "flex",
26-
flexWrap: "wrap",
27-
margin: toPx(24),
28-
borderTop: `${toPx(1)} solid rgb(226, 226, 226)`,
29-
borderLeft: `${toPx(1)} solid rgb(226, 226, 226)`
30-
};
31-
24+
const componentWrapperBorder: string = `${toPx(1)} solid rgb(226, 226, 226)`;
3225
const styles: ComponentStyles<IComponentWrapperManagedClasses, IDevSiteDesignSystem> = {
33-
componentWrapper: baseStyle,
26+
componentWrapper: {
27+
display: "block",
28+
padding: toPx(24),
29+
borderBottom: componentWrapperBorder,
30+
"&:last-child:not(:nth-child(3n + 3)), &:nth-child(3n + 1)": {
31+
borderRight: componentWrapperBorder,
32+
},
33+
"&:nth-child(3n + 3)": {
34+
borderLeft: componentWrapperBorder
35+
},
36+
},
3437
componentWrapper__active: {
35-
...baseStyle,
3638
position: "relative",
3739
"&::before": {
3840
content: "''",
3941
position: "absolute",
42+
top: toPx(0),
43+
bottom: toPx(0),
44+
left: toPx(0),
4045
background: (config: IDevSiteDesignSystem): string => {
4146
return config.brandColor;
4247
},
@@ -74,7 +79,7 @@ class ComponentWrapper extends React.Component<IComponentWrapperProps<IDevSiteDe
7479

7580
private getClassNames(): string {
7681
return this.props.active
77-
? this.props.managedClasses.componentWrapper__active
82+
? `${this.props.managedClasses.componentWrapper} ${this.props.managedClasses.componentWrapper__active}`
7883
: this.props.managedClasses.componentWrapper;
7984
}
8085

packages/fast-development-site-react/src/components/site/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export enum SiteSlot {
6262
}
6363

6464
export interface ISiteManagedClasses {
65+
"@global": string;
6566
site_canvasContent: string;
6667
site_headerTitle: string;
6768
site_paneToc: string;
@@ -73,6 +74,12 @@ export interface ISiteManagedClasses {
7374
}
7475

7576
const styles: ComponentStyles<ISiteManagedClasses, IDevSiteDesignSystem> = {
77+
"@global": {
78+
"body, html": {
79+
padding: toPx(0),
80+
margin: toPx(0)
81+
}
82+
},
7683
site_canvasContent: {
7784
height: `calc(100% - ${toPx(40)})`,
7885
display: "flex",

0 commit comments

Comments
 (0)