Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Converted Source Tree SVG's (including Blackbox) to images using CSS …
Browse files Browse the repository at this point in the history
…styles (#4350) (#4477)
  • Loading branch information
Jiel (Jyle) Selmani authored and jasonLaster committed Oct 24, 2017
1 parent cd97e1c commit eb88cf3
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 28 deletions.
30 changes: 15 additions & 15 deletions src/components/PrimaryPanes/Sources.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,34 +131,34 @@
fill: var(--theme-body-color);
}

.sources-list .managed-tree .tree .node .blackBox svg {
.sources-list .managed-tree .tree .node img.blackBox {
mask: url(/images/blackBox.svg) no-repeat;
mask-size: 100%;
background-color: var(--theme-highlight-blue);
width: 13px;
position: relative;
top: 2px;
height: 13px;
display: inline-block;
margin-inline-end: 5px;
}
.sources-list .managed-tree .tree .node .blackBox path {
fill: var(--theme-textbox-box-shadow);
margin-bottom: -2px;
}

.sources-list .managed-tree .tree .node.focused .blackBox path {
fill: white;
.sources-list .managed-tree .tree .node.focused img.blackBox {
background-color: white;
}

.theme-dark
.sources-list
.managed-tree
.tree
.node:not(.focused)
.blackBox
svg {
fill: var(--theme-content-color3);
img.blackBox {
background-color: var(--theme-content-color3);
}

.theme-dark .sources-list .managed-tree .tree .node .blackBox circle {
fill: var(--theme-body-color);
.theme-dark .sources-list .managed-tree .tree .node img.blackBox {
background-color: var(--theme-body-color);
}

.theme-dark .sources-list .managed-tree .tree .node.focused .blackBox circle {
fill: white;
.theme-dark .sources-list .managed-tree .tree .node.focused img.blackBox {
background-color: white;
}
8 changes: 4 additions & 4 deletions src/components/PrimaryPanes/SourcesTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,18 @@ class SourcesTree extends Component<Props, State> {
}

if (depth === 0) {
return <Svg name="domain" />;
return <img className="domain" />;
}

if (!nodeHasChildren(item)) {
const source = sources.get(item.contents.get("id"));
if (source.get("isBlackBoxed")) {
return <Svg name="blackBox" />;
return <img className="blackBox" />;
}
return <Svg name="file" />;
return <img className="file" />;
}

return <Svg name="folder" />;
return <img className="folder" />;
}

onContextMenu(event, item) {
Expand Down
40 changes: 31 additions & 9 deletions src/components/shared/Svg.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
.arrow,
.folder,
.domain,
.file,
.worker,
.refresh,
.shortcut,
.add-button {
fill: var(--theme-splitter-color);
}

.file,
.folder,
.domain {
background-color: var(--theme-splitter-color);
}

.worker,
.folder {
position: relative;
Expand All @@ -24,22 +27,41 @@
top: 1px;
}

.domain svg,
.folder svg,
.worker svg,
.refresh svg,
.shortcut svg,
.add-button svg {
width: 15px;
}

.file svg {
img.domain,
img.folder {
width: 15px;
height: 15px;
}

img.domain {
mask: url(/images/domain.svg) no-repeat;
}

img.folder {
mask: url(/images/folder.svg) no-repeat;
}

img.file {
mask: url(/images/file.svg) no-repeat;
width: 13px;
height: 13px;
}

img.domain,
img.folder,
img.file {
mask-size: 100%;
margin-inline-end: 5px;
display: inline-block;
}

.file svg,
.domain svg,
.folder svg,
.refresh svg,
.shortcut svg,
.worker svg {
Expand Down

0 comments on commit eb88cf3

Please sign in to comment.