Skip to content

Commit 98ccb62

Browse files
authored
fix: enable and style workspace comments (#82)
* fix: show workspace comment menu items * fix: mostly match Scratch's styling of workspace comments * fix: register workspace comment menu items only once
1 parent 9e01bc5 commit 98ccb62

File tree

5 files changed

+65
-0
lines changed

5 files changed

+65
-0
lines changed

core/css.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,57 @@ const styles = `
12871287
width: 1.25rem;
12881288
height: 1.25rem;
12891289
}
1290+
1291+
.blocklyCommentTopbar {
1292+
height: 32px;
1293+
--commentBorderColour: #e2db96;
1294+
}
1295+
1296+
.blocklyCommentTopbarBackground {
1297+
height: 32px;
1298+
}
1299+
1300+
.blocklyFoldoutIcon {
1301+
width: 32px;
1302+
height: 32px;
1303+
transform-origin: 16px 16px;
1304+
}
1305+
1306+
.blocklyComment:not(.blocklyCollapsed) .blocklyCommentHighlight,
1307+
.blocklySelected .blocklyCommentHighlight,
1308+
.blocklyCollapsed .blocklyCommentTopbarBackground,
1309+
.blocklyCollapsed.blocklySelected .blocklyCommentTopbarBackground {
1310+
stroke: #bcA903;
1311+
stroke-width: 1px;
1312+
}
1313+
1314+
.blocklyCollapsed.blocklyComment .blocklyFoldoutIcon {
1315+
transform: rotate(-180deg);
1316+
}
1317+
1318+
.zelos-renderer.scratch-theme .blocklyComment .blocklyTextarea {
1319+
border: none;
1320+
--commentFillColour: #fef49c;
1321+
font-size: 12pt;
1322+
font-weight: 400;
1323+
padding: 12px;
1324+
color: #575e75;
1325+
}
1326+
1327+
.zelos-renderer.scratch-theme .blocklyCommentText.blocklyText {
1328+
font-weight: 400;
1329+
}
1330+
1331+
.blocklyDeleteIcon {
1332+
display: block;
1333+
width: 32px;
1334+
height: 32px;
1335+
}
1336+
1337+
.blocklyResizeHandle {
1338+
height: 20px;
1339+
width: 20px;
1340+
}
12901341
`;
12911342

12921343
Blockly.Css.register(styles);

media/delete-icon.svg

Lines changed: 10 additions & 0 deletions
Loading
File renamed without changes.

media/resize-handle.svg

Lines changed: 3 additions & 0 deletions
Loading

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,4 @@ Blockly.FlyoutButton.TEXT_MARGIN_X = 40;
8383
Blockly.FlyoutButton.TEXT_MARGIN_Y = 10;
8484
Blockly.ContextMenuRegistry.registry.unregister('blockDisable');
8585
Blockly.ContextMenuRegistry.registry.unregister('blockInline');
86+
Blockly.ContextMenuItems.registerCommentOptions();

0 commit comments

Comments
 (0)