Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix notice style for not logged in users in learning mode #7264

Merged
merged 16 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions assets/css/3rd-party/themes/course/default.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* Styles specific to default variation
*/
.wp-block-sensei-lms-course-theme-notices {
.sensei-course-theme-locked-lesson-notice {
.is-link.sensei-course-theme__button {
font-size: clamp(1.313rem, 1.188rem + 0.417vw, 1.5rem);
}
}
}
10 changes: 2 additions & 8 deletions assets/css/3rd-party/themes/course/learning-mode.scss
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ body {
margin: 0 0 32px;
}

.wp-block-button__link {
.wp-block-button__link, .is-primary {
background-color: var(--wp--preset--color--background);
color: var(--wp--preset--color--primary);
}
Expand All @@ -288,12 +288,6 @@ body {
opacity: 1;
}

.sensei-course-theme-locked-lesson-notice__actions {
.sensei-course-theme__button {
color: var(--wp--preset--color--background, #1e1e1e);
}
}

.sensei-course-theme__quiz__footer {
.sensei-quiz-pagination {
.sensei-quiz-pagination__list {
Expand All @@ -304,4 +298,4 @@ body {
}
}
}
}
}
23 changes: 17 additions & 6 deletions assets/css/sensei-course-theme/notices.scss
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ body.sensei-course-theme {
}
}

&__text {
& > &__text {
font-size: 24px;
font-weight: 700;
line-height: 1.3;
margin-bottom: 20px;

a {
color: inherit;
Expand All @@ -188,10 +189,20 @@ body.sensei-course-theme {
}

&__actions {
display: flex;
list-style: none;
margin: 18px 0 0;
padding: 0;
gap: 12px;
font-size: 18px;

@media (min-width: $break-medium) {
justify-content: space-between;
}

.is-secondary.sensei-course-theme__button {
background-color: transparent;
border: none;
display: block;
font-family: var(--wp--preset--font-family--body);
text-transform: none;
font-weight: normal;
font-size: 18px;
}
}
}
4 changes: 4 additions & 0 deletions changelog/fix-not-logged-in-style-in-lm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Updated styles of the notice that is shown when student is not logged in in learning mode
4 changes: 2 additions & 2 deletions includes/course-theme/class-sensei-course-theme-lesson.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,12 @@ private function maybe_add_not_enrolled_notice() {
[
'label' => __( 'Take course', 'sensei-lms' ),
'url' => Sensei()->lesson->get_take_course_url( $course_id ),
'style' => 'primary',
'style' => 'primary wp-block-button__link wp-element-button',
],
[
'label' => __( 'Sign in', 'sensei-lms' ),
'url' => $sign_in_url,
'style' => 'secondary',
'style' => 'secondary wp-element-button is-link',
],
];

Expand Down
2 changes: 1 addition & 1 deletion templates/course-theme/locked-lesson-notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function sensei_locked_lesson_notices_map( $notice ) {
</div>
</div>
<?php } ?>
<h2 class="sensei-course-theme-locked-lesson-notice__text"><?php echo wp_kses_post( $notice['text'] ); ?></h2>
<p class="sensei-course-theme-locked-lesson-notice__text"><?php echo wp_kses_post( $notice['text'] ); ?></p>

<?php if ( ! empty( $notice['actions'] ) ) { ?>
<div class="sensei-course-theme-locked-lesson-notice__actions">
Expand Down
Loading