Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitad97c63

Browse files
authored
Merge pull request#404 from coderoad/feature/theme
Feature/theme
2 parentsc9a34ed +e94b95c commitad97c63

File tree

36 files changed

+405
-471
lines changed

36 files changed

+405
-471
lines changed

‎src/commands.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export const createCommands = ({ extensionPath, workspaceState }: CreateCommandP
2828
return{
2929
// initialize
3030
[COMMANDS.START]:async()=>{
31-
console.log('start')
3231
if(webview&&webview.state.loaded){
3332
webview.createOrShow()
3433
}else{

‎web-app/.storybook/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import{configure}from'@storybook/react'
2-
import'../src/styles/index.css'
2+
import'../src/styles/reset.css'
33

44
// setup acquireVsCodeApi mock
55
//@ts-ignore

‎web-app/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
},
2727
"dependencies": {
2828
"@alifd/next":"^1.20.20",
29-
"@alifd/theme-4":"^0.3.1",
3029
"@emotion/babel-preset-css-prop":"^10.0.27",
3130
"@emotion/core":"^10.0.28",
3231
"babel-jest":"^26.1.0",

‎web-app/src/App.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@ import { ConfigProvider } from '@alifd/next'
33
importenUSfrom'@alifd/next/lib/locale/en-us'
44
importErrorBoundaryfrom'./components/ErrorBoundary'
55
importWorkspacefrom'./components/Workspace'
6+
import{ThemeProvider}from'emotion-theming'
7+
importthemefrom'./styles/theme'
68
importRoutesfrom'./Routes'
79

810
constApp=()=>(
911
/*@ts-ignore invalid in enUS locale typings for @alifd/next@1.20.20 https://github.com/alibaba-fusion/next/commit/e3b934b */
1012
<ConfigProviderlocale={enUS}>
11-
<ErrorBoundary>
12-
<Workspace>
13-
<Routes/>
14-
</Workspace>
15-
</ErrorBoundary>
13+
<Workspace>
14+
<ErrorBoundary>
15+
<ThemeProvidertheme={theme}>
16+
<Routes/>
17+
</ThemeProvider>
18+
</ErrorBoundary>
19+
</Workspace>
1620
</ConfigProvider>
1721
)
1822

‎web-app/src/components/BetaBadge/index.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
import*asReactfrom'react'
2+
import{useTheme}from'emotion-theming'
23
import{Badge}from'@alifd/next'
4+
import{Theme}from'../../styles/theme'
35

46
conststyles={
5-
betaBadge:{
6-
backgroundColor:'#6a67ce',
7-
color:'#FFFFFF',
8-
},
7+
betaBadge:(theme:Theme)=>({
8+
backgroundColor:theme['$color-brand1-9'],
9+
color:theme['$color-white'],
10+
}),
911
}
1012

1113
typeProps={
1214
children:React.ReactElement|string
1315
}
1416

1517
constBetaBadge=({ children}:Props)=>{
18+
consttheme:Theme=useTheme()
1619
return(
17-
<Badgecontent="beta"style={styles.betaBadge}>
20+
<Badgecontent="beta"style={styles.betaBadge(theme)}>
1821
{children}&nbsp;&nbsp;
1922
</Badge>
2023
)

‎web-app/src/components/Card/index.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.

‎web-app/src/components/Divider.tsx

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎web-app/src/components/Error/index.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@ import * as T from 'typings'
44
import{css,jsx}from'@emotion/core'
55
importMarkdownfrom'../Markdown'
66
importButtonfrom'../../components/Button'
7+
import{Theme}from'../../styles/theme'
78

89
conststyles={
9-
container:{
10+
container:(theme:Theme)=>({
1011
display:'flex'as'flex',
1112
flexDirection:'column'as'column',
1213
justifyContent:'center'as'center',
1314
alignItems:'center'as'center',
14-
border:'0.5rem solid#FFBABA',
15+
border:`0.5rem solid${theme['$color-error-2']}`,
1516
padding:'1rem',
1617
width:'100%',
18+
maxWidth:'100%',
1719
height:'100%',
18-
},
19-
content:{
20+
}),
21+
content:(theme:Theme)=>({
2022
textAlign:'center'as'center',
21-
color:'rgb(40, 40, 40);',
22-
},
23+
color:theme['$color-text1-3'],
24+
}),
2325
options:{
2426
display:'flex'as'flex',
2527
flexDirection:'column'as'column',

‎web-app/src/components/Markdown/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
importMarkdownItfrom'markdown-it'
22
importPrismfrom'prismjs'
3+
import{css,jsx,InterpolationWithTheme}from'@emotion/core'
34
//@ts-ignore no types for package
45
importmarkdownEmojifrom'markdown-it-emoji'
56
import*asReactfrom'react'

‎web-app/src/components/NewUserExperience/NuxTutorial.tsx

Lines changed: 0 additions & 134 deletions
This file was deleted.

‎web-app/src/components/NewUserExperience/transition.css

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎web-app/src/components/Tag/index.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

‎web-app/src/components/TestMessage/index.tsx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
import*asReactfrom'react'
22
importIconfrom'../Icon'
33
import{css,jsx}from'@emotion/core'
4+
import{useTheme}from'emotion-theming'
5+
import{Theme}from'../../styles/theme'
46

57
conststyles={
6-
container:{
7-
backgroundColor:'#fff3e0',
8+
container:(theme:Theme)=>({
9+
backgroundColor:theme['$color-warning-1'],
810
padding:'0.5rem',
911
animationDuration:'0.3s',
1012
animationTimingFunction:'ease-in-out',
11-
borderTopLeftRadius:'4px',
12-
borderTopRightRadius:'4px',
13-
color:'rgb(51, 51, 51)',
14-
fontSize:'0.8rem',
15-
},
16-
icon:{
17-
color:'#ff9300',
18-
},
13+
borderTopLeftRadius:theme['$corner-1'],
14+
borderTopRightRadius:theme['$corner-1'],
15+
color:theme['$color-text1-3'],
16+
fontSize:theme['$font-size-caption'],
17+
}),
18+
icon:(theme:Theme)=>({
19+
color:theme['$color-warning-3'],
20+
}),
1921
content:{
20-
marginLeft:'0.5rem',
22+
padding:'00.5rem',
2123
},
2224
}
2325

@@ -38,9 +40,10 @@ const TestMessage = (props: Props) => {
3840
}
3941
},[props.message])
4042

43+
consttheme:Theme=useTheme()
4144
returnvisible&&props.message ?(
4245
<divcss={styles.container}>
43-
<Icontype="warning"style={styles.icon}size="xs"/>
46+
<Icontype="warning"style={styles.icon(theme)}size="xs"/>
4447
<spancss={styles.content}>{props.message}</span>
4548
</div>
4649
) :null

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp