Skip to content

Commit

Permalink
Remove has-back-button class name
Browse files Browse the repository at this point in the history
  • Loading branch information
stokesman committed Jul 17, 2024
1 parent d4ce22b commit 574b8bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/editor/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ function Header( {
return (
<div
className={ clsx( 'editor-header edit-post-header', {
'has-back-button': hasBackButton,
'has-center': hasCenter,
} ) }
>
{ hasBackButton && (
<motion.div
className="editor-header__back-button"
variants={ backButtonVariations }
transition={ { type: 'tween' } }
>
Expand Down
6 changes: 4 additions & 2 deletions packages/editor/src/components/header/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@
.editor-header__toolbar {
grid-column: 1 / 3;
// When there is no back button or the viewport is <= mobile the margin keeps the content off
// the starting edge. Otherwise, it’s overriden to and the parent’s `gap` does the job instead.
// the starting edge.
> :first-child {
margin-inline: $grid-unit-20 0;
}

.has-back-button.editor-header & {
// This is the typical case, the back button takes up the first column.
.editor-header__back-button + & {
grid-column: 2 / 3;

@include break-mobile {
// Clears the margin; at this breakpoint the parent’s `gap` takes its place.
> :first-child {
margin-inline: 0;
}
Expand Down

0 comments on commit 574b8bc

Please sign in to comment.