@@ -165,11 +165,22 @@ $color-control-label-height: 20px;
165165 * Setup state
166166 */
167167
168- // Ensure that an empty block has space around the appender.
169- .wp-block-navigation-placeholder ,
170- .wp-block-navigation-placeholder__preview ,
171- .is-selected .wp-block-navigation__container {
172- min-height : $grid-unit-05 + $grid-unit-05 + $button-size ;
168+ // Unstyle some inherited placeholder component styles.
169+ .components-placeholder.wp-block-navigation-placeholder {
170+ outline : none ;
171+ padding : 0 ;
172+ box-shadow : none ;
173+ background : none ;
174+ min-height : 0 ;
175+
176+ // Needed for the preview menu items to match actual menu items.
177+ .components-placeholder__fieldset {
178+ font-size : inherit ;
179+ }
180+
181+ .components-placeholder__fieldset .components-button {
182+ margin-bottom : 0 ;
183+ }
173184}
174185
175186// Spinner.
@@ -185,17 +196,24 @@ $color-control-label-height: 20px;
185196 display : flex ;
186197 flex-direction : row ;
187198 align-items : center ;
188- transition : all 0.1s ease-in-out ;
189- @include reduce-motion (" transition" );
199+ flex-wrap : nowrap ;
200+ width : 100% ;
201+ overflow : hidden ;
190202
191- // Style skeleton elements.
203+ // Style skeleton elements to mostly match the metrics of actual menu items .
192204 // Needs specificity.
193205 .wp-block-navigation-link.wp-block-navigation-link {
194- border-radius : $radius-block-ui ;
195- background : currentColor ;
206+ position : relative ;
196207 min-width : 72px ;
197- height : $grid-unit-20 ;
198- margin : $grid-unit-15 $grid-unit-30 $grid-unit-15 0 ;
208+
209+ & ::before {
210+ display : block ;
211+ content : " " ;
212+ border-radius : $radius-block-ui ;
213+ background : currentColor ;
214+ height : $grid-unit-20 ;
215+ width : 100% ;
216+ }
199217 }
200218
201219 svg {
@@ -207,22 +225,25 @@ $color-control-label-height: 20px;
207225 opacity : 0.3 ;
208226 }
209227
210- .is-selected & {
211- // Don't show the preview boxes for an empty nav block.
212- opacity : 0 ;
228+ // Don't show the preview boxes for an empty nav block.
229+ // Needs specificity to work for the navigation screen.
230+ .wp-block-navigation.is-selected & .wp-block-navigation-placeholder__preview {
231+ display : none ;
232+ }
213233
214- // Need to show the placeholder box above the preview boxes.
215- position : absolute ;
216- top : 0 ;
217- right : 0 ;
218- bottom : 0 ;
219- left : 0 ;
234+ // ... but be present in larger contexts to size it correctly.
235+ .wp-block-navigation.is-selected .is-large & {
236+ display : flex ;
237+ opacity : 0 ;
238+ width : 0 ;
239+ overflow : hidden ;
240+ flex-wrap : nowrap ;
220241 }
221242}
222243
223244// Selected state.
224245.wp-block-navigation-placeholder__controls {
225- padding : $grid-unit-05 $grid-unit- 10 ;
246+ padding : $grid-unit-10 ;
226247 border-radius : $radius-block-ui ;
227248 background-color : $white ;
228249 box-shadow : inset 0 0 0 $border-width $gray-900 ;
@@ -232,18 +253,25 @@ $color-control-label-height: 20px;
232253 position : relative ;
233254 z-index : 1 ;
234255
256+ // Adjust padding for when shown horizontally.
257+ .is-large & {
258+ padding : $grid-unit-05 $grid-unit-10 ;
259+ }
260+
235261 // If an ancestor has a text-decoration property applied, it is inherited regardless of
236262 // the specificity of a child element. Only pulling the child out of the flow fixes it.
237263 // See also https://www.w3.org/TR/CSS21/text.html#propdef-text-decoration.
238264 float : left ;
239265 width : 100% ;
240266
241267 // Show when selected.
242- .is-selected & {
268+ .wp-block-navigation. is-selected & {
243269 display : flex ;
244270 }
245271
246- // Vertical navigation.
272+ // Show stacked for the vertical navigation, or small placeholders.
273+ .is-small & ,
274+ .is-medium & ,
247275 .is-vertical & {
248276 .wp-block-navigation-placeholder__actions {
249277 flex-direction : column ;
@@ -263,13 +291,12 @@ $color-control-label-height: 20px;
263291 // Block title
264292 .wp-block-navigation-placeholder__actions__indicator {
265293 margin-right : $grid-unit-15 ;
266- padding : ( $grid-unit-15 / 2 ) 0 ;
294+ padding : 0 ;
267295 align-items : center ;
268296 justify-content : flex-start ;
269- display : none ;
270297 line-height : 0 ;
271298
272- // line up with the icon in the toolbar.
299+ // Line up with the icon in the toolbar.
273300 margin-left : $grid-unit-05 + $border-width ;
274301
275302 svg {
@@ -281,7 +308,9 @@ $color-control-label-height: 20px;
281308 margin-left : 0 ;
282309 }
283310
284- @include break-small {
311+ // Show only in big placeholders.
312+ display : none ;
313+ .is-large & {
285314 display : inline-flex ;
286315 }
287316 }
0 commit comments