mirror of
https://github.com/litruv/Docs-Viewer.git
synced 2026-07-24 02:36:07 +10:00
Add color property to folder icons in DOMService for improved styling
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
{
|
{
|
||||||
"title": "Unreal Engine",
|
"title": "Unreal Engine",
|
||||||
"type": "folder",
|
"type": "folder",
|
||||||
|
"color": "#2196f3",
|
||||||
"path": "docs/unreal-engine.md",
|
"path": "docs/unreal-engine.md",
|
||||||
"slug": "unreal-engine",
|
"slug": "unreal-engine",
|
||||||
"items": [
|
"items": [
|
||||||
|
|||||||
6
index.js
6
index.js
@@ -197,9 +197,10 @@ class DOMService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createFolderHeaderWithFile(iconClass, doc) {
|
createFolderHeaderWithFile(iconClass, doc) {
|
||||||
|
const iconStyle = doc.color ? `color: ${doc.color};` : '';
|
||||||
return `
|
return `
|
||||||
<div class="folder-icons">
|
<div class="folder-icons">
|
||||||
<i class="${iconClass} folder-icon"></i>
|
<i class="${iconClass} folder-icon" style="${iconStyle}"></i>
|
||||||
</div>
|
</div>
|
||||||
<span>${doc.title}</span>
|
<span>${doc.title}</span>
|
||||||
<a href="?${doc.slug}" class="folder-link" title="View folder page">
|
<a href="?${doc.slug}" class="folder-link" title="View folder page">
|
||||||
@@ -208,9 +209,10 @@ class DOMService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createFolderHeaderBasic(iconClass, doc) {
|
createFolderHeaderBasic(iconClass, doc) {
|
||||||
|
const iconStyle = doc.color ? `color: ${doc.color};` : '';
|
||||||
return `
|
return `
|
||||||
<div class="folder-icons">
|
<div class="folder-icons">
|
||||||
<i class="${iconClass} folder-icon"></i>
|
<i class="${iconClass} folder-icon" style="${iconStyle}"></i>
|
||||||
</div>
|
</div>
|
||||||
<span>${doc.title}</span>`;
|
<span>${doc.title}</span>`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user