Skip to content

Commit f430850

Browse files
committed
feat: replace layers details tabs with collapsible sections
1 parent bb86dda commit f430850

2 files changed

Lines changed: 41 additions & 49 deletions

File tree

‎src/nls/root/strings.js‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,6 @@ define({
817817
"LIVE_PREVIEW_LAYERS_NEEDS_DESIGN_MODE": "The Layers panel needs design mode.",
818818
"LIVE_PREVIEW_LAYERS_ENABLE_DESIGN_MODE": "Turn on Design Mode",
819819
"LIVE_PREVIEW_LAYERS_ELEMENTS": "Elements",
820-
"LIVE_PREVIEW_LAYERS_DETAILS": "Details",
821820
"LIVE_PREVIEW_LAYERS_SEARCH": "Search elements",
822821
"LIVE_PREVIEW_LAYERS_NO_ELEMENTS": "No elements to show",
823822
"LIVE_PREVIEW_LAYERS_NO_MATCHES": "No matching elements",
@@ -831,8 +830,8 @@ define({
831830
"LIVE_PREVIEW_LAYERS_MOVE_UP": "Move Up",
832831
"LIVE_PREVIEW_LAYERS_MOVE_DOWN": "Move Down",
833832
"LIVE_PREVIEW_LAYERS_REVEAL_IN_CODE": "Reveal in Code",
834-
"LIVE_PREVIEW_LAYERS_TAB_PROPERTIES": "Properties",
835-
"LIVE_PREVIEW_LAYERS_TAB_STYLES": "Styles",
833+
"LIVE_PREVIEW_LAYERS_PROPERTIES": "Properties",
834+
"LIVE_PREVIEW_LAYERS_STYLES": "Styles",
836835
"LIVE_PREVIEW_LAYERS_NO_SELECTION": "Select an element to see its details",
837836
"LIVE_PREVIEW_LAYERS_NOT_IN_SOURCE": "This element is not in the source file",
838837
"LIVE_PREVIEW_LAYERS_NO_STYLES": "No styles applied",

‎src/styles/Extn-LayersPanel.less‎

Lines changed: 39 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,50 @@
119119
flex: 0 0 var(--layers-elements-size, 60%);
120120
}
121121

122-
.layers-section-details {
122+
.layers-details {
123+
display: flex;
124+
flex-direction: column;
123125
flex: 1 1 auto;
126+
min-height: 0;
127+
overflow: auto;
124128
}
125129

126130
.layers-section.layers-collapsed {
127131
flex: 0 0 auto;
128132
}
129133

130-
.layers-panel.layers-details-collapsed .layers-section-elements:not(.layers-collapsed) {
131-
flex: 1 1 auto;
134+
.layers-panel.layers-details-collapsed {
135+
.layers-details {
136+
flex: 0 0 auto;
137+
overflow: hidden;
138+
}
139+
140+
.layers-section-elements:not(.layers-collapsed) {
141+
flex: 1 1 auto;
142+
}
143+
}
144+
145+
.layers-detail-groups {
146+
display: flex;
147+
flex-direction: column;
148+
}
149+
150+
.layers-group {
151+
display: flex;
152+
flex-direction: column;
153+
flex: none;
154+
}
155+
156+
.layers-group-body {
157+
padding: 2px 8px 10px;
158+
}
159+
160+
.layers-group.layers-collapsed .layers-group-body {
161+
display: none;
162+
}
163+
164+
.layers-details-empty {
165+
flex: none;
132166
}
133167

134168
.layers-section-header {
@@ -168,7 +202,7 @@
168202
}
169203
}
170204

171-
.layers-section.layers-collapsed .layers-chevron svg {
205+
.layers-collapsed > .layers-section-header .layers-chevron svg {
172206
transform: rotate(-90deg);
173207
}
174208

@@ -239,8 +273,7 @@
239273
}
240274

241275
.layers-section.layers-collapsed .layers-section-content,
242-
.layers-section.layers-collapsed .layers-search,
243-
.layers-section.layers-collapsed .layers-tabs {
276+
.layers-section.layers-collapsed .layers-search {
244277
display: none;
245278
}
246279

@@ -519,46 +552,6 @@
519552
color: @project-panel-text-2;
520553
}
521554

522-
.layers-tabs {
523-
display: flex;
524-
align-items: stretch;
525-
flex-shrink: 0;
526-
padding: 0 8px;
527-
border-bottom: 1px solid @layers-border;
528-
}
529-
530-
.layers-tab {
531-
padding: 4px 8px 5px;
532-
margin: 0;
533-
border: none;
534-
border-bottom: 2px solid transparent;
535-
background: none;
536-
color: @project-panel-text-2;
537-
font-family: inherit;
538-
font-size: @sidebar-xs-font-size;
539-
font-weight: 600;
540-
cursor: pointer;
541-
outline: none;
542-
543-
&:hover {
544-
color: @project-panel-text-1;
545-
}
546-
547-
&.layers-active {
548-
color: @project-panel-text-1;
549-
border-bottom-color: @layers-accent;
550-
}
551-
}
552-
553-
.layers-pane {
554-
display: none;
555-
padding: 6px 8px 10px;
556-
557-
&.layers-active {
558-
display: block;
559-
}
560-
}
561-
562555
.layers-label {
563556
font-size: 10px;
564557
font-weight: 700;

0 commit comments

Comments
 (0)