Skip to content

Commit 7ea0157

Browse files
committed
Added custom scrollbar
1 parent 4f4533e commit 7ea0157

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

client/src/Pages/Edit.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export const Edit = () => {
139139
</div>
140140

141141
</div>
142-
142+
143143
</div>
144144
</div>
145145
<div className="container" style={{ marginBottom: '29px', marginTop: '-15px' }}>
@@ -148,16 +148,16 @@ export const Edit = () => {
148148
{
149149
preview ? <div className="container50" style={{ width: '70%', margin: 'auto' }}>
150150
<h1>{title}</h1>
151-
<div className="tags" style={{marginTop:'-8px',marginLeft:'-6px'}}>
151+
<div className="tags" style={{ marginTop: '-8px', marginLeft: '-6px' }}>
152152

153153
{
154-
tags && tags.split(',').map(item =>
154+
tags && tags.split(',').map(item =>
155155
<Chip name={item} dark={context.dark} />
156156
)
157157

158158
}
159159
</div>
160-
<div style={{ height: '99.8vh', overflow: 'scroll' }}>
160+
<div style={{ height: '99.8vh', overflow: 'auto' }}>
161161
<Markdown options={{
162162
forceBlock: true,
163163
overrides: {
@@ -173,9 +173,9 @@ export const Edit = () => {
173173
</Markdown>
174174
</div>
175175
</div> : <div className="container50" style={{ width: '70%', margin: 'auto' }}>
176-
<textarea value={title} onChange={e => setTitle(e.target.value)} style={{ backgroundColor: !context.dark ? 'rgb(248, 248, 248)' : '#202020', color: 'inherit', padding: '15px', border: 'none', borderRadius: '5px', outline: 'none', resize: 'none', width: '100%', height: '78px', fontSize: '14px',marginBottom:'-1.2px' }} placeholder='Title of the blog *'></textarea>
177-
<textarea value={tags} onChange={e => {setTags(e.target.value);}} className='boxins' style={{ backgroundColor: !context.dark ? 'rgb(248, 248, 248)' : '#202020', color: 'inherit', padding: '15px', border: 'none', borderRadius: '5px', outline: 'none', resize: 'none', width: '100%', height: '55px', fontSize: '14px',marginBottom:'-1.2px' }} placeholder='Enter tags (eg : javscript,typescript)'></textarea>
178-
<textarea value={summary} onChange={e => setSummary(e.target.value)} className='boxins' style={{ backgroundColor: !context.dark ? 'rgb(248, 248, 248)' : '#202020', color: 'inherit', padding: '15px', border: 'none', borderRadius: '5px', outline: 'none', resize: 'none', width: '100%', height: '135px', fontSize: '14px',marginBottom:'-1.2px' }} placeholder='Summary of the post *'></textarea>
176+
<textarea value={title} onChange={e => setTitle(e.target.value)} style={{ backgroundColor: !context.dark ? 'rgb(248, 248, 248)' : '#202020', color: 'inherit', padding: '15px', border: 'none', borderRadius: '5px', outline: 'none', resize: 'none', width: '100%', height: '78px', fontSize: '14px', marginBottom: '-1.2px' }} placeholder='Title of the blog *'></textarea>
177+
<textarea value={tags} onChange={e => { setTags(e.target.value); }} className='boxins' style={{ backgroundColor: !context.dark ? 'rgb(248, 248, 248)' : '#202020', color: 'inherit', padding: '15px', border: 'none', borderRadius: '5px', outline: 'none', resize: 'none', width: '100%', height: '55px', fontSize: '14px', marginBottom: '-1.2px' }} placeholder='Enter tags (eg : javscript,typescript)'></textarea>
178+
<textarea value={summary} onChange={e => setSummary(e.target.value)} className='boxins' style={{ backgroundColor: !context.dark ? 'rgb(248, 248, 248)' : '#202020', color: 'inherit', padding: '15px', border: 'none', borderRadius: '5px', outline: 'none', resize: 'none', width: '100%', height: '135px', fontSize: '14px', marginBottom: '-1.2px' }} placeholder='Summary of the post *'></textarea>
179179
<textarea style={{ width: '100%', backgroundColor: !context.dark ? 'rgb(248, 248, 248)' : '#202020', color: 'inherit', padding: '15px', border: 'none', borderRadius: '5px', outline: 'none', minHeight: '84vh', resize: 'none' }} value={value} onChange={e => setValue(e.target.value)} spellCheck="false"></textarea>
180180
</div>
181181
}

client/src/index.css

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,25 @@ body {
4646
border-radius: 5px;
4747
}
4848

49+
*::-webkit-scrollbar-track {
50+
-webkit-box-shadow: inset 0 0 6px rgb(18, 15, 19);
51+
border-radius: 10px;
52+
scroll-behavior: smooth;
53+
}
54+
4955
*::-webkit-scrollbar {
50-
display: none;
56+
height: 9px;
57+
width: 6.75px;
58+
background-color: transparent;
5159
}
5260

53-
/* Hide scrollbar for IE, Edge and Firefox */
54-
* {
55-
-ms-overflow-style: none;
56-
/* IE and Edge */
57-
scrollbar-width: none;
58-
/* Firefox */
61+
*::-webkit-scrollbar-thumb {
62+
border-radius: 10px;
63+
-webkit-box-shadow: inset 0 0 6px rgba(140, 140, 140, 0.3);
64+
background-color: rgb(86, 86, 86);
5965
}
6066

67+
6168
@media screen and (max-width:1150px) {
6269
.container {
6370
width: 70%;

0 commit comments

Comments
 (0)