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 Sensei learning mode styles overriding global styles #5903

Merged
merged 5 commits into from Oct 11, 2022

Conversation

mikeyarce
Copy link
Member

Fixes the issue where our lesson-mode.css was overriding global styles like button styles.

renatho
renatho previously approved these changes Oct 11, 2022
Copy link
Contributor

@renatho renatho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked in Divi, and now the button has the original Divi style.

@codecov
Copy link

codecov bot commented Oct 11, 2022

Codecov Report

Merging #5903 (3209112) into trunk (1cf6e34) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              trunk    #5903   +/-   ##
=========================================
  Coverage     44.44%   44.45%           
  Complexity     9051     9051           
=========================================
  Files           441      441           
  Lines         32411    32409    -2     
  Branches        274      274           
=========================================
+ Hits          14405    14406    +1     
+ Misses        17801    17798    -3     
  Partials        205      205           
Impacted Files Coverage Δ
includes/blocks/course-theme/class-ui.php 0.00% <ø> (ø)
includes/class-sensei-quiz.php 59.34% <0.00%> (+0.13%) ⬆️

Continue to review full report at Codecov.

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

@mikeyarce mikeyarce changed the title Make button style more specific to not conflict with global styles Fix Sensei learning mode styles overriding global styles Oct 11, 2022
Copy link
Contributor

@renatho renatho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also found some other styles in the CSS being applied to the page without a Sensei specificity.

body {
  --sensei-primary-color: var(--sensei-primary-color-global, var(--sensei-course-theme-primary-color, var(--wp--preset--color--primary, #307771)));
  --sensei-background-color: var(--sensei-background-color-global, var(--sensei-course-theme-background-color, var(--wp--preset--color--background, #ffffff)));
  --sensei-primary-contrast-color: var(--sensei-background-color, #FFFFFF);
  --sensei-text-color: var(--sensei-text-color-global, var(--sensei-course-theme-foreground-color, var(--wp--preset--color--text, var(--wp--preset--color--foreground, #1E1E1E))));
  --border-color: rgba(125, 125, 125, 0.3);
  background-color: var(--sensei-background-color);
  color: var(--sensei-text-color);
}
.wp-block-site-logo .custom-logo-link {
  margin: 0;
}

.wp-site-blocks {
  display: block;
}
.entry-content img {
  max-width: 100%;
  height: auto;
}
.entry-content embed,
.entry-content iframe,
.entry-content object {
  max-width: 100%;
}

Should we also check these ones?

@mikeyarce
Copy link
Member Author

Can we add a GH issue to tackle those separately? I would like to do more testing as I don’t know where they are supposed to be applied in the first place

@mikeyarce mikeyarce merged commit 42be11c into trunk Oct 11, 2022
@mikeyarce mikeyarce deleted the fix/global-button-styles-issue branch October 11, 2022 21:03
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.

None yet

2 participants