Skip to content

Commit

Permalink
Merge pull request #231 from pryley/fix/215
Browse files Browse the repository at this point in the history
fix file-tree alignment
  • Loading branch information
AnubisNekhet authored Oct 26, 2023
2 parents d6a6b53 + e3a4f27 commit fff6a02
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 54 deletions.
20 changes: 4 additions & 16 deletions src/modules/Core/style-settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2100,8 +2100,8 @@ settings:
level: 2
collapsed: true
-
id: anp-collapse-folders
title: Enable folder icons for collapse indicators
id: anp-custom-vault-toggle
title: Enable custom vault title
type: class-toggle
-
id: anp-file-icons
Expand All @@ -2112,8 +2112,8 @@ settings:
title: Enable floating vault title
type: class-toggle
-
id: anp-custom-vault-toggle
title: Enable custom vault title
id: anp-collapse-folders
title: Enable folder icons for collapse indicators
type: class-toggle
-
id: anp-file-label-align
Expand All @@ -2127,18 +2127,6 @@ settings:
-
label: Left
value: 0
-
id: anp-file-icon-align
title: File Icon Alignment
type: variable-select
default: '0'
options:
-
label: Default
value: 0
-
label: Aligned
value: '-17px'
# Workspace :: PDF Viewer
Expand Down
22 changes: 13 additions & 9 deletions src/modules/Features/collapse-folders.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
.anp-collapse-folders {
.nav-folder .nav-folder-collapse-indicator,
[data-type="bookmarks"] .tree-item .collapse-icon {
.anp-collapse-folders .workspace-leaf-content:not([data-type="search"]) {
.nav-folder.mod-root .nav-folder > .nav-folder-children :is(.nav-file,.nav-folder) {
margin-left: var(--size-2-1);
}
.tree-item .nav-folder-title {
align-items: center;
}
.tree-item .collapse-icon {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M6 14l1.45-2.9A2 2 0 0 1 9.24 10H22a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H20a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E%0A");
-webkit-mask-repeat: no-repeat;
background-color: currentColor;
display: flex;
flex-basis: 100%;
height: 16px;
width: 17px;
margin-right: 4px;
}
.nav-folder.is-collapsed .nav-folder-collapse-indicator,
[data-type="bookmarks"] .tree-item.is-collapsed .collapse-icon {
.tree-item.is-collapsed .collapse-icon {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24' fill='none' stroke='currentColor' stroke-linejoin='round' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2z'/%3E%3Cpath d='M2 10h20' /%3E%3C/svg%3E%0A");
}
.nav-folder-collapse-indicator svg.svg-icon,
[data-type="bookmarks"] .collapse-icon svg.svg-icon {
color: transparent !important;
.tree-item .collapse-icon svg {
display: none;
}
}
55 changes: 26 additions & 29 deletions src/modules/Features/file-icons.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
.anp-file-icons .nav-file .nav-file-title[data-path] {
align-items: center;
}
.anp-file-icons .nav-file .nav-file-title[data-path]::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E%0A");
-webkit-mask-repeat: no-repeat;
background-color: currentColor;
content: "";
display: inline-flex;
flex-shrink: 0;
height: 16px;
width: 16px;
margin-right: 5px;
margin-left: var(--anp-file-icon-align, 0px);
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E%0A");
-webkit-mask-repeat: no-repeat;
background-color: var(--icon-color);
content: '';
display: flex;
flex-shrink: 0;
height: var(--size-4-4);
margin-left: calc(-1 * var(--size-4-5));
opacity: var(--icon-opacity);
position: absolute;
width: var(--size-4-4);
}
.anp-file-icons .nav-file .nav-file-title[data-path$=".md"]::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpath d='M14 2v6h6m-4 5H8m8 4H8m2-8H8'/%3E%3C/svg%3E%0A");
-webkit-mask-repeat: no-repeat;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpath d='M14 2v6h6m-4 5H8m8 4H8m2-8H8'/%3E%3C/svg%3E%0A");
-webkit-mask-repeat: no-repeat;
}
.anp-file-icons .nav-file .nav-file-title[data-path$=".canvas"]::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h7v9H3zm11 0h7v5h-7zm0 9h7v9h-7zM3 16h7v5H3z'/%3E%3C/svg%3E");
-webkit-mask-repeat: no-repeat;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h7v9H3zm11 0h7v5h-7zm0 9h7v9h-7zM3 16h7v5H3z'/%3E%3C/svg%3E");
-webkit-mask-repeat: no-repeat;
}
.anp-file-icons .nav-file .nav-file-title[data-path$=".svg"]::before,
.anp-file-icons .nav-file .nav-file-title[data-path$=".bmp"]::before,
Expand All @@ -25,33 +29,26 @@
.anp-file-icons .nav-file .nav-file-title[data-path$=".webp"]::before,
.anp-file-icons .nav-file .nav-file-title[data-path$=".jpeg"]::before,
.anp-file-icons .nav-file .nav-file-title[data-path$=".png"]::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Ccircle cx='10' cy='13' r='2'/%3E%3Cpath d='m20 17-1.09-1.09a2 2 0 0 0-2.82 0L10 22'/%3E%3C/svg%3E%0A");
-webkit-mask-repeat: no-repeat;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Ccircle cx='10' cy='13' r='2'/%3E%3Cpath d='m20 17-1.09-1.09a2 2 0 0 0-2.82 0L10 22'/%3E%3C/svg%3E%0A");
-webkit-mask-repeat: no-repeat;
}
.anp-file-icons .nav-file .nav-file-title[data-path$=".mp3"]::before,
.anp-file-icons .nav-file .nav-file-title[data-path$=".wav"]::before,
.anp-file-icons .nav-file .nav-file-title[data-path$=".m4a"]::before,
.anp-file-icons .nav-file .nav-file-title[data-path$=".ogg"]::before,
.anp-file-icons .nav-file .nav-file-title[data-path$=".flac"]::before,
.anp-file-icons .nav-file .nav-file-title[data-path$=".3gp"]::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18V5l12-2v13M9 9l12-2'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E");
-webkit-mask-repeat: no-repeat;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18V5l12-2v13M9 9l12-2'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E");
-webkit-mask-repeat: no-repeat;
}
.anp-file-icons .nav-file .nav-file-title[data-path$=".webm"]::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M10 8l6 4-6 4V8z'/%3E%3C/svg%3E");
-webkit-mask-repeat: no-repeat;
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M10 8l6 4-6 4V8z'/%3E%3C/svg%3E");
-webkit-mask-repeat: no-repeat;
}
.anp-file-icons .nav-file .nav-file-title[data-path$=".mp4"]::before,
.anp-file-icons .nav-file .nav-file-title[data-path$=".ogv"]::before,
.anp-file-icons .nav-file .nav-file-title[data-path$=".mov"]::before,
.anp-file-icons .nav-file .nav-file-title[data-path$=".mkv"]::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8H4Z'/%3E%3Cpath d='m4 11-.88-2.87a2 2 0 0 1 1.33-2.5l11.48-3.5a2 2 0 0 1 2.5 1.32l.87 2.87L4 11.01Z'/%3E%3Cpath d='M6.6 4.99l3.38 4.2m1.88-5.81l3.38 4.2'/%3E%3C/svg%3E");
-webkit-mask-repeat: no-repeat;
}
.anp-file-icons
.nav-folder.mod-root
> .nav-folder-children
> .nav-file
.nav-file-title {
padding-left: var(--size-4-2);
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8H4Z'/%3E%3Cpath d='m4 11-.88-2.87a2 2 0 0 1 1.33-2.5l11.48-3.5a2 2 0 0 1 2.5 1.32l.87 2.87L4 11.01Z'/%3E%3Cpath d='M6.6 4.99l3.38 4.2m1.88-5.81l3.38 4.2'/%3E%3C/svg%3E");
-webkit-mask-repeat: no-repeat;
}

0 comments on commit fff6a02

Please sign in to comment.