Re-tested and updated iframe hack
This commit is contained in:
parent c16f41f20c
commit 9540c0bf1a
2 changed files with 6 additions and 6 deletions
| @ -2,8 +2,8 @@ | |||
title = "IFrame Specific Tweaks" | ||||
author = "@vincent @ssddanbrown" | ||||
date = 2023-03-20T00:00:00Z | ||||
updated = 2023-03-27T00:00:00Z | ||||
tested = "v23.02.2" | ||||
updated = 2024-04-22T00:00:00Z | ||||
tested = "v24.02.3" | ||||
+++ | ||||
| ||||
This hack will add custom styles & scripts, hiding many parts of the interface while adding additional light/dark mode control, | ||||
| @ -13,8 +13,8 @@ This can be useful if you use BookStack as a knowledge base, and you want to int | |||
| ||||
#### Considerations | ||||
| ||||
- The forced dark/light mode control works via JavaScript, so will not run where a user has | ||||
JavaScript disabled although this is relatively rare. | ||||
- The forced dark/light mode control works via JavaScript, so will not run where a user has JavaScript disabled although this is relatively rare. | ||||
- This specific example will only affect the loaded page view, not subsequent clicks to other parts of the application within the iframe. | ||||
| ||||
#### Usage | ||||
| ||||
| |
| @ -25,7 +25,7 @@ | |||
</style> | ||||
| ||||
<!-- Add a script to control dark-mode via JavaScript --> | ||||
<!-- if there's also a 'theme' query paramter --> | ||||
<!-- if there's also a 'theme' query parameter --> | ||||
@if(request()->query('theme')) | ||||
<script nonce="{{ $cspNonce }}"> | ||||
// Use JavaScript to toggle the 'dark-mode' class on the HTML element to enable/disable | ||||
| @ -33,4 +33,4 @@ | |||
document.documentElement.classList.toggle('dark-mode', {{ request()->query('theme') === 'dark' ? 'true' : 'false' }}); | ||||
</script> | ||||
@endif | ||||
@endif | ||||
@endif | ||||
| |
Loading…
Add table
Add a link
Reference in a new issue