├── .gitignore ├── README.md ├── dist ├── images │ └── share.jpg └── styles.css ├── index.html └── src └── scripts ├── main.js └── vendor └── vue.min.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Custom Scrollbars 2 | 3 | This tool is intended to help you customize the scrollbars of your next project. 4 | 5 | Demonstration here 👉 https://alessandrodias.github.io/custom-scrollbars 6 | 7 | ## About the project 8 | 9 | This project is using [Vue.js](https://vuejs.org/) for dynamically previewing changes and generating the final code. 10 | 11 | ### Credits 12 | 13 | Made with ❤️ by [Alessandro Dias](https://github.com/alessandrodias/) 14 | -------------------------------------------------------------------------------- /dist/images/share.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alessandrodias/custom-scrollbars/49e467c0b42433089a2da399a9edce0a4e1a1b89/dist/images/share.jpg -------------------------------------------------------------------------------- /dist/styles.css: -------------------------------------------------------------------------------- 1 | /****************************** 2 | * Defaults & Root 3 | ******************************/ 4 | [v-cloak] { 5 | display: none; 6 | } 7 | 8 | :root { 9 | --scrollbar-width: 10px; 10 | --scrollbar-height: 10px; 11 | --thumb-border-radius: 0; 12 | --track-bg: #766e63; 13 | --thumb-bg: #ffc31f; 14 | --corner-bg: #f00; 15 | --corner-visibility: "visible"; 16 | } 17 | 18 | * { 19 | margin: 0; 20 | padding: 0; 21 | box-sizing: border-box; 22 | } 23 | 24 | body { 25 | font-family: Helvetica, Arial, sans-serif; 26 | width: 100vw; 27 | height: 100vh; 28 | min-height: 600px; 29 | background-color: #eeeeee; 30 | } 31 | 32 | .github-corner { 33 | position: absolute; 34 | top: 0; 35 | right: 0; 36 | border: 0; 37 | } 38 | 39 | .app-holder { 40 | position: fixed; 41 | top: 50%; 42 | left: 50%; 43 | transform: translate(-50%, -50%); 44 | width: 75%; 45 | max-width: 960px; 46 | height: 75%; 47 | max-height: 500px; 48 | padding: 20px; 49 | background: #1e2233; 50 | border-radius: 4px; 51 | box-shadow: 0 0 10px 4px #a9a9a9; 52 | z-index: 1; 53 | font-size: 0; 54 | } 55 | 56 | .app-title { 57 | display: block; 58 | margin: 0 auto 20px; 59 | max-width: 350px; 60 | padding: 10px; 61 | font-size: 36px; 62 | text-align: center; 63 | color: #eabf4e; 64 | border-bottom: 1px solid #eabf4e; 65 | } 66 | 67 | /****************************** 68 | * Configurations 69 | ******************************/ 70 | .configurations { 71 | display: inline-block; 72 | vertical-align: top; 73 | width: 50%; 74 | text-align: left; 75 | } 76 | 77 | .panel { 78 | padding: 20px; 79 | border: 1px solid #eabf4e; 80 | } 81 | 82 | .field { 83 | display: flex; 84 | justify-content: space-between; 85 | align-items: center; 86 | margin: 0 0 10px; 87 | padding: 5px 10px; 88 | border: 1px solid #3d3d3d; 89 | } 90 | 91 | .field.-inactive { 92 | opacity: 0.4; 93 | pointer-events: none; 94 | font-style: italic; 95 | text-decoration: line-through; 96 | } 97 | 98 | .field:last-child { 99 | margin-bottom: 0; 100 | } 101 | 102 | .field-label { 103 | flex: 3; 104 | font-size: 16px; 105 | color: #f1f1f1; 106 | } 107 | 108 | .field-input { 109 | flex: 4; 110 | margin: 0 10px; 111 | } 112 | 113 | .field-value { 114 | flex: 1; 115 | font-size: 14px; 116 | color: #f1f1f1; 117 | text-align: center; 118 | } 119 | 120 | .-color-preview { 121 | height: 15px; 122 | border: 1px solid #fff; 123 | } 124 | 125 | /****************************** 126 | * Preview 127 | ******************************/ 128 | .preview { 129 | display: inline-block; 130 | vertical-align: top; 131 | width: calc(50% - 20px); 132 | max-height: 380px; 133 | margin-left: 20px; 134 | background: #2b3a42; 135 | overflow: auto; 136 | } 137 | 138 | .preview-content { 139 | display: block; 140 | padding: 20px; 141 | width: 600px; 142 | color: #f1f1f1; 143 | } 144 | 145 | .preview-title { 146 | display: block; 147 | font-size: 24px; 148 | color: inherit; 149 | margin: 0 0 30px; 150 | } 151 | 152 | .preview-text { 153 | display: block; 154 | font-size: 16px; 155 | color: inherit; 156 | margin: 0 0 30px; 157 | } 158 | 159 | .preview::-webkit-scrollbar { 160 | width: var(--scrollbar-width); 161 | height: var(--scrollbar-height); 162 | } 163 | 164 | .preview::-webkit-scrollbar-track { 165 | background-color: var(--track-bg); 166 | border-radius: var(--thumb-border-radius); 167 | } 168 | 169 | .preview::-webkit-scrollbar-thumb { 170 | background-color: var(--thumb-bg); 171 | border-radius: var(--thumb-border-radius); 172 | } 173 | 174 | .preview::-webkit-scrollbar-corner { 175 | visibility: var(--corner-visibility); 176 | background-color: var(--corner-bg); 177 | } 178 | 179 | /****************************** 180 | * Button to generate 181 | ******************************/ 182 | .btn-generate { 183 | display: block; 184 | margin: 20px auto 0; 185 | padding: 10px; 186 | background-color: #fbc31f; 187 | border: 1px solid #fbc31f; 188 | border-radius: 50px; 189 | width: 170px; 190 | font-size: 14px; 191 | font-weight: bold; 192 | color: #1e2233; 193 | outline: 0; 194 | cursor: pointer; 195 | text-transform: uppercase; 196 | transition: 300ms all ease; 197 | } 198 | 199 | /****************************** 200 | * Modal 201 | ******************************/ 202 | .modal { 203 | width: 100vw; 204 | height: 100vh; 205 | position: fixed; 206 | top: 50%; 207 | left: 50%; 208 | transform: translate(-50%, -50%); 209 | } 210 | 211 | .modal-overlay { 212 | position: fixed; 213 | top: 0; 214 | left: 0; 215 | width: 100%; 216 | height: 100%; 217 | background: #efeae1; 218 | z-index: 1; 219 | } 220 | 221 | .modal-body { 222 | position: absolute; 223 | top: 50%; 224 | left: 50%; 225 | transform: translate(-50%, -50%); 226 | width: 600px; 227 | margin: 0 auto; 228 | z-index: 2; 229 | } 230 | 231 | .modal-title { 232 | position: relative; 233 | display: block; 234 | margin: 4vw auto 30px; 235 | color: #1e2233; 236 | font-size: 40px; 237 | line-height: 1.5; 238 | text-align: center; 239 | z-index: 2; 240 | } 241 | 242 | .modal-title span { 243 | font-style: italic; 244 | color: #f07178; 245 | margin-right: 5px; 246 | } 247 | 248 | .modal-close { 249 | position: absolute; 250 | top: 5px; 251 | right: 5px; 252 | width: 20px; 253 | height: 20px; 254 | background: #f9f9f9; 255 | z-index: 10; 256 | font-size: 14px; 257 | line-height: 20px; 258 | color: #000; 259 | cursor: pointer; 260 | text-align: center; 261 | user-select: none; 262 | } 263 | 264 | .modal .code { 265 | position: relative; 266 | display: block; 267 | padding: 20px; 268 | background: #272822; 269 | font-size: 18px; 270 | line-height: 1.5; 271 | font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; 272 | color: #b2ccd6; 273 | box-shadow: 0 0 10px 1px #272822; 274 | user-select: all; 275 | } 276 | 277 | .modal-body .code .code-block { 278 | display: block; 279 | margin-bottom: 15px; 280 | } 281 | 282 | .modal-body .code .code-line { 283 | display: block; 284 | } 285 | 286 | .modal-body .code .class { 287 | color: #f07178; 288 | } 289 | 290 | .modal-body .code .property { 291 | color: #b2ccd6; 292 | padding-left: 5px; 293 | white-space: pre; 294 | } 295 | 296 | .modal-body .code .value { 297 | color: #f78c6c; 298 | } 299 | 300 | .fade-enter-active, .fade-leave-active { 301 | transition: opacity .5s; 302 | } 303 | 304 | .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ { 305 | opacity: 0; 306 | } 307 | 308 | @media screen and ( max-width: 900px ) { 309 | body { 310 | height: auto; 311 | } 312 | 313 | .app-holder { 314 | position: static; 315 | width: 100vw; 316 | height: auto; 317 | max-height: none; 318 | transform: none; 319 | padding: 20px 10px 10px; 320 | border-radius: 0; 321 | } 322 | 323 | .app-title { 324 | font-size: 28px; 325 | padding-top: 0; 326 | } 327 | 328 | .panel { 329 | padding: 10px; 330 | } 331 | 332 | .configurations, 333 | .preview { 334 | display: block; 335 | width: 100%; 336 | margin: 0 auto 20px; 337 | } 338 | 339 | .modal-body { 340 | width: 90%; 341 | top: 20px; 342 | transform: translateX(-50%); 343 | } 344 | 345 | .modal-title { 346 | font-size: 25px; 347 | } 348 | } 349 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |This is just a lorem ipsum text
79 | 80 |Lorem ipsum dolor sit amet consectetur adipisicing elit. Soluta nam, voluptatibus corporis repudiandae id ea quam eligendi minus, nobis cupiditate omnis nihil necessitatibus aliquid dolorum asperiores enim voluptatum dolorem architecto?
81 |Lorem ipsum dolor sit amet consectetur adipisicing elit. Soluta nam, voluptatibus corporis repudiandae id ea quam eligendi minus, nobis cupiditate omnis nihil necessitatibus aliquid dolorum asperiores enim voluptatum dolorem architecto?
82 |Lorem ipsum dolor sit amet consectetur adipisicing elit. Soluta nam, voluptatibus corporis repudiandae id ea quam eligendi minus, nobis cupiditate omnis nihil necessitatibus aliquid dolorum asperiores enim voluptatum dolorem architecto?
83 |Click bellow to select the code, and replace the .element class
90 | 91 |