Skip to content
Open
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
28 changes: 26 additions & 2 deletions css/block-editor.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/block-editor.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/block-editor.min.css.map

Large diffs are not rendered by default.

26 changes: 25 additions & 1 deletion css/theme.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/theme.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/theme.min.css.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -6471,8 +6471,11 @@ var cpSchoolThemeHelpers = function ($) {
});
}

// Check if user prefers reduced motion.
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;

// Handles basic animations on the site.
if (cpSchoolData.animations) {
if (!prefersReducedMotion && cpSchoolData.animations) {
$('.entry-content > .alignfull, .entry-content > .alignwide, .entry-content > .aligncenter').not('.has-parallax').attr('data-aos', 'fade-up');
$('.entry-content > .alignleft').not('.has-parallax').attr('data-aos', 'fade-right');
$('.entry-content > .alignright').not('.has-parallax').attr('data-aos', 'fade-left');
Expand Down
2 changes: 1 addition & 1 deletion js/theme.min.js

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions sass/theme/_general.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
}
}

.screen-reader-text {
@extend .sr-only;
.screen-reader-text {
@extend .sr-only;
}

a.skip-link {
position: fixed;
z-index: 1000;
Expand Down Expand Up @@ -80,4 +80,15 @@ body.singular:not(.has-sidebar) #content.container, .container-content {

.cps-icon.cps-dashicon {
font-family: dashicons !important;
}
}

@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation: none !important;
transition: none !important;
}

[data-aos] {
opacity: 1 !important;
}
}
4 changes: 4 additions & 0 deletions sass/theme/components/_entries.scss
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ body.blog.hide-hero-page-title {//CUSTOMIZER-ONLY
&.has-parallax {
opacity: initial;
}

@media (prefers-reduced-motion: reduce) {
opacity: initial;
}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/js/custom-javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@
});
}

// Check if user prefers reduced motion.
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;

// Handles basic animations on the site.
if (cpSchoolData.animations) {
if (!prefersReducedMotion && cpSchoolData.animations) {
$('.entry-content > .alignfull, .entry-content > .alignwide, .entry-content > .aligncenter')
.not('.has-parallax')
.attr('data-aos', 'fade-up');
Expand Down