Skip to content

Commit

Permalink
Update base-body-start.blade.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoerlitz committed Mar 1, 2024
1 parent d9a9c5e commit 670febf
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion resources/views/layouts/parts/base-body-start.blade.php
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

0 comments on commit 670febf

Please sign in to comment.