forked from BookStackApp/BookStack
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,39 @@ | ||
{{-- This is a placeholder template file provided as a --}} | ||
{{-- convenience to users of the visual theme system. --}} | ||
{{-- convenience to users of the visual theme system. --}} | ||
|
||
<!-- Check if there's a "iframe=true" query parameter in the request --> | ||
@if(request()->query('iframe') === 'true') | ||
|
||
<!-- Set styles for when we're in "iframe mode" --> | ||
<!-- Most of these hide elements to provide a simple "embedded view" --> | ||
<style> | ||
#header, | ||
#sidebar, | ||
#content .button, | ||
.tri-layout-right, | ||
.grid.third.gap-xxl, | ||
.comments-container, | ||
#main-content > .mb-m, | ||
.tri-layout-mobile-tabs | ||
{ | ||
display: none | ||
} | ||
.content-wrap.card | ||
{ | ||
margin: 0; | ||
border: none; | ||
box-shadow: none; | ||
} | ||
</style> | ||
|
||
<!-- Add a script to control dark-mode via JavaScript --> | ||
<!-- if there's also a 'theme' query paramter --> | ||
@if(request()->query('theme')) | ||
<script nonce="{{ $cspNonce }}"> | ||
// Use JavaScript to toggle the 'dark-mode' class on the HTML element to enable/disable | ||
// dark mode based on whether the `theme` query parameter is 'dark'. | ||
document.documentElement.classList.toggle('dark-mode', {{ request()->query('theme') === 'dark' ? 'true' : 'false' }}); | ||
</script> | ||
@endif | ||
@endif |