Skip to content

Commit

Permalink
added highlighting feature
Browse files Browse the repository at this point in the history
  • Loading branch information
AwMan3703 committed Feb 7, 2025
1 parent c95030c commit dd258b3
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
12 changes: 11 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@
"enableDynamicBackgrounds" : true
},
"items" : {
"iconRoot": "assets/",
"default_highlight_colors" : {
"Rosso": "#ff000015",
"Arancione": "#ff880022",
"Giallo": "#ffdd0030",
"Verde": "#00dd0015",
"Azzurro": "#00bbff20",
"Blu": "#0000ff10",
"Viola": "#aa00aa15",
"Nessuno": "inherit"
},
"iconRoot" : "assets/",
"types" : {
"csITEMTYPE:commission" : {
"names" : { "singular" : "commissione", "plural" : "commissioni", "section_title" : "commissione" },
Expand Down
8 changes: 8 additions & 0 deletions js/sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ function appendItem(type, content) {
const btnWrapper = document.createElement("div")
btnWrapper.className = "csItem-btn-wrapper"

const colorBtn = document.createElement("button")
colorBtn.onclick = _ => selectColor(itemID)
const colorIcon = document.createElement("img")
colorIcon.className = "icon-mono display-mode-dynamic-icon"
colorIcon.src = "assets/palette.png"
colorBtn.appendChild(colorIcon)

const editBtn = document.createElement("button")
editBtn.onclick = _ => editItem(itemID)
const editIcon = document.createElement("img")
Expand All @@ -165,6 +172,7 @@ function appendItem(type, content) {
xIcon.src = "assets/x.png"
xBtn.appendChild(xIcon)

btnWrapper.appendChild(colorBtn)
btnWrapper.appendChild(editBtn)
btnWrapper.appendChild(xBtn)

Expand Down
14 changes: 11 additions & 3 deletions style/dialog.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions style/dialog.less
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,15 @@
margin-inline-end: @padding;
}
.dialog-input-description {}

.cs-item-color-selector-list {
&:extend(.flex-hor);
gap: @padding;
padding-inline-start: 0;
}
.cs-item-color-selector-item {
&:extend(.material);
&:extend(.flex-hor);
}
.cs-item-color-selector-item-input {}
.cs-item-color-selector-item-label {}

0 comments on commit dd258b3

Please sign in to comment.