Skip to content

Commit

Permalink
2024 Theme: Improve single Lesson responsive header
Browse files Browse the repository at this point in the history
Account for standalone lessons and smallest screen sizes

See #2637
  • Loading branch information
adamwoodnz committed Jul 22, 2024
1 parent addb96e commit 01fc9b6
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions wp-content/themes/pub/wporg-learn-2024/src/style/_sensei.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,23 @@ body.sensei {
}
}

// Hide the Lesson title breadcrumb as it's already displayed in the h1, and the leading slash.
@media screen and (max-width: 1024px) {
.wp-block-wporg-site-breadcrumbs span:not(:last-child):not(:first-child) {
display: none;
.wp-block-wporg-site-breadcrumbs span {
&:last-child,
&:nth-child(3)::after {
display: none;
}
}
}

// Leave only the 'Home' breadcrumb. The 'Exit Course' button enables navigating to the parent course.
@media screen and (max-width: 600px) {
.wp-block-wporg-site-breadcrumbs span {
&:not(:first-child),
&::after {
display: none;
}
}
}

Expand Down Expand Up @@ -260,6 +274,7 @@ body.sensei {
border-bottom: 1px solid var(--wp--custom--color--border);
}

.wp-block-sensei-lms-sidebar-toggle-button,
.wp-block-sensei-lms-exit-course,
.wp-block-sensei-lms-course-theme-notices {
display: none;
Expand All @@ -278,6 +293,13 @@ body.sensei {
padding-right: var(--wp--preset--spacing--edge-space);
}
}

// Also hide the leading slash for the Lesson title breadcrumb when it is hidden.
@media screen and (max-width: 1024px) {
.wp-block-wporg-site-breadcrumbs span:nth-child(2)::after {
display: none;
}
}
}

@media (min-width: 782px) {
Expand Down

0 comments on commit 01fc9b6

Please sign in to comment.