Skip to content

Commit

Permalink
feat: Add new acrylic theme
Browse files Browse the repository at this point in the history
  • Loading branch information
myxvisual committed Nov 23, 2019
1 parent fa58536 commit 096b823
Show file tree
Hide file tree
Showing 29 changed files with 202 additions and 297 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/src/components/DocsTreeView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ export default class DocsTreeView extends React.Component<DocsTreeViewProps, Doc
return (
<div
style={theme.prefixStyle({
...theme.acrylicTexture40.style,
width: 320,
padding: "10px 0",
background: theme.useFluentDesign ? theme.acrylicTexture40.background : theme.chromeLow,
...style
})}
{...attributes}
Expand Down
6 changes: 1 addition & 5 deletions docs/src/components/Wrapper/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,10 @@ function getStyles(footer: Footer): {

return {
root: prefixStyle({
...theme.acrylicTexture40.style,
zIndex: theme.zIndex.header,
fontSize: 14,
color: theme.baseHigh,
background: theme.useFluentDesign ? (
theme.isDarkTheme ? "hsla(0, 0%, 0%, 0.95)" : "hsla(0, 0%, 100%, 0.95)"
) : (
theme.isDarkTheme ? "hsla(0, 0%, 5%, 0.85)" : "hsla(0, 0%, 95%, 0.85)"
),
minHeight: footerHeight,
...style
}),
Expand Down
6 changes: 1 addition & 5 deletions docs/src/components/Wrapper/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,7 @@ function getStyles(header: Header): {
root: prefixStyle({
fontSize: 14,
color: theme.baseHigh,
background: theme.useFluentDesign ? (
theme.isDarkTheme ? "hsla(0, 0%, 0%, 0.95)" : "hsla(0, 0%, 100%, 0.95)"
) : (
theme.isDarkTheme ? "hsla(0, 0%, 5%, 0.85)" : "hsla(0, 0%, 95%, 0.85)"
),
...theme.acrylicTexture40.style,
boxShadow: theme.isDarkTheme ? void 0 : `0 2px 8px ${theme.listLow}`,
width: "100%",
height: headerHeight,
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/WrapperWithCategories/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ function getStyles(wrapperWithCategories: WrapperWithCategories) {
margin: "0 auto"
}),
side: prefixStyle({
background: theme.useFluentDesign ? theme.acrylicTexture80.background : theme.altHigh,
background: theme.altMediumLow,
// ...theme.acrylicTexture60.style,
width: notPhoneTablet ? "calc(100% - 320px)" : "100%",
...(theme.useFluentDesign ? void 0 : getStripedBackground(4, tinycolor(theme.baseHigh).setAlpha(0.025).toRgbString(), "transparent")),
minHeight: "100%"
Expand Down
9 changes: 4 additions & 5 deletions docs/src/routes/Styles/Acrylic/SimpleExample.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as React from "react";
import * as PropTypes from "prop-types";

import AutoSuggestBox from "react-uwp/AutoSuggestBox";

export default class SimpleExample extends React.Component {
static contextTypes = { theme: PropTypes.object };
context: { theme: ReactUWP.ThemeType };
Expand All @@ -21,6 +19,7 @@ export default class SimpleExample extends React.Component {
outline: "none",
border: `1px solid ${theme.listAccentLow}`
};

return (
<div
style={theme.prefixStyle({
Expand All @@ -34,13 +33,13 @@ export default class SimpleExample extends React.Component {
background: theme.desktopBackground
})}
>
<span style={{ ...itemStyle, background: theme.acrylicTexture40.background }}>
<span style={{ ...itemStyle, ...theme.acrylicTexture40.style }}>
theme.acrylicTexture40.background
</span>
<span style={{ ...itemStyle, background: theme.acrylicTexture60.background }}>
<span style={{ ...itemStyle, ...theme.acrylicTexture60.style }}>
theme.acrylicTexture60.background
</span>
<span style={{ ...itemStyle, background: theme.acrylicTexture80.background }}>
<span style={{ ...itemStyle, ...theme.acrylicTexture80.style }}>
theme.acrylicTexture80.background
</span>
</div>
Expand Down
5 changes: 1 addition & 4 deletions docs/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import * as React from "react";
import { Router, RouteComponent, browserHistory } from "react-router";
import { Router, browserHistory } from "react-router";

import Theme from "react-uwp/Theme";
import getTheme from "react-uwp/styles/getTheme";
import Wrapper from "../components/Wrapper";
import WrapperWithCategories from "../components/WrapperWithCategories";
import setStaticAcrylicTexture from "utils/setStaticAcrylicTexture";

export interface RouterCallback {
(error: any, component?: any): void;
Expand All @@ -22,8 +21,6 @@ export class ThemeWrapper extends React.Component {
return (
<Theme
theme={theme}
needGenerateAcrylic={false}
// themeWillUpdate={setStaticAcrylicTexture}
>
{children}
</Theme>
Expand Down
33 changes: 0 additions & 33 deletions docs/src/utils/setStaticAcrylicTexture.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/CalendarView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,12 @@ function getStyles(calendarView: CalendarView): {

return {
root: prefixStyle({
...theme.acrylicTexture80.style,
display: "inline-block",
verticalAlign: "middle",
fontSize: 14,
color: theme.baseHigh,
width: 296,
background: background || (theme.useFluentDesign ? theme.acrylicTexture80.background : theme.altHigh),
border: `2px solid ${theme.baseLow}`,
...style
}),
Expand Down
3 changes: 1 addition & 2 deletions src/ColorPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ function getStyles(colorPicker: ColorPicker): {
context: { theme },
props: {
style,
size,
defaultColor
size
},
state: { h, s, v }
} = colorPicker;
Expand Down
2 changes: 1 addition & 1 deletion src/ContentDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ function getStyles(contentDialog: ContentDialog): {
...style
}),
container: prefixStyle({
background: background || (theme.useFluentDesign ? theme.acrylicTexture80.background : theme.altHigh),
...theme.acrylicTexture80.style,
border: `1px solid ${theme.baseLow}`,
flex: "0 0 auto",
width: "80%",
Expand Down
3 changes: 1 addition & 2 deletions src/DatePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ function getStyles(datePicker: DatePicker): {
}
} = datePicker;
const { prefixStyle } = theme;
const currBackground = background || (theme.useFluentDesign ? theme.acrylicTexture80.background : theme.chromeLow);

return {
root: prefixStyle({
Expand All @@ -318,12 +317,12 @@ function getStyles(datePicker: DatePicker): {
...style
}),
pickerModal: prefixStyle({
...theme.acrylicTexture80.style,
overflow: "hidden",
flex: "0 0 auto",
display: "flex",
flexDirection: "column",
position: "absolute",
background: currBackground,
top: 0,
left: 0,
width: "100%",
Expand Down
3 changes: 1 addition & 2 deletions src/DropDownMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ function getStyles(dropDownMenu: DropDownMenu) {
} = dropDownMenu;
const { prefixStyle } = theme;

const currBackground = background || (theme.useFluentDesign ? theme.acrylicTexture80.background : theme.chromeLow);
const haveWrapperStyle = wrapperAttributes && wrapperAttributes.style;
const zIndex = (style && style.zIndex) ? style.zIndex : (showList ? theme.zIndex.dropDownMenu : 1);

Expand All @@ -266,11 +265,11 @@ function getStyles(dropDownMenu: DropDownMenu) {
zIndex
}) as React.CSSProperties,
wrapper: prefixStyle({
...theme.acrylicTexture80.style,
position: "absolute",
top: 0,
left: 0,
color: theme.baseMediumHigh,
background: currBackground,
width: itemWidth,
height: showList ? values.length * itemHeight + 16 : itemHeight + padding,
overflowX: "hidden",
Expand Down
8 changes: 3 additions & 5 deletions src/ListView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,15 @@ export class ListView extends React.Component<ListViewProps, ListViewState> {
const { isDarkTheme } = theme;
const isFocus = focus || focusIndex === index;
const defaultBG = isFocus ? theme.listAccentLow : "none";
const focusBG = isFocus ? theme.listAccentHigh : (theme.useFluentDesign ? theme.acrylicTexture40.background : theme.listLow);
const clickBG = isFocus ? theme.accent : theme.chromeHigh;

const itemStyles = theme.prepareStyle({
className: "list-view-item",
style: theme.prefixStyle({
background: defaultBG,
color: disabled ? theme.baseLow : theme.baseHigh,
"&:hover": {
background: focusBG
...theme.acrylicTexture40.style,
background: isFocus ? theme.listAccentHigh : theme.acrylicTexture40.style.background
},
"&:active": {
transform: "scale(0.99)"
Expand Down Expand Up @@ -155,18 +154,17 @@ function getStyles(listView: ListView): {
} {
const { context, props: { listItemStyle, background, style } } = listView;
const { theme } = context;
const { prefixStyle } = theme;

return {
root: theme.prefixStyle({
...(background ? { ...theme.acrylicTexture60.style, background } : theme.acrylicTexture60.style),
width: 320,
display: "inline-block",
verticalAlign: "middle",
fontSize: 14,
padding: "8px 0",
color: theme.baseMediumHigh,
border: `1px solid ${theme.useFluentDesign ? theme.listLow : theme.altHigh}`,
background: background || (theme.useFluentDesign ? theme.acrylicTexture60.background : theme.chromeLow),
transition: "all .25s",
...style
}),
Expand Down
2 changes: 1 addition & 1 deletion src/Menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ function getStyles(menuItem: MenuItem): {
textOverflow: "ellipsis"
},
child: prefixStyle({
...theme.acrylicTexture60.style,
transform: `translate3d(${expanded ? 0 : `-${itemHeight}px`}, 0, 0)`,
opacity: expanded ? 1 : 0,
pointerEvents: expanded ? "all" : "none",
Expand All @@ -234,7 +235,6 @@ function getStyles(menuItem: MenuItem): {
top: -1,
left: "100%",
width: "100%",
background: theme.useFluentDesign ? theme.acrylicTexture60.background : theme.chromeLow,
border: `1px solid ${theme.listLow}`
})
};
Expand Down
2 changes: 1 addition & 1 deletion src/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ function getStyles(menu: Menu): {

return {
root: prefixStyle({
...theme.acrylicTexture60.style,
width: 240,
color: theme.baseHigh,
background: theme.useFluentDesign ? theme.acrylicTexture60.background : theme.chromeLow,
border: `1px solid ${theme.listLow}`,
...style
})
Expand Down
8 changes: 3 additions & 5 deletions src/NavigationView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ function getStyles(NavigationView: NavigationView): {
let minHeight = isMinimal ? 0 : 48;
if (navigationTopNodes) minHeight += 48 * navigationTopNodes.length;
if (navigationBottomNodes) minHeight += 48 * navigationBottomNodes.length;
const currBackground = background || (theme.useFluentDesign ? theme.acrylicTexture40.background : theme.altHigh);
const transition = "width .25s ease-in-out";

return {
Expand All @@ -356,12 +355,12 @@ function getStyles(NavigationView: NavigationView): {
...style
}),
topIcon: prefixStyle({
...theme.acrylicTexture40.style,
display: "flex",
flexDirection: "row",
alignItems: "center",
justifyContent: "flex-start",
width: isMinimal ? "100%" : expandedWidth,
background: currBackground,
flex: "0 0 auto",
zIndex: 1
}),
Expand All @@ -375,6 +374,7 @@ function getStyles(NavigationView: NavigationView): {
textOverflow: "ellipsis"
}),
paneParent: prefixStyle({
...(isMinimal ? theme.acrylicTexture40.style : {}),
display: "inline-block",
verticalAlign: "top",
width: isMinimal ? "100%" : (isOverLay ? currInitWidth : (expanded ? expandedWidth : currInitWidth)),
Expand All @@ -383,22 +383,20 @@ function getStyles(NavigationView: NavigationView): {
zIndex: isOverLay || isMinimal ? 1 : void 0,
position: isOverLay ? "absolute" : void 0,
top: isOverLay ? 0 : void 0,
background: isMinimal ? currBackground : void 0,
transition
}),
pane: prefixStyle({
...theme.acrylicTexture40.style,
display: "flex",
flexDirection: "column",
alignItems: "flex-start",
justifyContent: "space-between",
background: currBackground,
overflow: isMinimal ? void 0 : "hidden",
width: expanded ? expandedWidth : (isMinimal ? 0 : currInitWidth),
...(isMinimal ? {
position: "absolute",
top: 0,
left: 0,
background: currBackground
} as React.CSSProperties : void 0),
height: "100%",
transition,
Expand Down
4 changes: 2 additions & 2 deletions src/SplitView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function getStyles(splitView: SplitView): {
return {
root: prefixStyle({
color: theme.baseHigh,
background: theme.useFluentDesign ? theme.acrylicTexture60.background : theme.chromeLow,
...theme.acrylicTexture60.style,
display: "inline-block",
position: "relative",
margin: 0,
Expand All @@ -174,7 +174,7 @@ function getStyles(splitView: SplitView): {
overflow: "hidden"
}),
pane: prefixStyle({
background: theme.useFluentDesign ? theme.acrylicTexture40.background : theme.altHigh,
...theme.acrylicTexture40.style,
transition,
boxShadow: theme.useFluentDesign ? `rgba(0, 0, 0, 0.34) 0px 4px 24px` : void 0,
...(isCompact ? {
Expand Down
17 changes: 0 additions & 17 deletions src/Theme/StyleManagerSheet.tsx

This file was deleted.

Loading

0 comments on commit 096b823

Please sign in to comment.