Skip to content

Commit 78fb573

Browse files
authored
Colored Context Menu Addon -- Support for Block Text Color
1 parent 576e144 commit 78fb573

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/addons/addons/editor-colored-context-menus/userscript.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
border-top-color: var(--sa-contextmenu-border) !important;
1212
}
1313
.sa-contextmenu-colored .blocklyContextMenu .goog-menuitem .goog-menuitem-content {
14-
color: white;
14+
color: var(--sa-contextmenu-text, #fff);
1515
}
16+

src/addons/addons/editor-colored-context-menus/userscript.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default async function ({ addon, console }) {
1717
widgetDiv.classList.add("sa-contextmenu-colored");
1818
widgetDiv.style.setProperty("--sa-contextmenu-bg", fill);
1919
widgetDiv.style.setProperty("--sa-contextmenu-border", border);
20+
if (block.textColour) widgetDiv.style.setProperty("--sa-contextmenu-text", block.textColour);
2021
};
2122

2223
const originalHandleRightClick = ScratchBlocks.Gesture.prototype.handleRightClick;

0 commit comments

Comments
 (0)