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

Scope CSS to Learning Mode templates only #7382

Merged
merged 4 commits into from Dec 13, 2023

Conversation

donnapep
Copy link
Collaborator

@donnapep donnapep commented Dec 13, 2023

Resolves #7226.

Proposed Changes

Some Learning Mode CSS is affecting non-Learning Mode templates. Given that it's not possible to conditionally load CSS for some templates but not for others, this PR scopes the CSS better. This problem was introduced by 997bbf8. Although I tried to reproduce, I didn't see any issue with Astra in the editor after reverting that change.

Having said that, I think an argument could be made as to whether we should be so opinionated about our CSS in the first place, especially for block themes. In the future, we may want to consider defaulting to the theme's fonts, colors etc., and just provide sensible defaults to classic themes (or maybe not even for classic themes either 🤷🏻‍♀️ ).

Testing Instructions

  1. See Sensei overrides block theme's default styles #7226 to ensure it's fixed for block themes.
  2. Activate Astra.
  3. Check the Lesson and Quiz Learning Mode templates. They should look the same or similar as before.
  4. Repeat for Divi or any other classic theme.

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Acceptance criteria is met
  • Decisions are publicly documented
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • New UIs match the designs
  • Different user privileges (admin, teacher, subscriber) are tested as appropriate
  • Code is tested on the minimum supported PHP and WordPress versions
  • User interface changes have been tested on the latest versions of Chrome, Firefox and Safari
  • "Needs Documentation" label is added if this change requires updates to documentation
  • Known issues are created as new GitHub issues

@donnapep donnapep added this to the 4.19.3 milestone Dec 13, 2023
@donnapep donnapep self-assigned this Dec 13, 2023
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

Merging #7382 (934fb41) into trunk (b20234f) will increase coverage by 0.01%.
Report is 5 commits behind head on trunk.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##              trunk    #7382      +/-   ##
============================================
+ Coverage     50.75%   50.77%   +0.01%     
+ Complexity    11149    11145       -4     
============================================
  Files           613      613              
  Lines         47057    47042      -15     
  Branches        404      404              
============================================
  Hits          23884    23884              
+ Misses        22846    22831      -15     
  Partials        327      327              
Files Coverage Δ
includes/class-sensei-settings.php 57.85% <0.00%> (+0.88%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 844675b...934fb41. Read the comment docs.

@donnapep donnapep merged commit a4a8c2b into trunk Dec 13, 2023
23 of 24 checks passed
@donnapep donnapep deleted the fix/non-learning-mode-template-styles branch December 13, 2023 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sensei overrides block theme's default styles
1 participant