From a2b9a8dbdb488626af2bdcba2e8571c049fcb209 Mon Sep 17 00:00:00 2001 From: Pluto Date: Fri, 11 Sep 2026 16:14:38 +0530 Subject: [PATCH 01/19] fix: simplify insert element picker --- src/nls/root/strings.js | 1 + src/styles/Extn-LayersPanel.less | 311 +++++++++---------------------- 2 files changed, 94 insertions(+), 218 deletions(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 1e668a23c5..b9da19c389 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -828,6 +828,7 @@ define({ "LIVE_PREVIEW_LAYERS_SCRIPT_GENERATED": "Generated by script, not in the source file", "LIVE_PREVIEW_LAYERS_TAG_TOOLTIP": "Show Tag Name Tooltip", "LIVE_PREVIEW_LAYERS_INSERT_ELEMENT": "Insert Element", + "LIVE_PREVIEW_LAYERS_INSERT_POSITION": "Placement", "LIVE_PREVIEW_LAYERS_INSERT_INTO_PAGE": "Add to the page", "LIVE_PREVIEW_LAYERS_INSERT_LOADING": "Loading elements…", "LIVE_PREVIEW_LAYERS_INSERT_UNAVAILABLE": "The live preview did not answer. Try again in a moment.", diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index 0baf7a0d58..4c7a423854 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -1193,11 +1193,11 @@ body.layers-scrubbing { display: flex; flex-direction: column; box-sizing: border-box; - padding: 8px; - border: 1px solid rgba(255, 255, 255, 0.1); - border-radius: 8px; - background: #2a2a2a; - box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.3); + padding: 12px; + border: 1px solid @layers-border; + border-radius: 10px; + background: @bc-ai-sidebar-bg; + box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); color: @project-panel-text-1; font-size: @sidebar-small-font-size; letter-spacing: normal; @@ -1207,157 +1207,51 @@ body.layers-scrubbing { .layers-insert-head { display: flex; align-items: center; - gap: 8px; - min-height: 24px; - padding: 0 0 8px; - white-space: nowrap; - } - - .layers-insert-where { - flex: 1; - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - font-weight: 600; - color: @project-panel-text-1; + justify-content: space-between; + padding-bottom: 10px; } - .layers-node-icon { - display: flex; - align-items: center; - justify-content: center; - width: 15px; - height: 15px; - flex: none; - color: @project-panel-text-2; - - svg { - width: 15px; - height: 15px; - display: block; - } - } - - .layers-insert-target { - display: flex; - flex: 0 1 auto; - align-items: center; - gap: 4px; - min-width: 40px; - max-width: 38%; - height: 24px; - padding: 0 7px 0 5px; - box-sizing: border-box; - border-radius: 6px; - background: @layers-accent-soft; - color: @project-panel-text-1; - - .layers-node-icon { - width: 14px; - height: 14px; - color: @layers-accent; - - svg { - width: 14px; - height: 14px; - } - } - } - - .layers-insert-target-name { - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - font-family: @layers-mono; - font-size: @sidebar-xs-font-size; + .layers-insert-title { font-weight: 500; } - .layers-insert-positions { - display: flex; - flex: 1 1 auto; - min-width: 0; - gap: 2px; - padding: 2px; - border-radius: 6px; - background: rgba(255, 255, 255, 0.06); + .layers-icon-btn { + .layers-icon-button(); } - .layers-insert-pos { + .layers-node-icon { display: flex; - flex: 1 1 0; align-items: center; justify-content: center; - gap: 3px; - min-width: 0; + width: 20px; height: 20px; - padding: 0 4px; - margin: 0; - border: none; - border-radius: 4px; - background: transparent; - color: @project-panel-text-1; - font-family: inherit; - font-size: 10px; - font-weight: 500; - opacity: 0.8; - cursor: pointer; - outline: none; + flex: none; + color: @project-panel-text-2; svg { - width: 12px; - height: 12px; - flex: none; - } - - span { - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - - &:hover { - background: rgba(255, 255, 255, 0.1); - opacity: 1; - } - - &.layers-active { - background: @layers-accent; - color: #ffffff; - opacity: 1; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); - } - - &:disabled { - opacity: 0.3; - cursor: default; - - &:hover { - background: transparent; - } + width: 18px; + height: 18px; } } .layers-insert-search { display: flex; align-items: center; - gap: 6px; - height: 26px; - padding: 0 6px 0 8px; - box-sizing: border-box; + gap: 8px; + height: 32px; + flex: none; + padding: 0 10px; border: 1px solid @layers-border; border-radius: 6px; background: @layers-input-bg; &:focus-within { border-color: @layers-accent; - background: @layers-input-bg-focus; } > svg { - width: 13px; - height: 13px; + width: 14px; + height: 14px; flex: none; color: @project-panel-text-2; } @@ -1373,120 +1267,82 @@ body.layers-scrubbing { box-shadow: none; background: transparent; color: @project-panel-text-1; - font-family: inherit; - font-size: @sidebar-small-font-size; + font: inherit; &::placeholder { color: @project-panel-text-2; - opacity: 0.75; } } } .layers-insert-list { - margin: 8px -6px 0 0; - padding: 0; + margin: 10px 0; overflow-y: auto; overflow-x: hidden; - scrollbar-gutter: stable; - - &::-webkit-scrollbar { - width: 6px !important; - background-color: transparent !important; - } - - &::-webkit-scrollbar-thumb { - border-radius: 3px !important; - border: none !important; - background-color: rgba(255, 255, 255, 0.18) !important; - } + min-height: 0; } .layers-insert-grid { display: grid; - grid-template-columns: repeat(4, minmax(0, 1fr)); + grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; } .layers-insert-item { - border-radius: 5px; - cursor: pointer; - - &.layers-insert-selected { - background: @layers-accent-strong; - - .layers-node-icon, - .layers-insert-item-tag { - color: @project-panel-text-1; - } - } - } - - .layers-insert-tile { display: flex; - flex-direction: column; align-items: center; - justify-content: center; - gap: 3px; + gap: 9px; min-width: 0; - height: 42px; - padding: 0 3px; - box-sizing: border-box; - border: 1px solid @layers-border; - background: rgba(255, 255, 255, 0.03); + padding: 9px; + margin: 0; + border: 1px solid transparent; + border-radius: 6px; + background: transparent; + color: @project-panel-text-1; + text-align: left; + font: inherit; + cursor: pointer; - .layers-node-icon { - width: 15px; - height: 15px; - color: @project-panel-text-1; + &.layers-insert-selected, + &:hover { + background: @layers-accent-soft; - svg { - width: 15px; - height: 15px; + .layers-node-icon { + color: @layers-accent; } } - .layers-insert-item-name { - max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - font-size: 10px; - line-height: 1.2; + &:focus-visible { + outline: 1px solid @layers-accent; + outline-offset: -1px; } + } - &.layers-insert-selected { - border-color: @layers-accent; - - .layers-node-icon { - color: @layers-accent; - } - } + .layers-insert-item-name { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .layers-insert-more { display: flex; align-items: center; justify-content: center; - gap: 4px; + gap: 5px; width: 100%; - height: 24px; - margin: 6px 0 0; - padding: 0; + margin: 8px 0 0; + padding: 6px; border: none; border-radius: 4px; background: transparent; color: @project-panel-text-2; - font-family: inherit; - font-size: @sidebar-xs-font-size; + font: inherit; cursor: pointer; - outline: none; svg { - width: 11px; - height: 11px; - flex: none; - transition: transform 120ms ease; + width: 12px; + height: 12px; } &.layers-insert-open svg { @@ -1500,30 +1356,49 @@ body.layers-scrubbing { } .layers-insert-create { + width: 100%; + } + + .layers-insert-empty { + padding: 14px 8px; + color: @project-panel-text-2; + } + + .layers-insert-placement { display: flex; align-items: center; - gap: 7px; - height: 24px; - margin-top: 4px; - padding: 0 6px; - white-space: nowrap; + gap: 8px; + padding-top: 10px; + border-top: 1px solid @layers-border; + flex: none; + min-width: 0; + color: @project-panel-text-2; + } - .layers-node-icon { - color: @layers-accent; - } + .layers-insert-position { + width: auto; + height: 28px; + margin: 0; + padding: 2px 6px; + border: 1px solid @layers-border; + border-radius: 5px; + background: @bc-ai-sidebar-bg; + color: @project-panel-text-1; + font: inherit; + cursor: pointer; + } - .layers-insert-item-name { - flex: 1; - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - } + .layers-insert-target { + display: flex; + align-items: center; + gap: 5px; + min-width: 0; } - .layers-insert-empty { - padding: 8px 6px; - color: @project-panel-text-2; - white-space: normal; + .layers-insert-target-name { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } } From 4445e5624a2122179e8724f7ad9dabdb061cc517 Mon Sep 17 00:00:00 2001 From: Pluto Date: Fri, 11 Sep 2026 16:22:45 +0530 Subject: [PATCH 02/19] feat: highlight styles save target --- src/nls/root/strings.js | 1 + src/styles/Extn-LayersPanel.less | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index b9da19c389..1c57d92874 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -828,6 +828,7 @@ define({ "LIVE_PREVIEW_LAYERS_SCRIPT_GENERATED": "Generated by script, not in the source file", "LIVE_PREVIEW_LAYERS_TAG_TOOLTIP": "Show Tag Name Tooltip", "LIVE_PREVIEW_LAYERS_INSERT_ELEMENT": "Insert Element", + "LIVE_PREVIEW_LAYERS_SAVE_TARGET": "Styles bar changes are saved here", "LIVE_PREVIEW_LAYERS_INSERT_POSITION": "Placement", "LIVE_PREVIEW_LAYERS_INSERT_INTO_PAGE": "Add to the page", "LIVE_PREVIEW_LAYERS_INSERT_LOADING": "Loading elements…", diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index 4c7a423854..4b332d0970 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -1088,6 +1088,23 @@ min-height: 20px; } + .layers-rule-target .layers-rule-header { + background: @layers-accent-soft; + border-radius: 4px; + } + + .layers-rule-target-mark { + display: flex; + flex: none; + margin-left: 4px; + color: @layers-accent; + + svg { + width: 12px; + height: 12px; + } + } + .layers-rule-selector { flex: 1; min-width: 0; From 81cf9411ac81a73880a88e3affa8d0ef338a931b Mon Sep 17 00:00:00 2001 From: Pluto Date: Fri, 11 Sep 2026 16:40:57 +0530 Subject: [PATCH 03/19] feat: add styles from layers panel --- src/nls/root/strings.js | 14 +++++++++++++ src/styles/Extn-LayersPanel.less | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 1c57d92874..09ffc1394a 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -828,6 +828,20 @@ define({ "LIVE_PREVIEW_LAYERS_SCRIPT_GENERATED": "Generated by script, not in the source file", "LIVE_PREVIEW_LAYERS_TAG_TOOLTIP": "Show Tag Name Tooltip", "LIVE_PREVIEW_LAYERS_INSERT_ELEMENT": "Insert Element", + "LIVE_PREVIEW_LAYERS_ADD_STYLE": "Add style", + "LIVE_PREVIEW_LAYERS_STYLE_KIND": "Style type", + "LIVE_PREVIEW_LAYERS_STYLE_CLASS": "Class", + "LIVE_PREVIEW_LAYERS_STYLE_NAME": "Name", + "LIVE_PREVIEW_LAYERS_STYLE_NAME_HINT": "e.g. card", + "LIVE_PREVIEW_LAYERS_STYLE_FILE": "Save in", + "LIVE_PREVIEW_LAYERS_STYLE_IN_PAGE": "This page", + "LIVE_PREVIEW_LAYERS_STYLE_NEW_FILE": "New stylesheet…", + "LIVE_PREVIEW_LAYERS_STYLE_FILENAME": "Filename", + "LIVE_PREVIEW_LAYERS_STYLE_HELP": "The class or ID is applied to this element. New stylesheets are created beside this page and linked automatically.", + "LIVE_PREVIEW_LAYERS_STYLE_INVALID_NAME": "Use a name starting with a letter or underscore, followed by letters, numbers, hyphens or underscores.", + "LIVE_PREVIEW_LAYERS_STYLE_INVALID_FILE": "Enter a filename ending in .css, without folders.", + "LIVE_PREVIEW_LAYERS_STYLE_DUPLICATE_ID": "Another element already uses this ID. Choose a different name.", + "LIVE_PREVIEW_LAYERS_STYLE_FAILED": "Couldn’t add the style.", "LIVE_PREVIEW_LAYERS_SAVE_TARGET": "Styles bar changes are saved here", "LIVE_PREVIEW_LAYERS_INSERT_POSITION": "Placement", "LIVE_PREVIEW_LAYERS_INSERT_INTO_PAGE": "Add to the page", diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index 4b332d0970..a2bbbc1af2 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -1666,3 +1666,37 @@ body.layers-dnd-invalid { animation-duration: 1ms; } } + +.layers-style-dialog { + width: 420px; + + .layers-hidden { + display: none; + } + + .layers-style-form-field { + display: flex; + flex-direction: column; + gap: 6px; + margin-bottom: 14px; + + input, + select { + box-sizing: border-box; + width: 100%; + height: 32px; + margin: 0; + } + } + + .layers-style-help { + color: @project-panel-text-2; + font-size: @sidebar-small-font-size; + line-height: 1.5; + } + + .layers-style-error { + color: #e89a9a; + font-size: @sidebar-small-font-size; + } +} From 3906db8445270419d6f4b09f335a36a74cf6281c Mon Sep 17 00:00:00 2001 From: Pluto Date: Fri, 11 Sep 2026 16:57:51 +0530 Subject: [PATCH 04/19] feat: copy and paste styles --- src/nls/root/strings.js | 7 +++++++ src/styles/Extn-LayersPanel.less | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 09ffc1394a..0bd94090b9 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -828,6 +828,13 @@ define({ "LIVE_PREVIEW_LAYERS_SCRIPT_GENERATED": "Generated by script, not in the source file", "LIVE_PREVIEW_LAYERS_TAG_TOOLTIP": "Show Tag Name Tooltip", "LIVE_PREVIEW_LAYERS_INSERT_ELEMENT": "Insert Element", + "LIVE_PREVIEW_LAYERS_COPY_DECLARATION": "Copy property", + "LIVE_PREVIEW_LAYERS_COPY_RULE": "Copy selector and properties", + "LIVE_PREVIEW_LAYERS_PASTE_HINT": "Paste properties or a CSS rule here", + "LIVE_PREVIEW_LAYERS_PASTE_INVALID": "Paste CSS properties or one complete selector at a time.", + "LIVE_PREVIEW_LAYERS_PASTE_FAILED": "Couldn’t paste these properties. Try again.", + "LIVE_PREVIEW_LAYERS_PASTED": "Properties pasted into {0}", + "LIVE_PREVIEW_LAYERS_COPY_FAILED": "Couldn’t copy these styles. Try again.", "LIVE_PREVIEW_LAYERS_ADD_STYLE": "Add style", "LIVE_PREVIEW_LAYERS_STYLE_KIND": "Style type", "LIVE_PREVIEW_LAYERS_STYLE_CLASS": "Class", diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index a2bbbc1af2..d189789bf6 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -1088,6 +1088,29 @@ min-height: 20px; } + .layers-rule-copy { + opacity: 0; + } + + .layers-rule-header:hover .layers-rule-copy, + .layers-rule-header:focus-within .layers-rule-copy { + opacity: 1; + } + + .layers-rule-header:focus-visible { + outline: 1px solid @layers-accent; + outline-offset: 2px; + } + + .layers-style-notice { + padding: 8px; + margin-bottom: 6px; + border-radius: 4px; + background: @layers-accent-soft; + color: @project-panel-text-1; + font-size: @sidebar-small-font-size; + } + .layers-rule-target .layers-rule-header { background: @layers-accent-soft; border-radius: 4px; From 5e7a7d874eb50d503ccbc70189f192cfd316aabb Mon Sep 17 00:00:00 2001 From: Pluto Date: Fri, 11 Sep 2026 17:01:16 +0530 Subject: [PATCH 05/19] fix: clean up layer selection --- src/styles/Extn-LayersPanel.less | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index d189789bf6..9fbe42ef64 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -511,7 +511,6 @@ &.layers-selected { background: @layers-row-select-bg; - box-shadow: inset 2px 0 0 @layers-accent; } &.layers-match { @@ -677,7 +676,7 @@ } .layers-node.layers-root-node .layers-node-tag { - font-weight: 500; + font-weight: 400; color: @project-panel-text-2; } @@ -737,7 +736,7 @@ background: @layers-row-select-bg; } - .layers-node.layers-holds-selected:not(:hover) .layers-node-tools { + .layers-node.layers-holds-selected .layers-node-tools { background: @layers-row-holder-bg; } From 21fe792f57c4fcd1c84425a9c87cc035558f3c33 Mon Sep 17 00:00:00 2001 From: Pluto Date: Fri, 11 Sep 2026 17:40:15 +0530 Subject: [PATCH 06/19] feat: improve style value editing --- .../default/InlineColorEditor/ColorEditor.js | 9 +- src/nls/root/strings.js | 3 +- src/styles/Extn-LayersPanel.less | 140 ++++++++++++++++++ 3 files changed, 147 insertions(+), 5 deletions(-) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index 69f3b3a4d1..83e801f8f0 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -32,7 +32,7 @@ define(function (require, exports, module) { tinycolor = brackets.getModule("thirdparty/tinycolor"); /** Mustache template that forms the bare DOM structure of the UI */ - var ColorEditorTemplate = require("text!ColorEditorTemplate.html"); + var ColorEditorTemplate = require("text!./ColorEditorTemplate.html"); /** * @const @type {number} @@ -131,9 +131,10 @@ define(function (require, exports, module) { this._redoColor = null; this._isUpperCase = PreferencesManager.get("uppercaseColors"); - PreferencesManager.on("change", "uppercaseColors", function () { + this._handleUppercaseColorsChange = function () { this._isUpperCase = PreferencesManager.get("uppercaseColors"); - }.bind(this)); + }.bind(this); + PreferencesManager.on("change", "uppercaseColors", this._handleUppercaseColorsChange); this.$colorValue = this.$element.find(".color-value"); this.$buttonList = this.$element.find("ul.button-bar"); @@ -270,7 +271,7 @@ define(function (require, exports, module) { * Remove any preference listeners before destroying the editor. */ ColorEditor.prototype.destroy = function () { - PreferencesManager.off("change", "uppercaseColors"); + PreferencesManager.off("change", "uppercaseColors", this._handleUppercaseColorsChange); }; /** diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 0bd94090b9..02735c2f46 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -828,6 +828,7 @@ define({ "LIVE_PREVIEW_LAYERS_SCRIPT_GENERATED": "Generated by script, not in the source file", "LIVE_PREVIEW_LAYERS_TAG_TOOLTIP": "Show Tag Name Tooltip", "LIVE_PREVIEW_LAYERS_INSERT_ELEMENT": "Insert Element", + "LIVE_PREVIEW_LAYERS_CHANGE_COLOR": "Change color", "LIVE_PREVIEW_LAYERS_COPY_DECLARATION": "Copy property", "LIVE_PREVIEW_LAYERS_COPY_RULE": "Copy selector and properties", "LIVE_PREVIEW_LAYERS_PASTE_HINT": "Paste properties or a CSS rule here", @@ -859,7 +860,7 @@ define({ "LIVE_PREVIEW_LAYERS_EMPTY_PAGE_PROPERTIES": "The page is empty. Add an element to see its properties.", "LIVE_PREVIEW_LAYERS_EMPTY_PAGE_STYLES": "The page is empty. Add an element to see its styles.", "LIVE_PREVIEW_LAYERS_SHOW_SELECTED": "Show the selected element", - "LIVE_PREVIEW_LAYERS_SCRUB_HINT": "Drag to adjust, double-click to edit", + "LIVE_PREVIEW_LAYERS_SCRUB_HINT": "Drag to adjust. Scroll or use arrow keys while editing. Shift: larger steps, Alt: smaller steps", "LIVE_PREVIEW_LAYERS_PROPERTY_PLACEHOLDER": "property", "LIVE_PREVIEW_LAYERS_VALUE_PLACEHOLDER": "value", diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index 9fbe42ef64..3ff04646f6 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -993,6 +993,48 @@ color: @layers-prop-value; } + .layers-decl-value-wrap { + display: inline-flex; + align-items: center; + flex: none; + gap: 4px; + margin-left: 5px; + + .layers-decl-value { + margin-left: 0; + } + } + + .layers-decl-color { + position: relative; + flex: none; + width: 12px; + height: 12px; + padding: 0; + border: 1px solid rgba(255, 255, 255, 0.25); + border-radius: 2px; + background: repeating-conic-gradient(#999 0% 25%, #fff 0% 50%) 0 0 / 6px 6px; + cursor: pointer; + + &::after { + content: ""; + position: absolute; + inset: 0; + background: var(--layers-color); + } + + &:focus-visible { + outline: 1px solid @layers-accent; + outline-offset: 2px; + } + } + + .layers-value-scrub { + cursor: ew-resize; + width: 14px; + color: @project-panel-text-2; + } + input.layers-decl-input[type="text"] { .layers-field-input(); flex: none; @@ -1722,3 +1764,101 @@ body.layers-dnd-invalid { font-size: @sidebar-small-font-size; } } + +.layers-color-popup { + position: fixed; + z-index: 1000; + box-sizing: border-box; + padding: 12px; + overflow: auto; + border: 1px solid @layers-border; + border-radius: 10px; + background: @bc-ai-sidebar-bg; + color: @project-panel-text-1; + box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3); + + .layers-color-head { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 12px; + font-size: @sidebar-small-font-size; + font-weight: 500; + } + + .layers-icon-btn { + .layers-icon-button(); + } + + .color-editor { + min-width: 0; + width: 100%; + height: auto; + padding: 0; + + aside { + display: none; + } + + section { + display: block; + width: 100%; + + .sliders { + display: flex; + align-items: stretch; + } + + .color-selection-field { + flex: 1; + min-width: 0; + width: auto; + margin-right: 12px; + float: none; + } + + .slider { + flex: none; + margin-right: 12px; + float: none; + } + + .opacity-slider { + margin-right: 0; + } + + footer { + display: flex; + align-items: center; + gap: 8px; + padding-top: 12px; + } + + footer input.color-value { + flex: 1; + min-width: 0; + width: 0; + height: 26px; + margin: 0; + padding: 0 6px; + border-color: @layers-border; + background: @layers-input-bg; + color: @project-panel-text-1; + font-family: @layers-mono; + font-size: 11px; + + &:focus { + border-color: @layers-accent; + background: @layers-input-bg-focus; + box-shadow: none; + } + } + } + + ul.button-bar { + flex: none; + margin-left: 0; + white-space: nowrap; + } + } +} From 81e287600d2375ccb1cfaad25d95aa035e7ea27c Mon Sep 17 00:00:00 2001 From: Pluto Date: Fri, 11 Sep 2026 17:45:26 +0530 Subject: [PATCH 07/19] fix: keep add style button visible --- src/styles/Extn-LayersPanel.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index 3ff04646f6..0ee3070055 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -297,7 +297,7 @@ flex-shrink: 0; } - .layers-section-actions .layers-hdr-btn:not(.layers-active) { + .layers-section-actions .layers-hdr-btn:not(.layers-active):not(.layers-add-style) { display: none; } From 8cb7b906a78d2ca966e49806088adf3d8cc42d0c Mon Sep 17 00:00:00 2001 From: Pluto Date: Sun, 13 Sep 2026 11:53:45 +0530 Subject: [PATCH 08/19] feat: add isNamedSelection api to identify the click source --- src/LiveDevelopment/BrowserScripts/RemoteFunctions.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/LiveDevelopment/BrowserScripts/RemoteFunctions.js b/src/LiveDevelopment/BrowserScripts/RemoteFunctions.js index 3272d1f8ad..17c9c9a8af 100644 --- a/src/LiveDevelopment/BrowserScripts/RemoteFunctions.js +++ b/src/LiveDevelopment/BrowserScripts/RemoteFunctions.js @@ -258,6 +258,7 @@ function RemoteFunctions(config = {}) { screenOffset: screenOffset, selectElement: selectElement, isSelectedFromEditor: function () { return _selectedFromEditor; }, + isNamedSelection: _isNamedSelection, sendSelectionToEditor: sendSelectionToEditor, brieflyDisableHoverListeners: brieflyDisableHoverListeners, handleElementClick: handleElementClick, From 6f84fd86c3205cda20c901bf8623f6c329a48367 Mon Sep 17 00:00:00 2001 From: Pluto Date: Sun, 13 Sep 2026 12:52:18 +0530 Subject: [PATCH 09/19] fix: improve numeric value editing support --- src/styles/Extn-LayersPanel.less | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index 0ee3070055..d519ef0332 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -832,7 +832,7 @@ } } - .layers-decl:not(.layers-editing) .layers-decl-value.layers-decl-numeric { + .layers-decl-value.layers-decl-numeric { cursor: ew-resize; } @@ -1029,14 +1029,9 @@ } } - .layers-value-scrub { - cursor: ew-resize; - width: 14px; - color: @project-panel-text-2; - } - input.layers-decl-input[type="text"] { .layers-field-input(); + user-select: text; flex: none; min-width: 3ch; padding: 0 4px; From 39be1827bd66856571cdc4f482f1d2bc3b3b8e20 Mon Sep 17 00:00:00 2001 From: Pluto Date: Sun, 13 Sep 2026 14:33:24 +0530 Subject: [PATCH 10/19] feat: better insert element ui --- src/styles/Extn-LayersPanel.less | 414 +++++++++++++++++++++---------- 1 file changed, 284 insertions(+), 130 deletions(-) diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index d519ef0332..00a5d979ba 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -1264,217 +1264,371 @@ body.layers-scrubbing { } .layers-insert-popup { + @layers-insert-accent: @layers-accent; + @layers-insert-scrollbar: #555555; + @layers-insert-scrollbar-hover: #707070; + position: fixed; z-index: 1000; display: flex; flex-direction: column; box-sizing: border-box; - padding: 12px; border: 1px solid @layers-border; - border-radius: 10px; + border-radius: 3px; background: @bc-ai-sidebar-bg; - box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); color: @project-panel-text-1; - font-size: @sidebar-small-font-size; + color-scheme: dark; + font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; + font-size: 12.5px; + line-height: 1.3; letter-spacing: normal; text-shadow: none; animation: layers-notice-in 90ms ease-out; + button { + margin: 0; + box-shadow: none; + font: inherit; + text-align: left; + + &:focus-visible { + outline: 1px solid @layers-insert-accent; + outline-offset: -1px; + } + } + .layers-insert-head { display: flex; align-items: center; justify-content: space-between; - padding-bottom: 10px; - } - - .layers-insert-title { - font-weight: 500; + gap: 8px; + min-height: 30px; + padding: 0 8px; + background: @layers-input-bg; + flex: none; } .layers-icon-btn { .layers-icon-button(); + width: 22px; + height: 22px; } - .layers-node-icon { + .layers-insert-target { display: flex; align-items: center; - justify-content: center; - width: 20px; - height: 20px; + gap: 4px; + flex: 0 1 auto; + min-width: 0; + } + + .layers-insert-target-name, + .layers-insert-where { + font-size: 11.5px; + font-weight: 600; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .layers-insert-close { + margin-left: auto; + } + + .layers-insert-placement { + position: relative; flex: none; + max-width: 45%; + } + + .layers-insert-position { + width: auto; + max-width: 100%; + box-sizing: border-box; + height: 24px; + margin: 0; + padding: 2px 24px 2px 7px; + border: 1px solid @layers-border; + border-radius: 3px; + box-shadow: none; + background: @layers-input-bg; + color: @project-panel-text-1; + font: inherit; + font-size: 11.5px; + text-overflow: ellipsis; + appearance: none; + cursor: pointer; + + &:hover { + background: @layers-hover-bg; + border-color: fade(@layers-insert-accent, 40%); + } + + &:focus-visible { + outline: 1px solid @layers-insert-accent; + outline-offset: -1px; + } + + option { + background: @bc-ai-sidebar-bg; + color: @project-panel-text-1; + } + } + + .layers-insert-chevron { + position: absolute; + top: 0; + right: 6px; + bottom: 0; + display: flex; + align-items: center; color: @project-panel-text-2; + pointer-events: none; svg { - width: 18px; - height: 18px; + width: 12px; + height: 12px; } } .layers-insert-search { + flex: none; display: flex; align-items: center; - gap: 8px; - height: 32px; - flex: none; - padding: 0 10px; - border: 1px solid @layers-border; - border-radius: 6px; + position: relative; + margin-bottom: 6px; + } + + .layers-insert-search-icon { + position: absolute; + left: 7px; + display: flex; + align-items: center; + color: @project-panel-text-2; + pointer-events: none; + } + + .layers-insert-search-icon > svg { + width: 13px; + height: 13px; + } + + .layers-insert-search input[type="text"] { + height: auto; + margin: 0; + box-shadow: none; + line-height: 1.3; + width: 100%; background: @layers-input-bg; + border: 1px solid @layers-border; + border-radius: 3px; + color: @project-panel-text-1; + font-size: 12px; + padding: 4px 8px 4px 26px; + outline: none; + font-family: inherit; + box-sizing: border-box; + } - &:focus-within { - border-color: @layers-accent; - } + .layers-insert-search input[type="text"]:focus { + border-color: @layers-insert-accent; + } - > svg { - width: 14px; - height: 14px; - flex: none; - color: @project-panel-text-2; - } + .layers-insert-search.layers-insert-search-connected { + margin-bottom: 0; + } - input[type="text"] { - flex: 1; - min-width: 0; - height: 100%; - padding: 0; - margin: 0; - border: none; - outline: none; - box-shadow: none; - background: transparent; - color: @project-panel-text-1; - font: inherit; + .layers-insert-search-connected input[type="text"] { + border-radius: 3px 3px 0 0; + } - &::placeholder { - color: @project-panel-text-2; - } - } + .layers-insert-search input[type="text"]::placeholder { + color: @project-panel-text-2; + } + + .layers-insert-content { + display: flex; + flex-direction: column; + flex: 1; + min-height: 0; + padding: 8px; } .layers-insert-list { - margin: 10px 0; - overflow-y: auto; + flex: 1; + overflow-y: scroll; overflow-x: hidden; min-height: 0; + scrollbar-width: thin; + scrollbar-color: @layers-insert-scrollbar @bc-ai-sidebar-bg; + scrollbar-gutter: stable; + overscroll-behavior: contain; + } + + @supports selector(::-webkit-scrollbar) { + .layers-insert-list { + scrollbar-width: auto; + scrollbar-color: auto; + } + } + + .layers-insert-list::-webkit-scrollbar { + width: 6px !important; + height: 6px !important; + background: @bc-ai-sidebar-bg !important; + } + + .layers-insert-list::-webkit-scrollbar-track { + margin: 0 !important; + background: @bc-ai-sidebar-bg !important; + } + + .layers-insert-list::-webkit-scrollbar-thumb { + border: none !important; + border-radius: 3px !important; + background: @layers-insert-scrollbar !important; + background-clip: padding-box !important; + } + + .layers-insert-list::-webkit-scrollbar-thumb:hover { + background: @layers-insert-scrollbar-hover !important; + } + + .layers-insert-list::-webkit-scrollbar-corner { + background: @bc-ai-sidebar-bg !important; } .layers-insert-grid { display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 4px; + grid-template-columns: 1fr 1fr; + gap: 8px 12px; } - .layers-insert-item { + .layers-insert-tile { display: flex; align-items: center; - gap: 9px; + gap: 7px; + padding: 6px; + border: 1px solid @layers-border; + border-radius: 3px; + cursor: pointer; min-width: 0; - padding: 9px; - margin: 0; - border: 1px solid transparent; - border-radius: 6px; background: transparent; - color: @project-panel-text-1; - text-align: left; - font: inherit; - cursor: pointer; + transition: + border-color 0.12s, + background 0.12s; + } - &.layers-insert-selected, - &:hover { - background: @layers-accent-soft; + .layers-insert-tile:hover { + background: @layers-hover-bg; + border-color: @layers-insert-accent; + } - .layers-node-icon { - color: @layers-accent; - } - } + .layers-node-icon { + display: flex; + align-items: center; + flex-shrink: 0; + color: @project-panel-text-2; + } - &:focus-visible { - outline: 1px solid @layers-accent; - outline-offset: -1px; - } + .layers-node-icon > svg { + width: 16px; + height: 16px; + stroke-width: 1.8px; } - .layers-insert-item-name { + .layers-insert-item-text { + display: flex; + align-items: baseline; + justify-content: space-between; min-width: 0; overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + flex: 1; } - .layers-insert-more { - display: flex; - align-items: center; - justify-content: center; - gap: 5px; + .layers-insert-item-text-inner { + display: inline-flex; + align-items: baseline; + gap: 4px; + white-space: nowrap; width: 100%; - margin: 8px 0 0; - padding: 6px; - border: none; - border-radius: 4px; - background: transparent; - color: @project-panel-text-2; - font: inherit; - cursor: pointer; + justify-content: space-between; + } - svg { - width: 12px; - height: 12px; - } + .layers-insert-tile:hover .layers-insert-item-text-inner { + animation: layers-insert-text-scroll 2s ease-in-out 0.3s; + } - &.layers-insert-open svg { - transform: rotate(180deg); - } + @keyframes layers-insert-text-scroll { + 0%, 15% { transform: translateX(0); } + 50% { transform: translateX(min(0px, calc(-100% + 140px))); } + 85%, 100% { transform: translateX(0); } + } - &:hover { - background: @layers-hover-bg; - color: @project-panel-text-1; - } + .layers-insert-item-name { + font-size: 11.5px; + color: @project-panel-text-1; + white-space: nowrap; + line-height: 1.3; + } + + .layers-insert-item-tag { + font-size: 9.5px; + color: @layers-insert-accent; + font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; + line-height: 1.3; } .layers-insert-create { - width: 100%; + display: flex; + align-items: center; + gap: 6px; + padding: 5px 8px 5px 26px; + cursor: pointer; + border-radius: 0 0 3px 3px; + margin: 0 0 6px; + border: 1px solid @layers-border; + border-top: none; + background: transparent; + flex-shrink: 0; + } + + .layers-insert-create:hover { + background: @layers-hover-bg; } .layers-insert-empty { - padding: 14px 8px; + font-size: 11px; color: @project-panel-text-2; + font-style: italic; + padding: 12px 4px; + text-align: center; } - .layers-insert-placement { - display: flex; - align-items: center; - gap: 8px; - padding-top: 10px; - border-top: 1px solid @layers-border; + .layers-insert-custom { flex: none; - min-width: 0; - color: @project-panel-text-2; } - .layers-insert-position { - width: auto; - height: 28px; - margin: 0; - padding: 2px 6px; - border: 1px solid @layers-border; - border-radius: 5px; - background: @bc-ai-sidebar-bg; - color: @project-panel-text-1; - font: inherit; - cursor: pointer; - } + .layers-insert-create { + width: 100%; + box-sizing: border-box; + color: @project-panel-text-2; - .layers-insert-target { - display: flex; - align-items: center; - gap: 5px; - min-width: 0; - } + .layers-node-icon svg { + width: 14px; + height: 14px; + } - .layers-insert-target-name { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + .layers-insert-item-name { + font-size: 12px; + color: @project-panel-text-2; + + span { + color: @project-panel-text-1; + font-weight: 600; + } + } } } From e00d27986d967dce32d8c4578081c4c046a4679e Mon Sep 17 00:00:00 2001 From: Pluto Date: Sun, 13 Sep 2026 14:42:49 +0530 Subject: [PATCH 11/19] feat: remove redundant add style feature --- src/nls/root/strings.js | 14 ------------- src/styles/Extn-LayersPanel.less | 36 +------------------------------- 2 files changed, 1 insertion(+), 49 deletions(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 02735c2f46..18dbbeeb1d 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -836,20 +836,6 @@ define({ "LIVE_PREVIEW_LAYERS_PASTE_FAILED": "Couldn’t paste these properties. Try again.", "LIVE_PREVIEW_LAYERS_PASTED": "Properties pasted into {0}", "LIVE_PREVIEW_LAYERS_COPY_FAILED": "Couldn’t copy these styles. Try again.", - "LIVE_PREVIEW_LAYERS_ADD_STYLE": "Add style", - "LIVE_PREVIEW_LAYERS_STYLE_KIND": "Style type", - "LIVE_PREVIEW_LAYERS_STYLE_CLASS": "Class", - "LIVE_PREVIEW_LAYERS_STYLE_NAME": "Name", - "LIVE_PREVIEW_LAYERS_STYLE_NAME_HINT": "e.g. card", - "LIVE_PREVIEW_LAYERS_STYLE_FILE": "Save in", - "LIVE_PREVIEW_LAYERS_STYLE_IN_PAGE": "This page", - "LIVE_PREVIEW_LAYERS_STYLE_NEW_FILE": "New stylesheet…", - "LIVE_PREVIEW_LAYERS_STYLE_FILENAME": "Filename", - "LIVE_PREVIEW_LAYERS_STYLE_HELP": "The class or ID is applied to this element. New stylesheets are created beside this page and linked automatically.", - "LIVE_PREVIEW_LAYERS_STYLE_INVALID_NAME": "Use a name starting with a letter or underscore, followed by letters, numbers, hyphens or underscores.", - "LIVE_PREVIEW_LAYERS_STYLE_INVALID_FILE": "Enter a filename ending in .css, without folders.", - "LIVE_PREVIEW_LAYERS_STYLE_DUPLICATE_ID": "Another element already uses this ID. Choose a different name.", - "LIVE_PREVIEW_LAYERS_STYLE_FAILED": "Couldn’t add the style.", "LIVE_PREVIEW_LAYERS_SAVE_TARGET": "Styles bar changes are saved here", "LIVE_PREVIEW_LAYERS_INSERT_POSITION": "Placement", "LIVE_PREVIEW_LAYERS_INSERT_INTO_PAGE": "Add to the page", diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index 00a5d979ba..e2726e7c73 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -297,7 +297,7 @@ flex-shrink: 0; } - .layers-section-actions .layers-hdr-btn:not(.layers-active):not(.layers-add-style) { + .layers-section-actions .layers-hdr-btn:not(.layers-active) { display: none; } @@ -1880,40 +1880,6 @@ body.layers-dnd-invalid { } } -.layers-style-dialog { - width: 420px; - - .layers-hidden { - display: none; - } - - .layers-style-form-field { - display: flex; - flex-direction: column; - gap: 6px; - margin-bottom: 14px; - - input, - select { - box-sizing: border-box; - width: 100%; - height: 32px; - margin: 0; - } - } - - .layers-style-help { - color: @project-panel-text-2; - font-size: @sidebar-small-font-size; - line-height: 1.5; - } - - .layers-style-error { - color: #e89a9a; - font-size: @sidebar-small-font-size; - } -} - .layers-color-popup { position: fixed; z-index: 1000; From 20c7fdf81895800a92d166a8df6956c26df0c6f4 Mon Sep 17 00:00:00 2001 From: Pluto Date: Sun, 13 Sep 2026 15:08:15 +0530 Subject: [PATCH 12/19] feat: move inline style editing to the header section --- src/nls/root/strings.js | 2 +- src/styles/Extn-LayersPanel.less | 25 +++++++------------------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 18dbbeeb1d..5f7db5b204 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -836,7 +836,7 @@ define({ "LIVE_PREVIEW_LAYERS_PASTE_FAILED": "Couldn’t paste these properties. Try again.", "LIVE_PREVIEW_LAYERS_PASTED": "Properties pasted into {0}", "LIVE_PREVIEW_LAYERS_COPY_FAILED": "Couldn’t copy these styles. Try again.", - "LIVE_PREVIEW_LAYERS_SAVE_TARGET": "Styles bar changes are saved here", + "LIVE_PREVIEW_LAYERS_ADD_INLINE_STYLE": "Add Inline Style", "LIVE_PREVIEW_LAYERS_INSERT_POSITION": "Placement", "LIVE_PREVIEW_LAYERS_INSERT_INTO_PAGE": "Add to the page", "LIVE_PREVIEW_LAYERS_INSERT_LOADING": "Loading elements…", diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index e2726e7c73..e637bf04e0 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -297,7 +297,7 @@ flex-shrink: 0; } - .layers-section-actions .layers-hdr-btn:not(.layers-active) { + .layers-section-actions .layers-hdr-btn:not(.layers-active):not(.layers-add-inline) { display: none; } @@ -320,6 +320,12 @@ } } + .layers-add-inline:disabled { + opacity: 0.4; + background: none; + cursor: default; + } + .layers-maximize { opacity: 0; @@ -1147,23 +1153,6 @@ font-size: @sidebar-small-font-size; } - .layers-rule-target .layers-rule-header { - background: @layers-accent-soft; - border-radius: 4px; - } - - .layers-rule-target-mark { - display: flex; - flex: none; - margin-left: 4px; - color: @layers-accent; - - svg { - width: 12px; - height: 12px; - } - } - .layers-rule-selector { flex: 1; min-width: 0; From 8df1cc7f31e4131fdf62719b1a6429a1ff383864 Mon Sep 17 00:00:00 2001 From: Pluto Date: Sun, 13 Sep 2026 15:48:16 +0530 Subject: [PATCH 13/19] feat: improved copy paste support --- src/nls/root/strings.js | 6 ++- src/styles/Extn-LayersPanel.less | 74 +++++++++++++++++++++++++++----- 2 files changed, 68 insertions(+), 12 deletions(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 5f7db5b204..dad4322828 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -830,8 +830,10 @@ define({ "LIVE_PREVIEW_LAYERS_INSERT_ELEMENT": "Insert Element", "LIVE_PREVIEW_LAYERS_CHANGE_COLOR": "Change color", "LIVE_PREVIEW_LAYERS_COPY_DECLARATION": "Copy property", - "LIVE_PREVIEW_LAYERS_COPY_RULE": "Copy selector and properties", - "LIVE_PREVIEW_LAYERS_PASTE_HINT": "Paste properties or a CSS rule here", + "LIVE_PREVIEW_LAYERS_COPY_RULE": "Copy rule", + "LIVE_PREVIEW_LAYERS_PASTE_PROPERTIES": "Paste properties", + "LIVE_PREVIEW_LAYERS_PASTE": "Paste", + "LIVE_PREVIEW_LAYERS_STYLES_MENU_HINT": "Right-click to copy or paste styles", "LIVE_PREVIEW_LAYERS_PASTE_INVALID": "Paste CSS properties or one complete selector at a time.", "LIVE_PREVIEW_LAYERS_PASTE_FAILED": "Couldn’t paste these properties. Try again.", "LIVE_PREVIEW_LAYERS_PASTED": "Properties pasted into {0}", diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index e637bf04e0..785d263428 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -1087,10 +1087,56 @@ display: flex; } - .layers-decl.layers-editing .layers-decl-actions { + .layers-decl.layers-editing .layers-decl-actions, + .layers-decl.layers-copied .layers-decl-actions { display: none; } + .layers-decl.layers-menu-target, + .layers-rule-header.layers-menu-target { + background: @layers-hover-bg; + } + + .layers-decl.layers-copied { + animation: layers-flash-row 800ms ease-out; + } + + .layers-rule-header.layers-copied { + border-radius: 3px; + animation: layers-flash-row 800ms ease-out; + } + + .layers-copied-tip { + position: fixed; + z-index: 10; + display: flex; + align-items: center; + gap: 4px; + box-sizing: border-box; + height: 20px; + margin-top: -10px; + padding: 0 8px 0 6px; + border: 1px solid fade(@layers-accent, 55%); + border-radius: 10px; + background: #2a2a2a; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); + color: @project-panel-text-1; + font-size: @sidebar-xs-font-size; + white-space: nowrap; + pointer-events: none; + animation: layers-copied-tip 1400ms ease-out forwards; + + .layers-copied-icon { + display: flex; + color: @layers-accent; + + svg { + width: 12px; + height: 12px; + } + } + } + .layers-decl.layers-overridden { .layers-decl-field { text-decoration: line-through; @@ -1130,15 +1176,6 @@ min-height: 20px; } - .layers-rule-copy { - opacity: 0; - } - - .layers-rule-header:hover .layers-rule-copy, - .layers-rule-header:focus-within .layers-rule-copy { - opacity: 1; - } - .layers-rule-header:focus-visible { outline: 1px solid @layers-accent; outline-offset: 2px; @@ -1819,6 +1856,23 @@ body.layers-dnd-invalid { } } +@keyframes layers-copied-tip { + 0% { + opacity: 0; + transform: translateY(4px); + } + + 12%, 80% { + opacity: 1; + transform: none; + } + + 100% { + opacity: 0; + transform: none; + } +} + @keyframes layers-notice-in { 0% { opacity: 0; From 606504a2f7727f98ce31ceaaf2bd899744b53766 Mon Sep 17 00:00:00 2001 From: Pluto Date: Mon, 14 Sep 2026 11:34:48 +0530 Subject: [PATCH 14/19] feat: always show element.style in styles section --- src/nls/root/strings.js | 1 - src/styles/Extn-LayersPanel.less | 26 ++++++++++++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index dad4322828..c88cd4cf02 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -838,7 +838,6 @@ define({ "LIVE_PREVIEW_LAYERS_PASTE_FAILED": "Couldn’t paste these properties. Try again.", "LIVE_PREVIEW_LAYERS_PASTED": "Properties pasted into {0}", "LIVE_PREVIEW_LAYERS_COPY_FAILED": "Couldn’t copy these styles. Try again.", - "LIVE_PREVIEW_LAYERS_ADD_INLINE_STYLE": "Add Inline Style", "LIVE_PREVIEW_LAYERS_INSERT_POSITION": "Placement", "LIVE_PREVIEW_LAYERS_INSERT_INTO_PAGE": "Add to the page", "LIVE_PREVIEW_LAYERS_INSERT_LOADING": "Loading elements…", diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index 785d263428..d639da9a4f 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -297,7 +297,7 @@ flex-shrink: 0; } - .layers-section-actions .layers-hdr-btn:not(.layers-active):not(.layers-add-inline) { + .layers-section-actions .layers-hdr-btn:not(.layers-active) { display: none; } @@ -320,12 +320,6 @@ } } - .layers-add-inline:disabled { - opacity: 0.4; - background: none; - cursor: default; - } - .layers-maximize { opacity: 0; @@ -964,7 +958,8 @@ color: @layers-prop-name; } - .layers-decl { + .layers-decl, + .layers-rule-empty { position: relative; display: flex; align-items: center; @@ -983,6 +978,21 @@ } } + .layers-rule-empty { + opacity: 0.4; + cursor: text; + + &:hover, + &:focus-visible { + opacity: 0.75; + outline: none; + } + } + + .layers-rule:has(.layers-decl) .layers-rule-empty { + display: none; + } + .layers-decl-name { flex: none; color: @layers-prop-name; From 290a7bc371c30a26df9bf69ab3ec67a84beb9ba9 Mon Sep 17 00:00:00 2001 From: Pluto Date: Mon, 14 Sep 2026 14:10:13 +0530 Subject: [PATCH 15/19] refactor: improve UI of layers panel --- src/styles/Extn-LayersPanel.less | 173 ++++++++++++++++--------------- 1 file changed, 87 insertions(+), 86 deletions(-) diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index d639da9a4f..1b7b4a42be 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -27,10 +27,13 @@ @layers-border: rgba(255, 255, 255, 0.09); @layers-input-bg: rgba(255, 255, 255, 0.04); @layers-input-bg-focus: rgba(255, 255, 255, 0.06); -@layers-row-height: 26px; +@layers-font-size: 13px; +@layers-font-xs: 12px; +@layers-font-tree: 14px; +@layers-row-height: 28px; @layers-label-min-width: 72px; @layers-row-intrinsic-width: 115px; -@layers-tools-width: 96px; +@layers-tools-width: 106px; @layers-indent: 14px; @layers-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; @layers-prop-name: #9cdcfe; @@ -44,8 +47,8 @@ display: flex; align-items: center; justify-content: center; - width: 20px; - height: 20px; + width: 22px; + height: 22px; padding: 0; margin: 0; border: none; @@ -57,8 +60,8 @@ flex: none; svg { - width: 13px; - height: 13px; + width: 14px; + height: 14px; display: block; flex: none; } @@ -71,7 +74,7 @@ .layers-field-input() { box-sizing: border-box; - height: 22px; + height: 24px; padding: 0 6px; margin: 0; border: 1px solid transparent; @@ -81,8 +84,8 @@ background: transparent; color: @project-panel-text-1; font-family: @layers-mono; - font-size: @sidebar-xs-font-size; - line-height: 20px; + font-size: @layers-font-xs; + line-height: 22px; transition: none; &::placeholder { @@ -116,7 +119,7 @@ position: relative; background-color: @bc-ai-sidebar-bg; color: @project-panel-text-1; - font-size: @sidebar-small-font-size; + font-size: @layers-font-size; letter-spacing: normal; text-shadow: none; @@ -163,7 +166,7 @@ .layers-message-title { max-width: 100%; margin-bottom: 5px; - font-size: @sidebar-content-font-size; + font-size: @layers-font-tree; font-weight: 600; line-height: 1.35; color: @project-panel-text-1; @@ -185,7 +188,7 @@ background: @layers-accent-soft; color: @project-panel-text-1; font-family: inherit; - font-size: @sidebar-small-font-size; + font-size: @layers-font-size; font-weight: 500; line-height: 1.35; white-space: normal; @@ -239,13 +242,13 @@ display: flex; align-items: center; gap: 2px; - height: 26px; + height: 28px; padding: 0 6px 0 2px; flex-shrink: 0; box-sizing: border-box; cursor: default; user-select: none; - font-size: @sidebar-xs-font-size; + font-size: @layers-font-xs; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; @@ -260,16 +263,16 @@ display: flex; align-items: center; justify-content: center; - width: 18px; - height: 18px; + width: 20px; + height: 20px; flex: none; border-radius: 4px; color: @project-panel-text-2; cursor: pointer; svg { - width: 18px; - height: 18px; + width: 20px; + height: 20px; transition: transform 120ms ease; } @@ -292,7 +295,7 @@ .layers-section-actions { display: flex; align-items: center; - gap: 4px; + gap: 2px; margin-left: auto; flex-shrink: 0; } @@ -324,8 +327,8 @@ opacity: 0; svg { - width: 11px; - height: 11px; + width: 12px; + height: 12px; } } @@ -393,7 +396,7 @@ align-items: center; gap: 6px; width: 100%; - height: 26px; + height: 28px; padding: 0 6px 0 8px; box-sizing: border-box; border: 1px solid @layers-border; @@ -406,8 +409,8 @@ } > svg { - width: 13px; - height: 13px; + width: 14px; + height: 14px; flex: none; color: @project-panel-text-2; } @@ -424,7 +427,7 @@ background: transparent; color: @project-panel-text-1; font-family: inherit; - font-size: @sidebar-small-font-size; + font-size: @layers-font-size; &::placeholder { color: @project-panel-text-2; @@ -437,8 +440,8 @@ display: inline-flex; align-items: center; justify-content: center; - width: 16px; - height: 16px; + width: 18px; + height: 18px; padding: 0; margin: 0; border: none; @@ -450,8 +453,8 @@ flex: none; svg { - width: 11px; - height: 11px; + width: 12px; + height: 12px; display: block; } @@ -469,7 +472,7 @@ padding-bottom: 6px; min-width: min-content; outline: none; - font-size: @sidebar-content-font-size; + font-size: @layers-font-tree; } .layers-sprite { @@ -560,7 +563,7 @@ border-radius: 6px; background: @layers-input-bg; color: @project-panel-text-1; - font-size: @sidebar-xs-font-size; + font-size: @layers-font-xs; line-height: 1.4; white-space: normal; animation: layers-notice-in 180ms ease-out; @@ -570,15 +573,15 @@ align-items: center; justify-content: center; flex: none; - width: 20px; - height: 20px; + width: 22px; + height: 22px; border-radius: 4px; background: @layers-accent-soft; color: @layers-accent; svg { - width: 12px; - height: 12px; + width: 13px; + height: 13px; display: block; } } @@ -593,15 +596,15 @@ display: flex; align-items: center; justify-content: center; - width: 16px; - height: 16px; + width: 17px; + height: 17px; flex: none; margin-right: 6px; color: @project-panel-text-2; svg { - width: 15px; - height: 15px; + width: 16px; + height: 16px; } } @@ -613,15 +616,15 @@ display: flex; align-items: center; justify-content: center; - width: 15px; - height: 15px; + width: 16px; + height: 16px; flex: none; margin-right: 6px; color: @project-panel-text-2; svg { - width: 15px; - height: 15px; + width: 16px; + height: 16px; display: block; } } @@ -646,8 +649,8 @@ opacity: 0.8; svg { - width: 11px; - height: 11px; + width: 12px; + height: 12px; display: block; } } @@ -669,8 +672,8 @@ margin-top: 1px; svg { - width: 13px; - height: 13px; + width: 14px; + height: 14px; display: block; } } @@ -699,7 +702,7 @@ .layers-node-tools { display: flex; align-items: center; - gap: 1px; + gap: 2px; position: sticky; right: 0; width: fit-content; @@ -744,9 +747,9 @@ position: absolute; left: 0; top: 50%; - width: 6px; - height: 18px; - margin-top: -9px; + width: 8px; + height: 24px; + margin-top: -12px; padding: 0; border: none; border-radius: 0 3px 3px 0; @@ -757,7 +760,7 @@ transition: width 100ms ease, background-color 100ms ease; &:hover { - width: 9px; + width: 11px; background: @layers-accent; } } @@ -845,10 +848,7 @@ } .layers-label { - font-size: 10px; - font-weight: 700; - letter-spacing: 0.04em; - text-transform: uppercase; + font-size: @layers-font-xs; color: @project-panel-text-2; user-select: none; } @@ -857,10 +857,10 @@ display: flex; align-items: center; gap: 6px; - min-height: 24px; + min-height: 26px; .layers-label { - flex: 0 0 44px; + flex: 0 0 48px; } } @@ -886,8 +886,8 @@ padding: 0 5px; color: @project-panel-text-2; font-family: @layers-mono; - font-size: @sidebar-xs-font-size; - line-height: 22px; + font-size: @layers-font-xs; + line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -902,7 +902,7 @@ .layers-attrs-header { display: flex; align-items: center; - min-height: 20px; + min-height: 22px; .layers-label { flex: 1; @@ -928,7 +928,7 @@ display: flex; align-items: center; gap: 4px; - min-height: 24px; + min-height: 26px; .layers-icon-btn { opacity: 0; @@ -942,19 +942,19 @@ .layers-attr-name { flex: 0 1 auto; - min-width: 44px; + min-width: 48px; max-width: 45%; padding-left: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: @layers-mono; - font-size: @sidebar-xs-font-size; + font-size: @layers-font-xs; color: @layers-prop-name; } .layers-attr-row [data-role="name"] { - flex: 0 0 44px; + flex: 0 0 48px; color: @layers-prop-name; } @@ -966,11 +966,11 @@ box-sizing: border-box; min-width: 100%; width: max-content; - min-height: 26px; + min-height: 24px; padding: 0 4px 0 8px; font-family: @layers-mono; - font-size: @sidebar-xs-font-size; - line-height: 22px; + font-size: @layers-font-xs; + line-height: 24px; user-select: none; &:hover { @@ -1024,8 +1024,8 @@ .layers-decl-color { position: relative; flex: none; - width: 12px; - height: 12px; + width: 13px; + height: 13px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 2px; @@ -1123,15 +1123,15 @@ align-items: center; gap: 4px; box-sizing: border-box; - height: 20px; - margin-top: -10px; + height: 22px; + margin-top: -11px; padding: 0 8px 0 6px; border: 1px solid fade(@layers-accent, 55%); - border-radius: 10px; + border-radius: 11px; background: #2a2a2a; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); color: @project-panel-text-1; - font-size: @sidebar-xs-font-size; + font-size: @layers-font-xs; white-space: nowrap; pointer-events: none; animation: layers-copied-tip 1400ms ease-out forwards; @@ -1183,7 +1183,7 @@ display: flex; align-items: center; gap: 6px; - min-height: 20px; + min-height: 22px; } .layers-rule-header:focus-visible { @@ -1197,7 +1197,7 @@ border-radius: 4px; background: @layers-accent-soft; color: @project-panel-text-1; - font-size: @sidebar-small-font-size; + font-size: @layers-font-size; } .layers-rule-selector { @@ -1207,7 +1207,8 @@ text-overflow: ellipsis; white-space: nowrap; font-family: @layers-mono; - font-size: @sidebar-xs-font-size; + font-size: @layers-font-xs; + font-weight: 600; color: @project-panel-text-1; } @@ -1217,7 +1218,7 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - font-size: 10px; + font-size: 11px; color: @project-panel-text-2; cursor: pointer; @@ -1274,8 +1275,8 @@ background: #2f2f2f; color: @project-panel-text-1; font-family: @layers-mono; - font-size: 11px; - line-height: 15px; + font-size: 12px; + line-height: 16px; white-space: nowrap; pointer-events: none; } @@ -1681,8 +1682,8 @@ body.layers-scrubbing { background: #2a2a2a; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.3); font-family: @layers-mono; - font-size: @sidebar-xs-font-size; - line-height: 20px; + font-size: @layers-font-xs; + line-height: 22px; animation: layers-notice-in 90ms ease-out; &::-webkit-scrollbar { @@ -1712,7 +1713,7 @@ body.layers-scrubbing { display: flex; align-items: center; gap: 8px; - height: 22px; + height: 24px; padding: 0 8px; border-radius: 4px; color: #d8d8d8; @@ -1796,14 +1797,14 @@ body.layers-dnd-invalid { border-radius: 4px; background: #2f2f2f; color: #e0e0e0; - font-size: 12px; + font-size: 13px; white-space: nowrap; pointer-events: none; opacity: 0.92; svg { - width: 14px; - height: 14px; + width: 15px; + height: 15px; display: block; } From bac90f46279cd9161579b1703efb7dc569e60148 Mon Sep 17 00:00:00 2001 From: Pluto Date: Mon, 14 Sep 2026 14:43:40 +0530 Subject: [PATCH 16/19] fix: bump styles source label size --- src/styles/Extn-LayersPanel.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index 1b7b4a42be..887c784954 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -1218,7 +1218,7 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - font-size: 11px; + font-size: @layers-font-xs; color: @project-panel-text-2; cursor: pointer; From be3c9413d7a599d8aae4f04d993d6dca6435f3a9 Mon Sep 17 00:00:00 2001 From: Pluto Date: Mon, 14 Sep 2026 14:43:49 +0530 Subject: [PATCH 17/19] fix: match state and pseudo element rules in live preview --- .../BrowserScripts/RemoteFunctions.js | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/LiveDevelopment/BrowserScripts/RemoteFunctions.js b/src/LiveDevelopment/BrowserScripts/RemoteFunctions.js index 17c9c9a8af..96c5929bfb 100644 --- a/src/LiveDevelopment/BrowserScripts/RemoteFunctions.js +++ b/src/LiveDevelopment/BrowserScripts/RemoteFunctions.js @@ -259,6 +259,7 @@ function RemoteFunctions(config = {}) { selectElement: selectElement, isSelectedFromEditor: function () { return _selectedFromEditor; }, isNamedSelection: _isNamedSelection, + toMatchableSelector: toMatchableSelector, sendSelectionToEditor: sendSelectionToEditor, brieflyDisableHoverListeners: brieflyDisableHoverListeners, handleElementClick: handleElementClick, @@ -1127,6 +1128,23 @@ function RemoteFunctions(config = {}) { _clickHighlight.addAll(wanted); } + const RE_STATE_PSEUDO = /::?(?:hover|active|focus-within|focus-visible|focus|visited|target|checked|disabled|enabled|placeholder-shown|before|after|first-line|first-letter|marker|placeholder|selection)\b/gi; + + // A :hover or ::before rule styles the element in a state it is not in right + // now, so it is matched as the plain selector to reach the elements it styles. + function toMatchableSelector(rule) { + const stripped = rule.replace(RE_STATE_PSEUDO, ""); + if (stripped === rule) { + return rule; + } + try { + window.document.querySelector(stripped); + return stripped; + } catch (e) { + return rule; + } + } + /** * Find the best element to select from a list of matched nodes * Prefers: previously selected element > parent of selected > first valid element @@ -1185,7 +1203,7 @@ function RemoteFunctions(config = {}) { // is not useful, similar to how we skip the html tag in isElementInspectable. // The rule can be a comma-separated list of selectors (from multi-cursor), // so we filter out any standalone * segments and keep valid ones. - rule = rule.split(",").map(s => s.trim()).filter(s => s !== "*").join(","); + rule = toMatchableSelector(rule).split(",").map(s => s.trim()).filter(s => s !== "*").join(","); if (!rule) { dismissUIAndCleanupState(); return; From 1d9c155a272a6321640b30802941e80470195da2 Mon Sep 17 00:00:00 2001 From: Pluto Date: Mon, 14 Sep 2026 14:43:59 +0530 Subject: [PATCH 18/19] feat: keep layers selection anchored on caret moves --- .../documents/LiveDocument.js | 27 ++++++++++++++++--- src/styles/Extn-LayersPanel.less | 4 +++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/LiveDevelopment/MultiBrowserImpl/documents/LiveDocument.js b/src/LiveDevelopment/MultiBrowserImpl/documents/LiveDocument.js index 5401a88df9..a61d915bdc 100644 --- a/src/LiveDevelopment/MultiBrowserImpl/documents/LiveDocument.js +++ b/src/LiveDevelopment/MultiBrowserImpl/documents/LiveDocument.js @@ -160,7 +160,9 @@ define(function (require, exports, module) { this.setInstrumentationEnabled(true, true); this.editor.off("cursorActivity", this._onCursorActivity); this.editor.on("cursorActivity", this._onCursorActivity); - this.updateHighlight(); + if (!_isCursorHighlightGated(this)) { + this.updateHighlight(); + } } }; @@ -171,13 +173,29 @@ define(function (require, exports, module) { LiveDocument.prototype._detachFromEditor = function () { if (this.editor) { this._cancelPendingHighlight(); - this.hideHighlight(); + if (!_isCursorHighlightGated(this)) { + this.hideHighlight(); + } this.editor.off("cursorActivity", this._onCursorActivity); } }; let _disableHighlightOnCursor = false; let _cursorHighlightGeneration = 0; + let _cursorHighlightGate = null; + + /** + * Lets something outside the live documents decide whether the caret may move + * the preview highlight, such as a panel holding a selection of its own. + * @param {?function(LiveDocument): boolean} gate Returns false to leave the preview alone; null removes it. + */ + LiveDocument.setCursorHighlightGate = function (gate) { + _cursorHighlightGate = gate || null; + }; + + function _isCursorHighlightGated(liveDoc) { + return !!_cursorHighlightGate && _cursorHighlightGate(liveDoc) === false; + } /** * If tur, it will disable highlights in live preview on cursor movement in editor @@ -210,14 +228,15 @@ define(function (require, exports, module) { */ LiveDocument.prototype._onCursorActivity = function (event, editor) { this._cancelPendingHighlight(); - if (!this.editor || _disableHighlightOnCursor) { + if (!this.editor || _disableHighlightOnCursor || _isCursorHighlightGated(this)) { return; } const self = this; const generation = _cursorHighlightGeneration; this._highlightTimer = window.setTimeout(function () { self._highlightTimer = null; - if (self.editor && !_disableHighlightOnCursor && generation === _cursorHighlightGeneration) { + if (self.editor && !_disableHighlightOnCursor && generation === _cursorHighlightGeneration && + !_isCursorHighlightGated(self)) { self.updateHighlight(); } }, CURSOR_HIGHLIGHT_DEBOUNCE_MS); diff --git a/src/styles/Extn-LayersPanel.less b/src/styles/Extn-LayersPanel.less index 887c784954..473cf2e205 100644 --- a/src/styles/Extn-LayersPanel.less +++ b/src/styles/Extn-LayersPanel.less @@ -520,6 +520,10 @@ box-shadow: inset 2px 0 0 fade(@layers-accent, 40%); } + &.layers-caret-target { + box-shadow: inset 0 0 0 1px fade(@layers-accent, 55%); + } + &.layers-holds-selected { background: @layers-row-holder-bg; } From a520bc59a1b99e4ce1aec907bf72a47596942582 Mon Sep 17 00:00:00 2001 From: Pluto Date: Mon, 14 Sep 2026 15:41:36 +0530 Subject: [PATCH 19/19] build: update pro deps --- tracking-repos.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracking-repos.json b/tracking-repos.json index adb9a3a207..8eb59b4fbb 100644 --- a/tracking-repos.json +++ b/tracking-repos.json @@ -1,5 +1,5 @@ { "phoenixPro": { - "commitID": "b73dd3515ed7b32d410ba924d58abfd4a74523ff" + "commitID": "4629664ecb9aadd961c0881fedbeca3eb7669fa3" } }