Skip to content

Commit e94cdfc

Browse files
committed
move search styles to Folder CSS module
1 parent 49fed0d commit e94cdfc

File tree

4 files changed

+27
-24
lines changed

4 files changed

+27
-24
lines changed

src/components/Folder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default function Folder({ source }: FolderProps) {
9090
return <Layout error={error} title={source.prefix}>
9191
<Breadcrumb source={source}>
9292
<div className='top-actions'>
93-
<input autoFocus className='search' placeholder='Search...' ref={searchRef} />
93+
<input autoFocus className={cn(styles.search, customClass?.search)} placeholder='Search...' ref={searchRef} />
9494
</div>
9595
</Breadcrumb>
9696

src/hooks/useConfig.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface Config {
2121
markdownView?: string
2222
path?: string
2323
progressBar?: string
24+
search?: string
2425
sideBar?: string
2526
slideCloseButton?: string
2627
slidePanel?: string

src/styles/Folder.module.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,27 @@
6565
}
6666
}
6767
}
68+
69+
/* search */
70+
.search {
71+
background: #fff url("../assets/search.svg") no-repeat center right 8px;
72+
border: 1px solid transparent;
73+
border-radius: 8px;
74+
flex-shrink: 1;
75+
font-size: 12px;
76+
height: 24px;
77+
min-width: 0;
78+
outline: none;
79+
padding: 4px 20px 2px 8px;
80+
width: 100px;
81+
transition-duration: 0.3s;
82+
transition-property: border, width;
83+
84+
&:focus {
85+
border-color: #778;
86+
box-shadow: 0 0 1px #556;
87+
color: #444;
88+
padding-left: 8px;
89+
width: 180px;
90+
}
91+
}

src/styles/app.css

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,4 @@ a:hover {
6868

6969
.top-actions {
7070
left: auto;
71-
}
72-
/* search */
73-
input.search {
74-
background: #fff url("../assets/search.svg") no-repeat center right 8px;
75-
border: 1px solid transparent;
76-
border-radius: 8px;
77-
flex-shrink: 1;
78-
font-size: 12px;
79-
height: 24px;
80-
min-width: 0;
81-
outline: none;
82-
padding: 4px 20px 2px 8px;
83-
width: 100px;
84-
transition-duration: 0.3s;
85-
transition-property: border, width;
86-
}
87-
input.search:focus {
88-
border-color: #778;
89-
box-shadow: 0 0 1px #556;
90-
color: #444;
91-
padding-left: 8px;
92-
width: 180px;
93-
}
71+
}

0 commit comments

Comments
 (0)