Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 9a4d8df

Browse files
authored
style: adjust gtd-badege text/bg color (#1286)
1 parent 8a6593a commit 9a4d8df

File tree

5 files changed

+35
-22
lines changed

5 files changed

+35
-22
lines changed

src/widgets/GTDBadge/State.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ const State: FC<TProps> = ({ state, type }) => {
1313
case GTD_STATE.DONE: {
1414
return (
1515
<Wrapper type={type}>
16-
<DoneIcon />
16+
<DoneIcon type={type} />
1717
</Wrapper>
1818
)
1919
}
2020

2121
case GTD_STATE.WIP: {
2222
return (
2323
<Wrapper type={type}>
24-
<WipIcon />
24+
<WipIcon type={type} />
2525
</Wrapper>
2626
)
2727
}
2828

2929
case GTD_STATE.TODO: {
3030
return (
3131
<Wrapper type={type}>
32-
<TODOIcon />
32+
<TODOIcon type={type} />
3333
</Wrapper>
3434
)
3535
}
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1+
import { theme } from '@/utils'
12
import styled from 'styled-components'
23

3-
import { theme } from '@/utils/css'
4+
// import { theme } from '@/utils/css'
45

56
export const Wrapper = styled.div<{ noBg: boolean }>`
6-
color: #3871e0;
7+
color: ${theme('gtdBadge.feat')};
78
background-color: ${({ noBg }) =>
8-
noBg ? 'transparent' : theme('textBadge')};
9+
noBg ? 'transparent' : theme('gtdBadge.featBg')};
910
padding: ${({ noBg }) => (noBg ? 0 : '2px 6px')};
1011
font-weight: 500;
1112
border-radius: ${({ noBg }) => (noBg ? 0 : '6px')};
1213
border-radius: 6px;
1314
font-size: 12px;
1415
`
1516
export const BugWrapper = styled(Wrapper)<{ noBg: boolean }>`
16-
color: #eb6a6a;
17+
color: ${theme('gtdBadge.bug')};
1718
background-color: ${({ noBg }) =>
18-
noBg ? 'transparent' : theme('textBadge')};
19+
noBg ? 'transparent' : theme('gtdBadge.bugBg')};
1920
`

src/widgets/GTDBadge/styles/state.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,35 @@ import styled from 'styled-components'
33
import type { TGtdType } from '@/spec'
44
import { GTD_TYPE } from '@/constant'
55

6-
import css from '@/utils/css'
6+
import css, { theme } from '@/utils/css'
77

88
import GtdWipSVG from '@/icons/GtdWip'
99
import GtdDoneSVG from '@/icons/GtdDone'
1010
import GtdTodoSVG from '@/icons/GtdTodo'
1111

12-
export const Wrapper = styled.div<{ type: TGtdType }>`
12+
type TType = { type: TGtdType }
13+
14+
export const Wrapper = styled.div<TType>`
1315
${css.size(18)};
1416
${css.flex('align-both')};
15-
background: ${({ type }) => (type === GTD_TYPE.BUG ? '#eb6a6a' : '#3871e0')};
17+
background: ${({ type }) =>
18+
type === GTD_TYPE.BUG ? theme('gtdBadge.bugBg') : theme('gtdBadge.featBg')};
1619
border-top-left-radius: 6px;
1720
border-bottom-left-radius: 6px;
21+
margin-right: -4px;
1822
`
19-
export const WipIcon = styled(GtdWipSVG)`
23+
export const WipIcon = styled(GtdWipSVG)<TType>`
2024
${css.size(9)};
21-
fill: white;
22-
/* fill: #3871e0; */
25+
fill: ${({ type }) =>
26+
type === GTD_TYPE.BUG ? theme('gtdBadge.bug') : theme('gtdBadge.feat')};
2327
`
24-
export const DoneIcon = styled(GtdDoneSVG)`
28+
export const DoneIcon = styled(GtdDoneSVG)<TType>`
2529
${css.size(10)};
26-
fill: white;
27-
/* fill: #3871e0; */
30+
fill: ${({ type }) =>
31+
type === GTD_TYPE.BUG ? theme('gtdBadge.bug') : theme('gtdBadge.feat')};
2832
`
29-
export const TODOIcon = styled(GtdTodoSVG)`
33+
export const TODOIcon = styled(GtdTodoSVG)<TType>`
3034
${css.size(10)};
31-
fill: white;
32-
/* fill: #3871e0; */
35+
fill: ${({ type }) =>
36+
type === GTD_TYPE.BUG ? theme('gtdBadge.bug') : theme('gtdBadge.feat')};
3337
`

src/widgets/PostItem/styles/desktop_view/body.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const Extra = styled.li`
1313
position: relative;
1414
${css.flex('align-end')};
1515
color: ${theme('thread.extraInfo')};
16-
margin-top: 3px;
16+
margin-top: 5px;
1717
font-size: 12px;
1818
`
1919
export const LeftPart = styled.div`
@@ -84,6 +84,6 @@ export const ViewsIcon = styled(ViewedSVG)`
8484

8585
export const GTDBadgeWrapper = styled.div`
8686
position: absolute;
87-
top: 44px;
87+
top: 41px;
8888
right: -5px;
8989
`

utils/themes/skins/github.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ const github = {
4444
bodyBg: contentBg,
4545
selectionBg: '#FFFEDE',
4646
textBadge: '#f5f5f5',
47+
48+
gtdBadge: {
49+
feat: '#3871e0',
50+
featBg: '#e9f0ff',
51+
bug: '#eb6a6a',
52+
bugBg: '#ffefef',
53+
},
54+
4755
baseColor: {
4856
red: '#ca5f4d',
4957
redBg: '#FDF1F0',

0 commit comments

Comments
 (0)