Skip to content

Commit fc67e98

Browse files
committed
feat: ruler lines and outline to be shown in blue for non-editable elements
1 parent e3094bb commit fc67e98

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4003,6 +4003,10 @@ function RemoteFunctions(config = {}) {
40034003
top: null,
40044004
bottom: null
40054005
};
4006+
// gray color for non-editable elements, blue for editable
4007+
this.color = element.hasAttribute("data-brackets-id")
4008+
? "#4285F4"
4009+
: "#3C3F41";
40064010
this.create();
40074011
this.update();
40084012
}
@@ -4021,17 +4025,17 @@ function RemoteFunctions(config = {}) {
40214025
this.lineElements.top.setAttribute("data-phcode-internal-c15r5a9", "true");
40224026
this.lineElements.bottom.setAttribute("data-phcode-internal-c15r5a9", "true");
40234027

4024-
let applyStyles = function (element) {
4028+
let applyStyles = function (element, color) {
40254029
element.style.position = "absolute";
4026-
element.style.backgroundColor = "rgba(66, 133, 244, 0.5)";
4030+
element.style.backgroundColor = color;
40274031
element.style.pointerEvents = "none";
40284032
element.style.zIndex = "2147483645";
40294033
};
40304034

4031-
applyStyles(this.lineElements.left);
4032-
applyStyles(this.lineElements.right);
4033-
applyStyles(this.lineElements.top);
4034-
applyStyles(this.lineElements.bottom);
4035+
applyStyles(this.lineElements.left, this.color);
4036+
applyStyles(this.lineElements.right, this.color);
4037+
applyStyles(this.lineElements.top, this.color);
4038+
applyStyles(this.lineElements.bottom, this.color);
40354039

40364040
body.appendChild(this.lineElements.left);
40374041
body.appendChild(this.lineElements.right);
@@ -4388,7 +4392,8 @@ function RemoteFunctions(config = {}) {
43884392
}
43894393

43904394
element._originalOutline = element.style.outline;
4391-
element.style.outline = "1px solid #4285F4";
4395+
const outlineColor = element.hasAttribute("data-brackets-id") ? "#4285F4" : "#3C3F41";
4396+
element.style.outline = `1px solid ${outlineColor}`;
43924397

43934398
// Only apply background tint for editable elements (not for dynamic/read-only)
43944399
if (element.hasAttribute("data-brackets-id")) {

0 commit comments

Comments
 (0)