Skip to content
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
4 changes: 2 additions & 2 deletions ankihub/gui/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -1288,11 +1288,11 @@ def _steps(self) -> list[TutorialStep]:
media_base = f"/_addons/{aqt.mw.addonManager.addonFromModule(__name__)}/gui/web/media"
steps.append(
QtTutorialStep(
body="Suspended cards won't appear in study sessions. In the Browser, "
body="<b>Suspended cards</b> won't appear in study sessions. In the Browser, "
"they're shown with a <span style='background-color: #FFE77E'>yellow background</span>.<br><br>"
"During the tour, you can’t perform actions. Normally, to unsuspend a card, "
"you would right-click it and uncheck <b>Toggle Suspend</b>.<br><br>"
"Click Next and we'll unsuspend a card for you as an example.<br><br>"
"Click <b>Next</b> and we'll unsuspend a card for you as an example.<br><br>"
f"<img src='{media_base}/toggle_suspend.png'>",
qt_target=lambda: self._browser.form.tableView,
parent_widget=lambda: self._browser,
Expand Down
2 changes: 1 addition & 1 deletion ankihub/gui/web/lib/tutorial.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions ankihub/gui/web/lib/tutorial.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
@source "../../../ankihub/gui/tutorial.py";
"""
web_css = re.sub("@source .*", tailwind_sources, web_css)
# Replace :root with :host as tutorial runs in a shadow root
web_css = re.sub(r":root\[(.*?)\]", r":host([\1])", web_css)
web_css = web_css.replace(":root", ":host")
web_css = web_css.replace(".dark", ":host(.dark)")
WEB_CSS_TARGET.write_text(web_css, encoding="utf-8")
subprocess.run([shutil.which("npm"), "install"], cwd=PROJECT_ROOT / "tutorial", check=True)
subprocess.run([shutil.which("npm"), "run", "build"], cwd=PROJECT_ROOT / "tutorial", check=True)
Expand Down
4 changes: 0 additions & 4 deletions tutorial/lib/tutorial.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
transition: background-color 0.3s ease;
}

.night_mode .ah-spotlight-active {
background-color: #1f2937;
}

.ah-spotlight-active.ah-with-backdrop {
backdrop-filter: brightness(2);
z-index: 10001 !important;
Expand Down
10 changes: 6 additions & 4 deletions tutorial/lib/tutorial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ export class TutorialEffect {

async create() {
this.hostElement = document.createElement("div");
if (document.documentElement.classList.contains("night-mode")) {
this.hostElement.classList.add("dark");
}
this.hostElement.style.position = "fixed";
this.hostElement.style.top = "0";
this.hostElement.style.left = "0";
Expand Down Expand Up @@ -173,11 +176,10 @@ export class TutorialEffect {

}

const css = tailwindCss.replaceAll(":root", ":host");
injectPropertyRulesIntoDocument(css);
injectFontImportsIntoDocument(css);
injectPropertyRulesIntoDocument(tailwindCss);
injectFontImportsIntoDocument(tailwindCss);
const style = document.createElement("style");
style.textContent = css;
style.textContent = tailwindCss;
this.shadowRoot.append(style);
Alpine.initTree(this.modalElement);
}
Expand Down
Loading