File tree Expand file tree Collapse file tree
src/LiveDevelopment/BrowserScripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -649,6 +649,13 @@ function RemoteFunctions(config = {}) {
649649 _cssSelectorHighlightTimer = null ;
650650 }
651651 if ( _cssSelectorHighlight ) {
652+ // Restore original outlines on highlighted elements
653+ _cssSelectorHighlight . elements . forEach ( function ( el ) {
654+ if ( el . _originalCssSelectorOutline !== undefined ) {
655+ el . style . outline = el . _originalCssSelectorOutline ;
656+ delete el . _originalCssSelectorOutline ;
657+ }
658+ } ) ;
652659 _cssSelectorHighlight . clear ( ) ;
653660 _cssSelectorHighlight = null ;
654661 }
@@ -667,6 +674,12 @@ function RemoteFunctions(config = {}) {
667674 LivePreviewView . isElementInspectable ( nodes [ i ] , true ) &&
668675 nodes [ i ] . nodeType === Node . ELEMENT_NODE ) {
669676 _cssSelectorHighlight . add ( nodes [ i ] ) ;
677+ // Apply outline to all matching elements so they are visible
678+ // even when they have no margin/padding
679+ nodes [ i ] . _originalCssSelectorOutline = nodes [ i ] . style . outline ;
680+ const isEditable = nodes [ i ] . hasAttribute ( GLOBALS . DATA_BRACKETS_ID_ATTR ) ;
681+ const outlineColor = isEditable ? COLORS . outlineEditable : COLORS . outlineNonEditable ;
682+ nodes [ i ] . style . outline = `1px solid ${ outlineColor } ` ;
670683 }
671684 }
672685 _cssSelectorHighlight . selector = rule ;
You can’t perform that action at this time.
0 commit comments