$hover-lighten-amount: 15%; .browser { display: none; &.is-active { display: flex; } flex: 0 1 auto; flex-wrap: wrap; max-height: 100%; //max-height: 70vh; overflow-y: scroll; //resize: vertical; min-height: 200px; margin-top: 0.5rem; border: 1px solid #666; border-radius: 6px; background: #eee; padding: 0.5rem; color: #333; .item { width: 7.5rem; padding: 1rem 0.5rem; text-align: center; overflow-wrap: break-word; } .folder, .file { display: flex; flex-direction: column; cursor: pointer; // Set font-size here to work with JS/SVG FA Icons font-size: 4rem; .thumbnail { height: 4rem; display: flex; justify-content: center; align-items: center; } .filename { // Set the text size here to get not be huge! font-size: 1rem; margin-top: 0.5rem; display: block; line-height: 1.15; font-weight: normal; color: #333; } &:hover .filename { color: lighten(#333, $hover-lighten-amount); } &:hover img { filter: opacity(0.75); } // Fix for FA icons via JS/SVG .svg-inline--fa { width: unset; } } .file, .folder { // Fix extra spacing around image .thumbnail { line-height: 0; img { max-height: 4rem; max-width: 7rem; } } .thumbnail { margin: auto 0; width: 100%; text-align: center; .file-icon { height: 100%; width: 100%; } } } } // File type colours @mixin file-color($icon, $color) { .file, .folder { #{$icon} { color: $color; } &:hover #{$icon} { color: lighten($color, $hover-lighten-amount); } } } // -- Apply default file/folder colour @include file-color('[class*="fa-"]', #555); // -- Apply extension-specific colors &.colourise { @include file-color(".fa-file-pdf", #eb1d0f); @include file-color(".fa-file-word", #2b579a); @include file-color(".fa-file-powerpoint", #b7472a); @include file-color(".fa-file-excel", #217346); } // List view &.list-view .browser { display: none; &.is-active { display: flex; } flex-wrap: nowrap; flex-direction: column; margin-top: 0.5rem; border: 1px solid #666; border-radius: 6px; background: #eee; padding: 0rem; color: #333; .item { width: 100%; padding: 0.5rem; text-align: left; overflow-wrap: break-word; &:nth-child(2n) { background: #e9e9e9; } } .folder, .file { display: flex; flex-direction: row; align-items: center; align-content: center; cursor: pointer; .file-icon { display: block; font-size: 2rem; width: 2rem; text-align: center; } .filename { margin-top: 0; margin-left: 0.5rem; display: block; line-height: 1.15; font-weight: normal; color: #333; } &:hover .filename { color: lighten(#333, $hover-lighten-amount); } } .file, .folder { .thumbnail { margin: auto 0; width: 2rem; max-height: 2rem; text-align: center; .file-icon { height: 100%; width: 100%; } } img { max-height: 2rem; max-width: 2rem; } } } .file-icon { margin-right: 0; }