Skip to content

Commit 2b7a17b

Browse files
committed
refactor: Update new Theme logic
1 parent fca7410 commit 2b7a17b

File tree

13 files changed

+383
-489
lines changed

13 files changed

+383
-489
lines changed

docs/scripts/parser.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export class Parser {
160160
break;
161161
}
162162
default: {
163-
console.log(`Missing parse kind: ${node.kind}`);
163+
// console.log(`Missing parse kind: ${node.kind}`);
164164
break;
165165
}
166166
}
@@ -195,9 +195,8 @@ export class Parser {
195195
try {
196196
documentation = ts.displayPartsToString(symbol.getDocumentationComment(void 0)) || void 0;
197197
} catch (error) {
198-
console.error(error);
198+
// console.error(error);
199199
}
200-
201200
// console.log(name, symbol.flags);
202201

203202
let newSymbol: any = symbol;

docs/src/utils/setStaticAcrylicTexture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function setStaticAcrylicTexture(theme: ReactUWP.ThemeType) {
2727
}
2828
} else {
2929
if (theme.useFluentDesign && !theme.haveAcrylicTextures) {
30-
theme.generateAcrylicTextures(theme, newTheme => theme.updateTheme(newTheme));
30+
theme.generateAcrylicTextures(newTheme => theme.updateTheme(newTheme));
3131
}
3232
}
3333
}

src/MarkdownRender/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class MarkdownRender extends React.Component<MarkdownRenderProps> {
8181
}
8282

8383
const CSSText = getCSSText(theme, `react-uwp-markdown`) + "\n" + markdownStyleString;
84-
theme.styleManager.addCSSTextWithUpdate(CSSText);
84+
theme.styleManager.addCSSText(CSSText);
8585
}
8686

8787
render() {

src/ProgressBar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ ${vendorPrefixes.map(str => `@${str}keyframes ProgressBar {
9494
styles: inlineStyles
9595
});
9696
const onlyClassName = this.getOnlyClassName();
97-
theme.styleManager.addCSSTextWithUpdate(this.getCSSText(onlyClassName));
97+
theme.styleManager.addCSSText(this.getCSSText(onlyClassName));
9898

9999
return (
100100
<div

src/ProgressRing/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ ${vendorPrefixes.map(str => `@${str}keyframes CircleLoopFade {
104104
} = this.props;
105105
const { theme } = this.context;
106106
const onlyClassName = this.getOnlyClassName();
107-
theme.styleManager.addCSSTextWithUpdate(this.getCSSText(onlyClassName));
107+
theme.styleManager.addCSSText(this.getCSSText(onlyClassName));
108108

109109
const inlineStyles = getStyles(this);
110110
const styles = theme.prepareStyles({

src/Theme/StyleManagerSheet.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import * as React from "react";
2+
3+
export interface StyleManagerSheetState {
4+
CSSText?: string;
5+
}
6+
7+
export class StyleManagerSheet extends React.Component<StyleManagerSheetState, StyleManagerSheetState> {
8+
state: StyleManagerSheetState = {
9+
CSSText: this.props.CSSText
10+
};
11+
12+
render() {
13+
return (
14+
<style>{this.state.CSSText}</style>
15+
);
16+
}
17+
}

src/Theme/getBaseCSSText.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

2-
function getBaseCSS(theme: ReactUWP.ThemeType, themeClassName = "uwp-base", scrollBarStyleSelector = "*") {
2+
function getBaseCSS(theme: ReactUWP.ThemeType, scrollBarStyleSelector = "*") {
33
return `* {
44
margin: 0;
55
padding: 0;
66
box-sizing: border-box;
77
}
88
9-
.${themeClassName} * {
9+
* {
1010
font-family: ${theme.fonts.sansSerifFonts.split(", ").map((font: string) => `"${font}"`).join(", ")};
1111
}
1212
@@ -34,18 +34,18 @@ ${scrollBarStyleSelector}::-webkit-scrollbar {
3434
-webkit-appearance: none
3535
}
3636
37-
.${themeClassName} *:after, .${themeClassName} *:before {
37+
*:after, *:before {
3838
box-sizing: border-box;
3939
}
4040
41-
.${themeClassName} {
41+
{
4242
-webkit-text-size-adjust: none;
4343
-webkit-font-smoothing: antialiased;
4444
text-rendering: optimizeLegibility;
4545
-moz-osx-font-smoothing: grayscale;
4646
}
4747
48-
.${themeClassName} input, .${themeClassName} textarea {
48+
input, textarea {
4949
box-shadow: none;
5050
border-radius: none;
5151
}

0 commit comments

Comments
 (0)